This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-grpc.git
The following commit(s) were added to refs/heads/main by this push:
new 56ff7f0a Add -Yfuture-lazy-vals and bump Scala 3 to 3.3.8 (#723)
56ff7f0a is described below
commit 56ff7f0a0b0ed952b5f66cba8988467e6b54aa75
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sat Jun 13 21:45:22 2026 +0800
Add -Yfuture-lazy-vals and bump Scala 3 to 3.3.8 (#723)
* Add -Yfuture-lazy-vals and bump Scala 3 to 3.3.8
Motivation:
The Scala 3.3.8 compiler introduced the -Yfuture-lazy-vals flag
(scala/scala3-lts#637) to optionally use VarHandle instead of
sun.misc.Unsafe for lazy val implementation. This prepares libraries
for upcoming JDK releases that restrict Unsafe access.
Modification:
- Add -Yfuture-lazy-vals to Common.scala scalacOptions for Scala 3.3.x
- Bump Scala 3 version from 3.3.7 to 3.3.8 in Dependencies.scala,
sbt-test build files, and GitHub Actions workflows
Result:
pekko-grpc's Scala 3 build uses the future-proof VarHandle-based lazy
val implementation, compatible with all JDK 9+ versions.
Tests:
- sbt "++3.3.8; runtime/compile" passed (exit 0, 230s)
References:
Refs scala/scala3-lts#637
* Fix -Yfuture-lazy-vals requiring -release flag in Test scope
Move -Yfuture-lazy-vals from Compile/scalacOptions to base scalacOptions
and pair it with -release 17, so both Compile and Test scopes satisfy
the compiler requirement.
* Address PR review: simplify -Yfuture-lazy-vals and apply -release 17 to
Test for all Scala versions
---
.github/workflows/build-test.yml | 2 +-
.github/workflows/publish-nightly.yml | 2 +-
.github/workflows/stage-release-candidate.yml | 2 +-
project/Common.scala | 2 ++
sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt | 2 +-
sbt-plugin/src/sbt-test/scala3/02-scala3-sourcegen/build.sbt | 2 +-
6 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index ab570863..b5848014 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -80,7 +80,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- SCALA_VERSION: [2.13.18, 3.3.7]
+ SCALA_VERSION: [2.13.18, 3.3.8]
JAVA_VERSION: [17, 21]
steps:
- name: Checkout
diff --git a/.github/workflows/publish-nightly.yml
b/.github/workflows/publish-nightly.yml
index 5f6e409f..375d1e99 100644
--- a/.github/workflows/publish-nightly.yml
+++ b/.github/workflows/publish-nightly.yml
@@ -40,7 +40,7 @@ jobs:
sbt +publish
sbt ++2.12.21! maven-plugin/publish
sbt ++2.13.18! codegen/publish
- sbt ++3.3.7! codegen/publish
+ sbt ++3.3.8! codegen/publish
env:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PW: ${{ secrets.NEXUS_PW }}
diff --git a/.github/workflows/stage-release-candidate.yml
b/.github/workflows/stage-release-candidate.yml
index a4ea7bbe..709c67c6 100644
--- a/.github/workflows/stage-release-candidate.yml
+++ b/.github/workflows/stage-release-candidate.yml
@@ -231,7 +231,7 @@ jobs:
sbt "set ThisBuild / version := \"$VERSION\"; +publishSigned"
sbt "set ThisBuild / version := \"$VERSION\"; ++2.12.21!
maven-plugin/publishSigned"
sbt "set ThisBuild / version := \"$VERSION\"; ++2.13.18!
codegen/publishSigned"
- sbt "set ThisBuild / version := \"$VERSION\"; ++3.3.7!
codegen/publishSigned"
+ sbt "set ThisBuild / version := \"$VERSION\"; ++3.3.8!
codegen/publishSigned"
sbt "set ThisBuild / version := \"$VERSION\"; sonatypePrepare; set
ThisBuild / version := \"$VERSION\"; sonatypeBundleUpload; sonatypeClose"
env:
REF: ${{ github.ref_name }}
diff --git a/project/Common.scala b/project/Common.scala
index 3b1f7218..e70ba605 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -59,6 +59,7 @@ object Common extends AutoPlugin {
"-deprecation",
"-Werror",
"-Wunused:imports",
+ "-Yfuture-lazy-vals",
"-encoding",
"UTF-8")),
Compile / scalacOptions ++=
@@ -79,6 +80,7 @@ object Common extends AutoPlugin {
javacOptions ++= List("-Xlint:unchecked", "-Xlint:deprecation"),
Compile / compile / javacOptions ++= Seq("--release", "17"),
Compile / compile / scalacOptions ++= Seq("-release", "17"),
+ Test / compile / scalacOptions ++= Seq("-release", "17"),
Compile / doc / scalacOptions := scalacOptions.value ++ Seq(
"-doc-title",
"Apache Pekko gRPC",
diff --git a/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt
b/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt
index a0a9530f..14a49e49 100644
--- a/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt
+++ b/sbt-plugin/src/sbt-test/scala3/01-basic-client-server/build.sbt
@@ -7,7 +7,7 @@
* This file is part of the Apache Pekko project, which was derived from Akka.
*/
-scalaVersion := "3.3.7"
+scalaVersion := "3.3.8"
scalacOptions += "-Xfatal-warnings"
diff --git a/sbt-plugin/src/sbt-test/scala3/02-scala3-sourcegen/build.sbt
b/sbt-plugin/src/sbt-test/scala3/02-scala3-sourcegen/build.sbt
index e36353eb..6bacc82e 100644
--- a/sbt-plugin/src/sbt-test/scala3/02-scala3-sourcegen/build.sbt
+++ b/sbt-plugin/src/sbt-test/scala3/02-scala3-sourcegen/build.sbt
@@ -7,7 +7,7 @@
* This file is part of the Apache Pekko project, which was derived from Akka.
*/
-scalaVersion := "3.3.7"
+scalaVersion := "3.3.8"
scalacOptions += "-Xfatal-warnings"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]