diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java | 10 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java | 7 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java index a5b81be80b..90684c5946 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java @@ -290,6 +290,16 @@ public class BlazeServerStartupOptions extends OptionsBase { public boolean batchCpuScheduling; @Option( + name = "ignore_all_rc_files", + defaultValue = "false", // NOTE: purely decorative, rc files are read by the client. + documentationCategory = OptionDocumentationCategory.BAZEL_CLIENT_OPTIONS, + effectTags = {OptionEffectTag.CHANGES_INPUTS}, + help = + "Disables all rc files, regardless of the values of other rc-modifying flags, even if " + + "these flags come later in the list of startup options.") + public boolean ignoreAllRcFiles; + + @Option( name = "blazerc", defaultValue = "null", // NOTE: purely decorative, rc files are read by the client. documentationCategory = OptionDocumentationCategory.BAZEL_CLIENT_OPTIONS, diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java index afa68079ed..1bf99be2c4 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java @@ -319,7 +319,7 @@ public abstract class CommandLineEvent implements BuildEventWithOrderConstraint // Create the fake ones to prevent reapplication of the original rc file contents. OptionsParser fakeOptions = OptionsParser.newOptionsParser(BlazeServerStartupOptions.class); try { - fakeOptions.parse("--nomaster_blazerc", "--blazerc=/dev/null"); + fakeOptions.parse("--ignore_all_rc_files"); } catch (OptionsParsingException e) { // Unless someone changes the definition of these flags, this is impossible. throw new IllegalStateException(e); @@ -336,8 +336,11 @@ public abstract class CommandLineEvent implements BuildEventWithOrderConstraint .filter( option -> { String optionName = option.getOptionName(); - return !optionName.equals("blazerc") + return !optionName.equals("ignore_all_rc_files") + && !optionName.equals("blazerc") && !optionName.equals("master_blazerc") + && !optionName.equals("bazelrc") + && !optionName.equals("master_bazelrc") && !optionName.equals("invocation_policy"); }) .collect(Collectors.toList())) |