You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wraps `scalapb.ScalaPbCodeGenerator` to catch and return all errors.
Without this, any errors escaping from `scalapb.ScalaPbCodeGenerator`
will cause the `scala_proto` aspect workers to hang.
Also deletes some `@io_bazel_rules_scala` references, replacing them
with `Label` instances as appropriate.
The `test_scala_version 2.11.12` case from `test_version.sh` would
previously hang given the combination of ScalaPB 0.9.8 (the newest
available for Scala 2.11) and Protobuf v28.3. Running the following in a
`test_version/test_scala_version_*` repo generated by `test_version.sh`
reproduced the hang:
```txt
$ bazel build --repo_env=SCALA_VERSION=2.11.12 //proto:test_proto
[ ...wait 10 seconds, then CTRL-C... ]
INFO: Analyzed target //proto:test_proto (2 packages loaded, 22 targets configured).
INFO: Found 1 target...
[1,038 / 1,047] 4 actions running
ProtoScalaPBRule proto/test_service_scala_scalapb.srcjar; 10s worker
ProtoScalaPBRule proto/test2_scala_scalapb.srcjar; 10s worker
Target //proto:test_proto failed to build
```
With this change, the command now exposes the exact incompatibility
between these versions:
```txt
$ bazel build --repo_env=SCALA_VERSION=2.11.12 //proto:test_proto
ERROR: .../test_version/test_scala_version_1731169107/proto/BUILD:14:14:
ProtoScalaPBRule proto/test3_scala_scalapb.srcjar failed: (Exit 1):
scalapb_worker failed: error executing command
(from target //proto:test3)
bazel-out/.../bin/external/io_bazel_rules_scala/src/scala/scripts/scalapb_worker
... (remaining 2 arguments skipped)
--scala_out: java.lang.NoSuchMethodError:
'void com.google.protobuf.Descriptors$FileDescriptor.internalBuildGeneratedFileFrom(java.lang.String[],
com.google.protobuf.Descriptors$FileDescriptor[],
com.google.protobuf.Descriptors$FileDescriptor$InternalDescriptorAssigner)'
at scalapb.options.compiler.Scalapb.<clinit>(Scalapb.java:10592)
at scalapb.ScalaPbCodeGenerator$.run(ScalaPbCodeGenerator.scala:14)
at scalapb.ScalaPbCodeGenerator$.run(ScalaPbCodeGenerator.scala:10)
at scripts.ScalaPbCodeGenerator$.run(ScalaPbCodeGeneratorWrapper_2_11.scala:8)
at protocbridge.frontend.PluginFrontend$$anonfun$runWithBytes$2.apply(PluginFrontend.scala:52)
at protocbridge.frontend.PluginFrontend$$anonfun$runWithBytes$2.apply(PluginFrontend.scala:52)
at scala.util.Try$.apply(Try.scala:192)
at protocbridge.frontend.PluginFrontend$.runWithBytes(PluginFrontend.scala:51)
at protocbridge.frontend.PluginFrontend$.runWithInputStream(PluginFrontend.scala:103)
at protocbridge.frontend.PosixPluginFrontend$$anonfun$prepare$1.apply$mcV$sp(PosixPluginFrontend.scala:33)
at protocbridge.frontend.PosixPluginFrontend$$anonfun$prepare$1.apply(PosixPluginFrontend.scala:31)
at protocbridge.frontend.PosixPluginFrontend$$anonfun$prepare$1.apply(PosixPluginFrontend.scala:31)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
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)
Target //proto:test_proto failed to build
```
0 commit comments