Skip to content

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

@mbland

Description

@mbland

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 bazel-contrib/rules_scala#1648, which contains bazel-contrib/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 bazel-contrib/rules_scala#1482, and as a side quest, I've diagnosed hanging build issues related to ScalaPB in bazel-contrib/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions