-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazel 8.0.0 compatibility #1652
Comments
I noted in #1625, based on copious notes from cd22d88 (under But, the good news is, Bzlmod builds aren't affected by that particular problem, and Bzlmodification is in the home stretch. Once that lands, we can bump up the FWIW, I've been using rules_java 7.11.1 in my |
Ah. We have a continuation of the protobuf + ScalaPB saga from #1647. If I bump to rules_java 8.5.1 (and rules_cc 0.1.0), and stick with protobuf 21.7 (the current rules_scala version, via single_version_override) or protobuf 24.4 (the latest Bazel Central Registry protobuf module compatible with ScalaPB 0.11.17), I get: $ bazel build //src/... //test/... //third_party/... //scala_proto/...
ERROR: Skipping '//src/...': error loading package under directory 'src':
error loading package 'src/java/io/bazel/rulesscala/io_utils':
at .../external/rules_java~/java/defs.bzl:16:6:
Label '@@protobuf~//bazel:java_lite_proto_library.bzl' is invalid because
'bazel' is not a package; perhaps you meant to put the colon here:
'@@protobuf~//:bazel/java_lite_proto_library.bzl'?
ERROR: error loading package under directory 'src':
error loading package 'src/java/io/bazel/rulesscala/io_utils':
at .../external/rules_java~/java/defs.bzl:16:6:
Label '@@protobuf~//bazel:java_lite_proto_library.bzl' is invalid because
'bazel' is not a package; perhaps you meant to put the colon here:
'@@protobuf~//:bazel/java_lite_proto_library.bzl'? The However, bumping ScalaPB to 1.0.0-alpha.1 and Protobuf v28.3 did work. But as noted in #1647, committing the ScalaPB 1.0.0-alpha.1 bump would mean effectively forcing rules_scala users to upgrade to at least Protobuf v28.2 immediately. Maybe that's what we ought to do anyway, because clearly we don't want to block anyone from upgrading to Bazel 8. But we'd have to shout it from the rooftops—at the same time we try to persuade folks to switch from depending on Even so, rules_cc 0.0.9 and rules_java 7.9.0 still work with Protobuf v28.3 and ScalaPB 1.0.0-alpha.1. That means we wouldn't leave Bazel 6 or 7 |
Ah, more info. The results from my last comment were from building with Bazel 7.4.1. Building with 8.0.0rc4 is not yet possible. First, I had to update to the highest versions of all dependencies in the Bazel module graph: bazel_dep(name = "rules_cc", version = "0.1.0")
bazel_dep(name = "rules_java", version = "8.5.1")
bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "protobuf", version = "29.0-rc3", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_python", version = "0.40.0", dev_dependency = True) I also bumped the following in PROTOBUF_JAVA_VERSION = "4.29.0-RC3" I had to add one, the other, or both of these lines to the load("@rules_java//java/common:java_common.bzl", "java_common")
load("@rules_java//java/common:java_info.bzl", "JavaInfo") But sadly, ScalaPB 1.0.0-alpha.1 and protobuf-java:4.29.0-RC3 aren't compatible: $ bazel build //src/... //test/... //third_party/... //scala_proto/...
ERROR: .../test/proto/BUILD:184:14:
ProtoScalaPBRule test/proto/nested_proto_jvm_extra_protobuf_generator_scalapb.srcjar
failed: (Exit 1): scalapb_worker failed:
error executing ProtoScalaPBRule command
(from target //test/proto:nested_proto)
bazel-out/.../bin/src/scala/scripts/scalapb_worker ...
(remaining 2 arguments skipped)
--jvm_extra_protobuf_generator_out: java.lang.ExceptionInInitializerError
at scalapb.options.compiler.Scalapb$.registerAllExtensions(Scalapb.scala:8)
at scalarules.test.extra_protobuf_generator.ExtraProtobufGenerator$.run(ExtraProtobufGenerator.scala:53)
at protocbridge.frontend.PluginFrontend$.$anonfun$runWithBytes$1(PluginFrontend.scala:51)
at scala.util.Try$.apply(Try.scala:217)
at protocbridge.frontend.PluginFrontend$.runWithBytes(PluginFrontend.scala:51)
at protocbridge.frontend.PluginFrontend$.runWithInputStream(PluginFrontend.scala:121)
at protocbridge.frontend.PosixPluginFrontend$.$anonfun$prepare$2(PosixPluginFrontend.scala:40)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1$$anon$2.block(ExecutionContextImpl.scala:60)
at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3118)
at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1.blockOn(ExecutionContextImpl.scala:71)
at scala.concurrent.package$.blocking(package.scala:124)
at protocbridge.frontend.PosixPluginFrontend$.$anonfun$prepare$1(PosixPluginFrontend.scala:38)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687)
at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: com.google.protobuf.RuntimeVersion$ProtobufRuntimeVersionException:
Detected mismatched Protobuf Gencode/Runtime version suffixes when loading
scalapb.options.Scalapb: gencode 4.28.2, runtime 4.29.0-rc3.
Version suffixes must be the same.
at com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersionImpl(RuntimeVersion.java:126)
at com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(RuntimeVersion.java:71)
at scalapb.options.Scalapb.<clinit>(Scalapb.java:11)
... 22 more
java.lang.RuntimeException: Exit with code 1
at scala.sys.package$.error(package.scala:27)
at scripts.ScalaPBWorker$.work(ScalaPBWorker.scala:44)
at io.bazel.rulesscala.worker.Worker.persistentWorkerMain(Worker.java:96)
at io.bazel.rulesscala.worker.Worker.workerMain(Worker.java:49)
at scripts.ScalaPBWorker$.main(ScalaPBWorker.scala:39)
at scripts.ScalaPBWorker.main(ScalaPBWorker.scala)
ERROR: .../test/proto/BUILD:184:14
Building source jar test/proto/nested_proto_scalapb-src.jar failed:
(Exit 1): scalapb_worker failed:
error executing ProtoScalaPBRule command
(from target //test/proto:nested_proto)
bazel-out/.../bin/src/scala/scripts/scalapb_worker ...
(remaining 2 arguments skipped) Pinning Protobuf to v28.3 using $ bazel build //src/... //test/... //third_party/... //scala_proto/...
ERROR: Skipping '//scala_proto/...':
error loading package under directory 'scala_proto':
error loading package 'scala_proto/private':
Internal error while loading Starlark builtins:
Failed to autoload external symbols:
cannot load '@@protobuf+//bazel/private:bazel_cc_proto_library.bzl':
no such file
ERROR: error loading package under directory 'scala_proto':
error loading package 'scala_proto/private':
Internal error while loading Starlark builtins:
Failed to autoload external symbols:
cannot load '@@protobuf+//bazel/private:bazel_cc_proto_library.bzl':
no such file
These aren't insurmountable issues; perhaps once Protobuf v29.0 lands, I can try again, and ScalaPB v1.0.0-alpha.1 will be happy with plain protobuf-java:4.29.0. Building with Bazel 8 will be blocked until then, even after Bzlmodification. However, building with Bazel 8 will require those new |
I spoke too soon: I can get a So it seems we could bump to Bazel 8 without abandoning Update: To confirm, I went back to Bazel 7.4.1 to build using the new $ bazel build //src/... //test/... //third_party/... //scala_proto/...
ERROR: Traceback (most recent call last):
File ".../external/remote_java_tools/BUILD", line 7, column 60, in <toplevel>
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library")
Error: file '@rules_cc//cc:defs.bzl' does not contain symbol 'cc_proto_library'
ERROR: .../external/remote_java_tools/BUILD:
no such target '@@remote_java_tools//:TurbineDirect':
target 'TurbineDirect' not declared in package ''
defined by .../external/remote_java_tools/BUILD
ERROR: .../test/toolchains/BUILD.bazel:10:23:
no such target '@@remote_java_tools//:TurbineDirect':
target 'TurbineDirect' not declared in package ''
defined by .../external/remote_java_tools/BUILD
and referenced by '//test/toolchains:java21_toolchain'
ERROR: Analysis of target '//test/toolchains:java21_toolchain' failed;
build aborted: Analysis failed |
These changes enable both `WORKSPACE` and Bzlmod builds to reach a point where both fail with the following errors. Part of bazelbuild#1652. - To use `WORKSPACE`, specify `--enable_workspace --noenable_bzlmod` on the command line or add them to `.bazelrc`. Per that issue, the following breakages may be resolved by a new `protobuf-java:4.29.0` release (without the `-RC3` suffix. Then we can try to run the rest of the `rules_scala` test suite. Also per that issue, adopting Bazel 8 and rules_java 8 compatibility will necessarily break Bazel 6 and 7 compatibility. --- Hoisted the `load_rules_dependencies()` macro into the new `//scala:deps.bzl` file to avoid copying everything into `WORKSPACE`. Changed the order of `http_archive()` calls as well. Without importing these repos in this order, the build would break under `WORKSPACE`. Without the `rules_java_dependencies()` and `protobuf_deps()` calls where they are, the build also breaks. --- Under both `WORKSPACE` and Bzlmod, the following build command will fail with a `mismatched Protobuf Gencode/Runtime version suffixes` error: ```txt $ bazel build //src/... //test/... //third_party/... //scala_proto/... ERROR: .../external/protobuf+/src/google/protobuf/BUILD.bazel:130:14: ProtoScalaPBRule external/protobuf+/src/google/protobuf/wrappers_proto_jvm_extra_protobuf_generator_scalapb.srcjar failed: (Exit 1): scalapb_worker failed: error executing ProtoScalaPBRule command (from target @@protobuf+//src/google/protobuf:wrappers_proto) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) --jvm_extra_protobuf_generator_out: java.lang.ExceptionInInitializerError at scalapb.options.compiler.Scalapb$.registerAllExtensions(Scalapb.scala:8) at scalarules.test.extra_protobuf_generator.ExtraProtobufGenerator$.run(ExtraProtobufGenerator.scala:53) at protocbridge.frontend.PluginFrontend$.$anonfun$runWithBytes$1(PluginFrontend.scala:51) at scala.util.Try$.apply(Try.scala:217) at protocbridge.frontend.PluginFrontend$.runWithBytes(PluginFrontend.scala:51) at protocbridge.frontend.PluginFrontend$.runWithInputStream(PluginFrontend.scala:121) at protocbridge.frontend.PosixPluginFrontend$.$anonfun$prepare$2(PosixPluginFrontend.scala:40) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1$$anon$2.block(ExecutionContextImpl.scala:60) at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3118) at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1.blockOn(ExecutionContextImpl.scala:71) at scala.concurrent.package$.blocking(package.scala:124) at protocbridge.frontend.PosixPluginFrontend$.$anonfun$prepare$1(PosixPluginFrontend.scala:38) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) Caused by: com.google.protobuf.RuntimeVersion$ProtobufRuntimeVersionException: Detected mismatched Protobuf Gencode/Runtime version suffixes when loading scalapb.options.Scalapb: gencode 4.28.2, runtime 4.29.0-rc3. Version suffixes must be the same. at com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersionImpl(RuntimeVersion.java:126) at com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(RuntimeVersion.java:71) at scalapb.options.Scalapb.<clinit>(Scalapb.java:11) ... 22 more java.lang.RuntimeException: Exit with code 1 at scala.sys.package$.error(package.scala:27) at scripts.ScalaPBWorker$.work(ScalaPBWorker.scala:44) at io.bazel.rulesscala.worker.Worker.persistentWorkerMain(Worker.java:96) at io.bazel.rulesscala.worker.Worker.workerMain(Worker.java:49) at scripts.ScalaPBWorker$.main(ScalaPBWorker.scala:39) at scripts.ScalaPBWorker.main(ScalaPBWorker.scala) ERROR: .../external/protobuf+/src/google/protobuf/BUILD.bazel:130:14 scala @@protobuf+//src/google/protobuf:wrappers_proto failed: (Exit 1): scalapb_worker failed: error executing ProtoScalaPBRule command (from target @@protobuf+//src/google/protobuf:wrappers_proto) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) ``` Later builds then fail with `java.lang.NoClassDefFoundError: Could not initialize class scalapb.options.Scalapb`: ```txt $ bazel build //src/... //test/... //third_party/... //scala_proto/... ERROR: .../third_party/test/proto/BUILD.bazel:4:14: ProtoScalaPBRule third_party/test/proto/proto_jvm_extra_protobuf_generator_scalapb.srcjar failed: (Exit 1): scalapb_worker failed: error executing ProtoScalaPBRule command (from target //third_party/test/proto:proto) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) --jvm_extra_protobuf_generator_out: java.lang.NoClassDefFoundError: Could not initialize class scalapb.options.Scalapb at scalapb.options.compiler.Scalapb$.registerAllExtensions(Scalapb.scala:8) at scalarules.test.extra_protobuf_generator.ExtraProtobufGenerator$.run(ExtraProtobufGenerator.scala:53) at protocbridge.frontend.PluginFrontend$.$anonfun$runWithBytes$1(PluginFrontend.scala:51) at scala.util.Try$.apply(Try.scala:217) at protocbridge.frontend.PluginFrontend$.runWithBytes(PluginFrontend.scala:51) at protocbridge.frontend.PluginFrontend$.runWithInputStream(PluginFrontend.scala:121) at protocbridge.frontend.PosixPluginFrontend$.$anonfun$prepare$2(PosixPluginFrontend.scala:40) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1$$anon$2.block(ExecutionContextImpl.scala:60) at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3118) at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1.blockOn(ExecutionContextImpl.scala:71) at scala.concurrent.package$.blocking(package.scala:124) at protocbridge.frontend.PosixPluginFrontend$.$anonfun$prepare$1(PosixPluginFrontend.scala:38) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) java.lang.RuntimeException: Exit with code 1 at scala.sys.package$.error(package.scala:27) at scripts.ScalaPBWorker$.work(ScalaPBWorker.scala:44) at io.bazel.rulesscala.worker.Worker.persistentWorkerMain(Worker.java:96) at io.bazel.rulesscala.worker.Worker.workerMain(Worker.java:49) at scripts.ScalaPBWorker$.main(ScalaPBWorker.scala:39) at scripts.ScalaPBWorker.main(ScalaPBWorker.scala) ERROR: .../third_party/test/proto/BUILD.bazel:4:14 Building source jar third_party/test/proto/proto_scalapb-src.jar failed: (Exit 1): scalapb_worker failed: error executing ProtoScalaPBRule command (from target //third_party/test/proto:proto) bazel-out/darwin_arm64-opt-exec-ST-d57f47055a04/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) ```
I've created the Note that this branch/commit is based on my |
I believe the original issue in the description (#1652 (comment)) is because the Historically, this has only worked by accident, as the Starlark environment for The right fix would to partition the rules_scala bzl load graph into non-overlapping (cc @comius, @meteorcloudy) |
I think it's better to do the right thing here instead of implementing more hacks that would be remove anyway in future. |
As it turns out, this can't actually work (at least not easily), as
This seems doable and I might end up doing this for Bazel@HEAD, if only to turn our downstream CI green. However, (if it does happen) cherry-picking the fix to Bazel 8 will only occur if we end up needing a new RC for other reasons. |
Context: bazelbuild/rules_scala#1652 (comment) This will fix the issue in Bazel@HEAD, and the primary motivation is to turn downstream CI green. On the off-chance we are making a new Bazel 8 RC, we can include this. Otherwise, maybe this can go in 8.1.0 PiperOrigin-RevId: 701260369 Change-Id: If62eb015b5220b574ce34a26a194d2722021082f
Moves functions out of `//scala:scala.bzl` and updates `WORKSPACE` to load `//scala:toolchains.bzl` to avoid importing macros that depend on `JavaInfo` and `java_common` during `WORKSPACE` evaluation. Based on advice from @hvadehra in bazelbuild#1652. I haven't tried this under Bzlmod yet, and it still fails with the following error. This is due to bumping to Protobuf v29.0 and protobuf-java:4.29.0, and I believe I can update `ExtraProtobufGenerator.scala` to fix this. But the point is that I do _not_ have to `load()` files from `@rules_java` after all. ```txt ERROR: .../external/com_google_protobuf/src/google/protobuf/BUILD.bazel:23:14: ProtoScalaPBRule external/com_google_protobuf/src/google/protobuf/any_proto_jvm_extra_protobuf_generator_scalapb.srcjar failed: (Exit 1): scalapb_worker failed: error executing ProtoScalaPBRule command (from target @@com_google_protobuf//src/google/protobuf:any_proto) bazel-out/.../bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) --jvm_extra_protobuf_generator_out: java.lang.NoSuchMethodError: 'java.lang.Object com.google.protobuf.DescriptorProtos$FieldOptions.getExtension(com.google.protobuf.GeneratedMessage$GeneratedExtension)' at scalapb.compiler.DescriptorImplicits$ExtendedFieldDescriptor.fieldOptions(DescriptorImplicits.scala:329) at scalapb.compiler.DescriptorImplicits$ExtendedFieldDescriptor.scalaName(DescriptorImplicits.scala:207) at scalapb.compiler.ProtoValidation.validateField(ProtoValidation.scala:121) at scalapb.compiler.ProtoValidation.$anonfun$validateMessage$3(ProtoValidation.scala:56) at scalapb.compiler.ProtoValidation.$anonfun$validateMessage$3$adapted(ProtoValidation.scala:56) at scala.collection.Iterator.foreach(Iterator.scala:943) at scala.collection.Iterator.foreach$(Iterator.scala:943) at scala.collection.AbstractIterator.foreach(Iterator.scala:1431) at scala.collection.IterableLike.foreach(IterableLike.scala:74) at scala.collection.IterableLike.foreach$(IterableLike.scala:73) at scala.collection.AbstractIterable.foreach(Iterable.scala:56) at scalapb.compiler.ProtoValidation.validateMessage(ProtoValidation.scala:56) at scalapb.compiler.ProtoValidation.$anonfun$validateFile$2(ProtoValidation.scala:17) at scalapb.compiler.ProtoValidation.$anonfun$validateFile$2$adapted(ProtoValidation.scala:17) at scala.collection.Iterator.foreach(Iterator.scala:943) at scala.collection.Iterator.foreach$(Iterator.scala:943) at scala.collection.AbstractIterator.foreach(Iterator.scala:1431) at scala.collection.IterableLike.foreach(IterableLike.scala:74) at scala.collection.IterableLike.foreach$(IterableLike.scala:73) at scala.collection.AbstractIterable.foreach(Iterable.scala:56) at scalapb.compiler.ProtoValidation.validateFile(ProtoValidation.scala:17) at scalapb.compiler.ProtoValidation.$anonfun$validateFiles$1(ProtoValidation.scala:10) at scalapb.compiler.ProtoValidation.$anonfun$validateFiles$1$adapted(ProtoValidation.scala:10) at scala.collection.immutable.Stream.foreach(Stream.scala:533) at scalapb.compiler.ProtoValidation.validateFiles(ProtoValidation.scala:10) at scalarules.test.extra_protobuf_generator.ExtraProtobufGenerator$.handleCodeGeneratorRequest(ExtraProtobufGenerator.scala:86) at scalarules.test.extra_protobuf_generator.ExtraProtobufGenerator$.run(ExtraProtobufGenerator.scala:55) at protocbridge.frontend.PluginFrontend$.$anonfun$runWithBytes$1(PluginFrontend.scala:51) at scala.util.Try$.apply(Try.scala:213) at protocbridge.frontend.PluginFrontend$.runWithBytes(PluginFrontend.scala:51) at protocbridge.frontend.PluginFrontend$.runWithInputStream(PluginFrontend.scala:121) at protocbridge.frontend.PosixPluginFrontend$.$anonfun$prepare$2(PosixPluginFrontend.scala:40) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1$$anon$2.block(ExecutionContextImpl.scala:75) at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3118) at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1.blockOn(ExecutionContextImpl.scala:87) at scala.concurrent.package$.blocking(package.scala:146) at protocbridge.frontend.PosixPluginFrontend$.$anonfun$prepare$1(PosixPluginFrontend.scala:38) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659) at scala.util.Success.$anonfun$map$1(Try.scala:255) at scala.util.Success.map(Try.scala:213) at scala.concurrent.Future.$anonfun$map$1(Future.scala:292) at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:42) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:74) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) java.lang.RuntimeException: Exit with code 1 at scala.sys.package$.error(package.scala:30) at scripts.ScalaPBWorker$.work(ScalaPBWorker.scala:44) at io.bazel.rulesscala.worker.Worker.persistentWorkerMain(Worker.java:96) at io.bazel.rulesscala.worker.Worker.workerMain(Worker.java:49) at scripts.ScalaPBWorker$.main(ScalaPBWorker.scala:39) at scripts.ScalaPBWorker.main(ScalaPBWorker.scala) ERROR: .../external/com_google_protobuf/src/google/protobuf/BUILD.bazel:23:14 Building source jar external/com_google_protobuf/src/google/protobuf/any_proto_scalapb-src.jar failed: (Exit 1): scalapb_worker failed: error executing ProtoScalaPBRule command (from target @@com_google_protobuf//src/google/protobuf:any_proto) bazel-out/darwin_arm64-opt-exec-ST-a828a81199fe/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) ```
@hvadehra Thanks for the hint about partitioning the As noted in the commit message, I haven't tried it under Bzlmod yet. Update: Ah, I forgot to bump the ScalaPB version to 1.0.0-alpha.1. Once I did that, success! I can actually begin to land the Going to play with this some more in the coming days to see what I find out. @simuons and @liucijus Here's a heads-up that I may start sending pull requests related to these findings. |
Every Scala version now uses com.google.protobuf:protobuf-java:4.29.0. Part of bazelbuild#1482 and bazelbuild#1652. This is necessary, but not sufficient, to make `rules_scala` Bazel 8 compatible by enabling an update to `protobuf` v29.0. Building with Bazel 6.5.0 and `protobuf` v21.7 continues to pass all tests after this change.
Ensures we get all the versions of dependencies we want in `WORKSPACE`, while providing a new API to consumers. Part of bazelbuild#1652.
When testing Bazel 8.0.0 RC versions I discovered rules_scala may be incompatible with the latest rules_java (that you in turn my need for Bazel 8.0.0).
This came out when testing a Bazel bug's solution: bazelbuild/bazel#24235.
After upgrading rules_java to 8.5.0+ rules_scala reported errors:
Please note, that rules_cc version is also too "old" for Bazel 8.0.0, so I upgraded it on my branch too explicitly. It may need to be updated in rules_scala.
The text was updated successfully, but these errors were encountered: