Skip to content

Commit 317f993

Browse files
committed
Bump protoc-bridge to 0.9.8
This version contains this update to `protocbridge.frontend.PluginFrontend.runWithInputStream()`: - https://github.com/scalapb/protoc-bridge/blob/c574d50eaee5b800fd54493fe25c4e0eed3b9def/bridge/src/main/scala/protocbridge/frontend/PluginFrontend.scala#L107-L122 This change originally came from: - https://github.com/scalapb/protoc-bridge/blob/d0d56f635d13f7efaa2755ed0d2d66bdef18b588/bridge/src/main/scala/protocbridge/frontend/PluginFrontend.scala#L107-L122 - scalapb/protoc-bridge#367 This should close scalapb/ScalaPB#1771 and obviate the need for the `try`/`catch` blocks added in bazel-contrib#1630 and bazel-contrib#1637, and the `ScalaPBCodeGenerator` implementation added in bazel-contrib#1648. The update requires special handling in `scripts/create_repository.py` to ensure that only Scala 3.3 and up receive the `protoc-bridge_3` version. Scala 3.1 and 3.2 still receive the `protoc-bridge_2.13` version. However, the `protoc-bridge_3` version currently fails with the following (setting `RULES_SCALA_TEST_ONLY="test_scala_version 3.3.4"` fails the same way): ```txt $ RULES_SCALA_TEST_ONLY="test_scala_version 3.6.2" \ ./test_thirdparty_version.sh 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 command (from target //third_party/test/proto:proto) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) --scala_out: java.lang.NoClassDefFoundError: Could not initialize class scalapb.ScalaPbCodeGenerator$ at scripts.ScalaPbCodeGenerator$.process(ScalaPbCodeGeneratorWrapper.scala:8) at protocgen.CodeGenApp.run(CodeGenApp.scala:48) at protocgen.CodeGenApp.run$(CodeGenApp.scala:41) at scripts.ScalaPbCodeGenerator$.run(ScalaPbCodeGeneratorWrapper.scala:5) at protocgen.CodeGenApp.run(CodeGenApp.scala:33) at protocgen.CodeGenApp.run$(CodeGenApp.scala:32) at scripts.ScalaPbCodeGenerator$.run(ScalaPbCodeGeneratorWrapper.scala:5) at protocbridge.frontend.PluginFrontend$.runWithBytes(PluginFrontend.scala:48) at protocbridge.frontend.PluginFrontend$.runWithInputStream(PluginFrontend.scala:113) at protocbridge.frontend.SocketBasedPluginFrontend.prepare$$anonfun$1$$anonfun$1(SocketBasedPluginFrontend.scala:31) at protocbridge.frontend.SocketBasedPluginFrontend.prepare$$anonfun$1$$anonfun$adapted$1(SocketBasedPluginFrontend.scala:37) 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.SocketBasedPluginFrontend.prepare$$anonfun$1(SocketBasedPluginFrontend.scala:37) at protocbridge.frontend.SocketBasedPluginFrontend.prepare$$anonfun$adapted$1(SocketBasedPluginFrontend.scala:38) 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 command (from target //third_party/test/proto:proto) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) ```
1 parent 719f353 commit 317f993

File tree

9 files changed

+25
-22
lines changed

9 files changed

+25
-22
lines changed

scripts/create_repository.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
PROTOBUF_JAVA_VERSION = "4.29.0"
3535
JLINE_VERSION = '3.27.1'
3636
SCALAPB_VERSION = '0.11.17'
37-
PROTOC_BRIDGE_VERSION = '0.9.7'
37+
PROTOC_BRIDGE_VERSION = '0.9.8'
3838
GRPC_VERSION = '1.68.1'
3939
GRPC_COMMON_PROTOS_VERSION = '2.48.0'
4040
GRPC_LIBS = ['netty', 'protobuf', 'stub']
@@ -73,15 +73,18 @@ def select_root_artifacts(scala_version, scala_major, is_scala_3) -> List[str]:
7373
v for v in ROOT_SCALA_VERSIONS if v.startswith('2.')
7474
)
7575
max_scala_2_major = '.'.join(max_scala_2_version.split('.')[:2])
76+
minor_version = int(scala_version.split('.')[1])
7677

7778
scala_2_version = scala_version
7879
scala_2_major = scala_major
7980
scalatest_major = scala_major
81+
protoc_bridge_major = scala_2_major
8082

8183
if is_scala_3:
8284
scala_2_version = max_scala_2_version
8385
scala_2_major = max_scala_2_major
8486
scalatest_major = '3'
87+
protoc_bridge_major = max_scala_2_major if minor_version < 3 else '3'
8588

8689
scalafmt_version = SCALAFMT_VERSION
8790
scalapb_version = SCALAPB_VERSION
@@ -99,7 +102,7 @@ def select_root_artifacts(scala_version, scala_major, is_scala_3) -> List[str]:
99102
f'com.google.protobuf:protobuf-java:{PROTOBUF_JAVA_VERSION}',
100103
f'com.thesamet.scalapb:compilerplugin_{scala_2_major}:' +
101104
scalapb_version,
102-
f'com.thesamet.scalapb:protoc-bridge_{scala_2_major}:' +
105+
f'com.thesamet.scalapb:protoc-bridge_{protoc_bridge_major}:' +
103106
protoc_bridge_version,
104107
f'com.thesamet.scalapb:scalapb-runtime_{scala_2_major}:' +
105108
scalapb_version,

third_party/repositories/scala_2_12.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,8 @@ artifacts = {
815815
],
816816
},
817817
"scala_proto_rules_scalapb_protoc_bridge": {
818-
"artifact": "com.thesamet.scalapb:protoc-bridge_2.12:0.9.7",
819-
"sha256": "6d039a28d29253ac78aec0e3102f6423d269e65203c114a17f0d52a91d4876f4",
818+
"artifact": "com.thesamet.scalapb:protoc-bridge_2.12:0.9.8",
819+
"sha256": "4af997be5176753aa480ce40cbe9aab89ba659740a1ca6dae660afffb7bb343a",
820820
"deps": [
821821
"@dev_dirs_directories",
822822
"@io_bazel_rules_scala_scala_library",

third_party/repositories/scala_2_13.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,8 @@ artifacts = {
837837
],
838838
},
839839
"scala_proto_rules_scalapb_protoc_bridge": {
840-
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
841-
"sha256": "403f0e7223c8fd052cff0fbf977f3696c387a696a3a12d7b031d95660c7552f5",
840+
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.8",
841+
"sha256": "0b3827da2cd9bca867d6963c2a821e7eaff41f5ac3babf671c4c00408bd14a9b",
842842
"deps": [
843843
"@dev_dirs_directories",
844844
"@io_bazel_rules_scala_scala_library",

third_party/repositories/scala_3_1.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,8 @@ artifacts = {
879879
],
880880
},
881881
"scala_proto_rules_scalapb_protoc_bridge": {
882-
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
883-
"sha256": "403f0e7223c8fd052cff0fbf977f3696c387a696a3a12d7b031d95660c7552f5",
882+
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.8",
883+
"sha256": "0b3827da2cd9bca867d6963c2a821e7eaff41f5ac3babf671c4c00408bd14a9b",
884884
"deps": [
885885
"@dev_dirs_directories",
886886
"@io_bazel_rules_scala_scala_library_2",

third_party/repositories/scala_3_2.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,8 @@ artifacts = {
879879
],
880880
},
881881
"scala_proto_rules_scalapb_protoc_bridge": {
882-
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
883-
"sha256": "403f0e7223c8fd052cff0fbf977f3696c387a696a3a12d7b031d95660c7552f5",
882+
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.8",
883+
"sha256": "0b3827da2cd9bca867d6963c2a821e7eaff41f5ac3babf671c4c00408bd14a9b",
884884
"deps": [
885885
"@dev_dirs_directories",
886886
"@io_bazel_rules_scala_scala_library_2",

third_party/repositories/scala_3_3.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,11 +880,11 @@ artifacts = {
880880
],
881881
},
882882
"scala_proto_rules_scalapb_protoc_bridge": {
883-
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
884-
"sha256": "403f0e7223c8fd052cff0fbf977f3696c387a696a3a12d7b031d95660c7552f5",
883+
"artifact": "com.thesamet.scalapb:protoc-bridge_3:0.9.8",
884+
"sha256": "6e1e38e34f3aaa14c6d46defb66b819f03edbdc4d69965011955da2a4781df9c",
885885
"deps": [
886886
"@dev_dirs_directories",
887-
"@io_bazel_rules_scala_scala_library_2",
887+
"@io_bazel_rules_scala_scala_library",
888888
],
889889
},
890890
"scala_proto_rules_scalapb_protoc_gen": {

third_party/repositories/scala_3_4.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,11 +880,11 @@ artifacts = {
880880
],
881881
},
882882
"scala_proto_rules_scalapb_protoc_bridge": {
883-
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
884-
"sha256": "403f0e7223c8fd052cff0fbf977f3696c387a696a3a12d7b031d95660c7552f5",
883+
"artifact": "com.thesamet.scalapb:protoc-bridge_3:0.9.8",
884+
"sha256": "6e1e38e34f3aaa14c6d46defb66b819f03edbdc4d69965011955da2a4781df9c",
885885
"deps": [
886886
"@dev_dirs_directories",
887-
"@io_bazel_rules_scala_scala_library_2",
887+
"@io_bazel_rules_scala_scala_library",
888888
],
889889
},
890890
"scala_proto_rules_scalapb_protoc_gen": {

third_party/repositories/scala_3_5.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,11 +880,11 @@ artifacts = {
880880
],
881881
},
882882
"scala_proto_rules_scalapb_protoc_bridge": {
883-
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
884-
"sha256": "403f0e7223c8fd052cff0fbf977f3696c387a696a3a12d7b031d95660c7552f5",
883+
"artifact": "com.thesamet.scalapb:protoc-bridge_3:0.9.8",
884+
"sha256": "6e1e38e34f3aaa14c6d46defb66b819f03edbdc4d69965011955da2a4781df9c",
885885
"deps": [
886886
"@dev_dirs_directories",
887-
"@io_bazel_rules_scala_scala_library_2",
887+
"@io_bazel_rules_scala_scala_library",
888888
],
889889
},
890890
"scala_proto_rules_scalapb_protoc_gen": {

third_party/repositories/scala_3_6.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,11 @@ artifacts = {
889889
],
890890
},
891891
"scala_proto_rules_scalapb_protoc_bridge": {
892-
"artifact": "com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
893-
"sha256": "403f0e7223c8fd052cff0fbf977f3696c387a696a3a12d7b031d95660c7552f5",
892+
"artifact": "com.thesamet.scalapb:protoc-bridge_3:0.9.8",
893+
"sha256": "6e1e38e34f3aaa14c6d46defb66b819f03edbdc4d69965011955da2a4781df9c",
894894
"deps": [
895895
"@dev_dirs_directories",
896-
"@io_bazel_rules_scala_scala_library_2",
896+
"@io_bazel_rules_scala_scala_library",
897897
],
898898
},
899899
"scala_proto_rules_scalapb_protoc_gen": {

0 commit comments

Comments
 (0)