diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java index fccbf1db71cb89..7379ba2d6ae86f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java @@ -41,11 +41,17 @@ public class ProtoConfiguration extends Fragment implements ProtoConfigurationAp /** Command line options. */ public static class Options extends FragmentOptions { @Option( - name = "experimental_generated_protos_in_virtual_imports", - defaultValue = "true", + name = "incompatible_generated_protos_in_virtual_imports", + defaultValue = "false", documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS}, - help = "If set, generated .proto files are put into a virtual import directory.") + metadataTags = { + OptionMetadataTag.INCOMPATIBLE_CHANGE, + OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES + }, + help = + "If set, generated .proto files are put into a virtual import directory. For more " + + "information, see https://github.com/bazelbuild/bazel/issues/9215") public boolean generatedProtosInVirtualImports; @Option( diff --git a/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java index e23956721200af..7b26d789b732d8 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryTest.java @@ -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