He-Pin opened a new pull request, #3059: URL: https://github.com/apache/pekko/pull/3059
### Motivation The Scala 3.3.8 compiler introduced the `-Yfuture-lazy-vals` flag ([scala/scala3-lts#637](https://github.com/scala/scala3-lts/pull/637)) to optionally use `VarHandle` instead of `sun.misc.Unsafe` for lazy val implementation. This prepares libraries for upcoming JDK releases that restrict `sun.misc.Unsafe` access. ### Modification Add `-Yfuture-lazy-vals` to `DefaultScalacOptions` in `project/PekkoBuild.scala`, conditionally applied only for Scala 3.3.x via `CrossVersion.partialVersion`: ```scala (CrossVersion.partialVersion(scalaVersion.value) match { case Some((3, 3)) => Seq("-Yfuture-lazy-vals") case _ => Nil }) ``` ### Result Pekko's Scala 3.3.x build uses the future-proof `VarHandle`-based lazy val implementation, compatible with all JDK 9+ versions including future releases that restrict `sun.misc.Unsafe`. ### Tests - `sbt "++3.3.8; actor/compile"` — passed (exit 0, only pre-existing `@SerialVersionUID` and Java unchecked warnings) ### References Refs scala/scala3-lts#637 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
