Skip to content

Commit b43bf61

Browse files
Wyveraldcomius
andauthored
[9.0.0] Make --incompatible_enable_proto_toolchain_resolution default to true in Bazel (#28182)
This change updates the default value of the --incompatible_enable_proto_toolchain_resolution flag to true for Bazel builds. The flag's default value and name are now defined in FlagConstants, with different values for the open-source and internal versions. PiperOrigin-RevId: 844684939 Change-Id: I264db1921e52e885d1e211f2a627d42ce380bd41 Co-authored-by: ilist <ilist@google.com>
1 parent 1b649d3 commit b43bf61

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ public final class BuildLanguageOptions extends OptionsBase {
643643
// Flip when dependencies to rules_* repos are upgraded and protobuf registers toolchains
644644
@Option(
645645
name = "incompatible_enable_proto_toolchain_resolution",
646-
defaultValue = "false",
646+
defaultValue = FlagConstants.DEFAULT_INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION,
647647
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
648648
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
649649
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
@@ -1109,7 +1109,7 @@ public FlagConsumer setBool(String key, boolean ignored) {
11091109
public static final String INCOMPATIBLE_FAIL_ON_UNKNOWN_ATTRIBUTES =
11101110
"+incompatible_fail_on_unknown_attributes";
11111111
public static final String INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION =
1112-
"-incompatible_enable_proto_toolchain_resolution";
1112+
FlagConstants.DEFAULT_INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION_NAME;
11131113
public static final String INCOMPATIBLE_DISABLE_NON_EXECUTABLE_JAVA_BINARY =
11141114
"-incompatible_disable_non_executable_java_binary";
11151115
public static final String INCOMPATIBLE_DISABLE_TARGET_DEFAULT_PROVIDER_FIELDS =

src/main/java/com/google/devtools/build/lib/packages/semantics/FlagConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@ private FlagConstants() {}
4444
"+incompatible_package_group_has_public_syntax";
4545
public static final String INCOMPATIBLE_FIX_PACKAGE_GROUP_REPOROOT_SYNTAX =
4646
"+incompatible_fix_package_group_reporoot_syntax";
47+
48+
public static final String DEFAULT_INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION = "true";
49+
public static final String DEFAULT_INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION_NAME =
50+
"+incompatible_enable_proto_toolchain_resolution";
4751
}

src/test/java/com/google/devtools/build/lib/rules/java/proto/StarlarkJavaLiteProtoLibraryTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public class StarlarkJavaLiteProtoLibraryTest extends BuildViewTestCase {
5858

5959
@Before
6060
public final void setUpMocks() throws Exception {
61+
setBuildLanguageOptions("--incompatible_enable_proto_toolchain_resolution=false");
6162
useConfiguration(
6263
"--proto_compiler=//proto:compiler",
6364
"--proto_toolchain_for_javalite=//tools/proto/toolchains:javalite");

0 commit comments

Comments
 (0)