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-connectors.git


The following commit(s) were added to refs/heads/main by this push:
     new 8b3824158 Add -Yfuture-lazy-vals for Scala 3.3.x builds (#1674)
8b3824158 is described below

commit 8b3824158061e1160a9ea26533537f13b6abce67
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sun Jun 14 20:43:41 2026 +0800

    Add -Yfuture-lazy-vals for Scala 3.3.x builds (#1674)
    
    * feat: Add -Yfuture-lazy-vals for Scala 3.3.x builds
    
    Motivation:
    The Scala 3.3.8 compiler introduced the -Yfuture-lazy-vals flag 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 scalacOptions, conditionally applied only
    for Scala 3.3.x via CrossVersion.partialVersion or scalaBinaryVersion.
    
    Result:
    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.
    
    References:
    Refs scala/scala3-lts#637
    Refs apache/pekko#3059
    
    * fix: Add MiMa filters for <clinit> removed by -Yfuture-lazy-vals
    
    -Yfuture-lazy-vals changes the generated bytecode for companion
    objects containing lazy vals: the static <clinit> initializer
    is no longer emitted. Add MiMa filters to exclude these expected
    binary compatibility changes for:
    - aws-spi-pekko-http: PekkoHttpClient
    - google-cloud-bigquery: BigQueryJsonProtocol, BigQueryRestJsonProtocol
    - google-cloud-pub-sub-grpc: ScalaPB-generated grpc objects
    
    * fix: Add missing Handshaker* MiMa filters in google-cloud-pub-sub-grpc
    
    Add 4 DirectMissingMethodProblem filters for HandshakerReq, HandshakerResp,
    HandshakerResult, and HandshakerStatus companion object <clinit> methods
    that are no longer generated with -Yfuture-lazy-vals.
---
 .../future-lazy-vals.excludes                      |  21 ++++
 .../future-lazy-vals.excludes                      |  22 ++++
 .../future-lazy-vals.excludes                      | 114 +++++++++++++++++++++
 project/Common.scala                               |   4 +
 4 files changed, 161 insertions(+)

diff --git 
a/aws-spi-pekko-http/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
 
b/aws-spi-pekko-http/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
new file mode 100644
index 000000000..a95a6d48e
--- /dev/null
+++ 
b/aws-spi-pekko-http/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# -Yfuture-lazy-vals changes the generated bytecode for companion objects
+# containing lazy vals: the static <clinit> initializer that was produced
+# by the old sun.misc.Unsafe-based implementation is no longer emitted.
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.awsspi.PekkoHttpClient.<clinit>")
diff --git 
a/google-cloud-bigquery/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
 
b/google-cloud-bigquery/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
new file mode 100644
index 000000000..2e8240165
--- /dev/null
+++ 
b/google-cloud-bigquery/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# -Yfuture-lazy-vals changes the generated bytecode for companion objects
+# containing lazy vals: the static <clinit> initializer that was produced
+# by the old sun.misc.Unsafe-based implementation is no longer emitted.
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.googlecloud.bigquery.scaladsl.spray.BigQueryJsonProtocol.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.stream.connectors.googlecloud.bigquery.scaladsl.spray.BigQueryRestJsonProtocol.<clinit>")
diff --git 
a/google-cloud-pub-sub-grpc/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
 
b/google-cloud-pub-sub-grpc/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
new file mode 100644
index 000000000..903353280
--- /dev/null
+++ 
b/google-cloud-pub-sub-grpc/src/main/mima-filters/2.0.x.backward.excludes/future-lazy-vals.excludes
@@ -0,0 +1,114 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# -Yfuture-lazy-vals changes the generated bytecode for companion objects
+# containing lazy vals: the static <clinit> initializer that was produced
+# by the old sun.misc.Unsafe-based implementation is no longer emitted.
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.altscontext.AltsContext.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.altscontext.AltsContext#PeerAttributesEntry.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.Endpoint.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakeProtocol.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakeReq.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakeResp.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakeResult.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakeStatus.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakerReq.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakerResp.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakerResult.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.HandshakerStatus.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.Identity.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.Identity#AttributesEntry.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.NetworkProtocol.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.NextHandshakeMessageReq.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.ServerHandshakeParameters.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.StartClientHandshakeReq.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.StartServerHandshakeReq.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.handshaker.StartServerHandshakeReq#HandshakeParametersEntry.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.transport_security_common.RpcProtocolVersions.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.transport_security_common.RpcProtocolVersions#Version.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.alts.internal.transport_security_common.SecurityLevel.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.Address.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.Address#Type.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.ClientHeader.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.GrpcLogEntry.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.GrpcLogEntry#EventType.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.GrpcLogEntry#Logger.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.Message.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.Metadata.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.MetadataEntry.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.ServerHeader.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.binarylog.v1.binarylog.Trailer.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Address.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Address#OtherAddress.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Address#TcpIpAddress.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Address#UdsAddress.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Channel.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ChannelConnectivityState.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ChannelConnectivityState#State.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ChannelData.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ChannelRef.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ChannelTrace.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ChannelTraceEvent.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ChannelTraceEvent#Severity.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetChannelRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetChannelResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetServerRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetServerResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetServerSocketsRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetServerSocketsResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetServersRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetServersResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetSocketRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetSocketResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetSubchannelRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetSubchannelResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetTopChannelsRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.GetTopChannelsResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Security.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Security#OtherSecurity.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Security#Tls.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Server.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ServerData.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.ServerRef.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Socket.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.SocketData.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.SocketOption.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.SocketOptionLinger.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.SocketOptionTcpInfo.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.SocketOptionTimeout.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.SocketRef.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.Subchannel.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.channelz.v1.channelz.SubchannelRef.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.health.v1.health.HealthCheckRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.health.v1.health.HealthCheckResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.health.v1.health.HealthCheckResponse#ServingStatus.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1.reflection.ErrorResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1.reflection.ExtensionNumberResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1.reflection.ExtensionRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1.reflection.FileDescriptorResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1.reflection.ListServiceResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1.reflection.ServerReflectionRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1.reflection.ServerReflectionResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1.reflection.ServiceResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1alpha.reflection.ErrorResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1alpha.reflection.ExtensionNumberResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1alpha.reflection.ExtensionRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1alpha.reflection.FileDescriptorResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1alpha.reflection.ListServiceResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1alpha.reflection.ServerReflectionRequest.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1alpha.reflection.ServerReflectionResponse.<clinit>")
+ProblemFilters.exclude[DirectMissingMethodProblem]("io.grpc.reflection.v1alpha.reflection.ServiceResponse.<clinit>")
diff --git a/project/Common.scala b/project/Common.scala
index d75a307cd..61391a98a 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -67,6 +67,10 @@ object Common extends AutoPlugin {
       "-Wconf:cat=unused-nowarn:s",
       "-Wconf:msg=Prefer the Scala annotation over Java's `@Deprecated`:s",
       "-release:17"),
+    scalacOptions ++= {
+      if (isScala3.value) Seq("-Yfuture-lazy-vals")
+      else Seq.empty
+    },
     Compile / doc / scalacOptions := scalacOptions.value ++ Seq(
       "-doc-title",
       "Apache Pekko Connectors",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to