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
This PR should have tests, but I'm not sure of the best way to add them since ideally we want to run tests/integration/java_export in both toolchain and non-toolchain mode (with and without --incompatible_enable_proto_toolchain_resolution) and this doesn't seem easy with the current test suite design. Would like validation about this approach before committing to adding support for this to the test suite.
This is what the excluded_workspaces attribute of java_export is for. Can't we just add the workspace to the default list?
When using the Java proto lang toolchain, the protobuf runtime jar can come from any workspace. For example, in our repo we have it set to be @maven//:com_google_protobuf_protobuf_java and in the toolchains_protoc example it's @protobuf-java//jar.
I updated the linked ticket with a bit more detail.
The alternative would be to tell users to manually specify excluded_workspaces for every java_export when using a Java proto_lang_toolchain, but that seems not very user-friendly and not in the spirit of toolchains.
thirtyseven
changed the title
Support stripping protobuf-java jars when using protoc via toolchain
Support stripping protobuf-java jars in java_export when using protoc via toolchain
Nov 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1480.
This PR should have tests, but I'm not sure of the best way to add them since ideally we want to run tests/integration/java_export in both toolchain and non-toolchain mode (with and without
--incompatible_enable_proto_toolchain_resolution) and this doesn't seem easy with the current test suite design. Would like validation about this approach before committing to adding support for this to the test suite.