Skip to content

Commit

Permalink
Revert back to the old behavior of not creating a proto source root …
Browse files Browse the repository at this point in the history
…for generated .proto files.

    It was meant to be a compatible change, but alas, people seemed to depend on
    the exact layout of the output tree. Will flip in 1.0 . Tracking bug:

    bazelbuild/bazel#9215

    RELNOTES: None.
    PiperOrigin-RevId: 264581654
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent e281e22 commit d9ba7b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ProtoConfiguration extends Fragment implements ProtoConfigurationAp
public static class Options extends FragmentOptions {
@Option(
name = "incompatible_generated_protos_in_virtual_imports",
defaultValue = "true",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,13 @@ public void testExternalRepoWithGeneratedProto() throws Exception {
TestConstants.LOAD_PROTO_LIBRARY,
"proto_library(name='a', srcs=['a.proto'], deps=['@foo//x:x'])");

String genfiles = getTargetConfiguration().getGenfilesFragment().toString();
ConfiguredTarget a = getConfiguredTarget("//a:a");
ProtoInfo aInfo = a.get(ProtoInfo.PROVIDER);
assertThat(aInfo.getTransitiveProtoSourceRoots())
.containsExactly(".", genfiles + "/external/foo/x/_virtual_imports/x");
assertThat(aInfo.getTransitiveProtoSourceRoots()).containsExactly(".", "external/foo");

ConfiguredTarget x = getConfiguredTarget("@foo//x:x");
ProtoInfo xInfo = x.get(ProtoInfo.PROVIDER);
assertThat(xInfo.getTransitiveProtoSourceRoots())
.containsExactly(genfiles + "/external/foo/x/_virtual_imports/x");
assertThat(xInfo.getTransitiveProtoSourceRoots()).containsExactly("external/foo");
}

@Test
Expand Down

0 comments on commit d9ba7b5

Please sign in to comment.