Skip to content
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

protoc-bridge builds hang when scalapb.ScalaPbCodeGenerator doesn't catch Throwable #1771

Open
mbland opened this issue Nov 22, 2024 · 1 comment

Comments

@mbland
Copy link

mbland commented Nov 22, 2024

Neither scalapb.ScalaPbCodeGenerator.run() (ScalaPB <= 0.9.8) nor scalapb.ScalaPbCodeGenerator.process() (ScalaPB >= 0.11.17) catch Throwable and convert it to an error response. When an exception occurs, the Future running either of these methods fails to resolve. It never writes a response to the protoc-bridge pipe, causing builds to hang.

I've opened bazelbuild/rules_scala#1648, which contains bazelbuild/rules_scala@de8214b. That commit contains wrappers for both scalapb.ScalaPbCodeGenerator implementations that catch Throwable and allow the build to fail with an error.

If it's desirable, I'm happy to contribute these changes, or a better implementation if suggested, to ScalaPB itself (for any or all of the 0.9.x, 0.11.x, and 1.0.x branches).


Background: I've been Bzlmodifying rules_scala per bazelbuild/rules_scala#1482, and as a side quest, I've diagnosed hanging build issues related to ScalaPB in bazelbuild/rules_scala#1647. That issue contains extensive details, and has a table at the top showing which versions of ScalaPB are compatible with which versions of Scala and the protobuf Bazel module.

@mbland
Copy link
Author

mbland commented Nov 22, 2024

Quick update: I just noticed the latest protoc-bridge implementation of PluginFrontend.runWithInputStream(). It apparently landed as part of scalapb/protoc-bridge#367, without being specifically called out in the pull request description or discussion. It's not in the latest protoc-bridge 0.9.7 release, however.

So feel free to close this if a new protoc-bridge release is imminent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant