diff options
author | ccalvarin <ccalvarin@google.com> | 2018-06-28 11:54:37 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-28 11:56:49 -0700 |
commit | 358c5157508bf3a867da68c9523352edd5607e60 (patch) | |
tree | 88f453a5d8fbee0d955fab5a7414267a0ecdfbeb | |
parent | a8926b7010f7bbbe6e1d9b558bac88b73be28250 (diff) |
Remove --allow_undefined_configs
RELNOTES: --[no]allow_undefined_configs no longer exists, passing undefined configs is an error.
PiperOrigin-RevId: 202518987
3 files changed, 2 insertions, 46 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java index ad6f391ccb..4b344abc1c 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java @@ -437,13 +437,8 @@ public final class BlazeOptionHandler { } if (!foundDefinition) { - String warning = "Config value " + configToExpand + " is not defined in any .rc file"; - CommonCommandOptions commonOptions = optionsParser.getOptions(CommonCommandOptions.class); - if (commonOptions.allowUndefinedConfigs) { - eventHandler.handle(Event.warn(warning)); - } else { - throw new OptionsParsingException(warning); - } + throw new OptionsParsingException( + "Config value " + configToExpand + " is not defined in any .rc file"); } return expansion; } diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java index 923ebe6693..2a88c32e98 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java @@ -105,15 +105,6 @@ public class CommonCommandOptions extends OptionsBase { ) public boolean alwaysProfileSlowOperations; - @Option( - name = "allow_undefined_configs", - defaultValue = "false", - documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, - effectTags = {OptionEffectTag.EAGERNESS_TO_EXIT}, - help = "Do not throw an error when the config is not defined." - ) - public boolean allowUndefinedConfigs; - /** Converter for UUID. Accepts values as specified by {@link UUID#fromString(String)}. */ public static class UUIDConverter implements Converter<UUID> { diff --git a/src/test/java/com/google/devtools/build/lib/runtime/BlazeOptionHandlerTest.java b/src/test/java/com/google/devtools/build/lib/runtime/BlazeOptionHandlerTest.java index e639979c0a..da7430f298 100644 --- a/src/test/java/com/google/devtools/build/lib/runtime/BlazeOptionHandlerTest.java +++ b/src/test/java/com/google/devtools/build/lib/runtime/BlazeOptionHandlerTest.java @@ -349,36 +349,6 @@ public class BlazeOptionHandlerTest { } } - private void testExpandConfigOptions_withConfigForUnapplicableCommand_allowUndefined() - throws Exception { - parser.parse("--config=other", "--allow_undefined_configs"); - optionHandler.expandConfigOptions(eventHandler, structuredArgsFrom2SimpleRcsWithOnlyResidue()); - } - - @Test - public void testExpandConfigOptions_withConfigForUnapplicableCommand_allowUndefined_inPlace() - throws Exception { - - testExpandConfigOptions_withConfigForUnapplicableCommand_allowUndefined(); - assertThat(eventHandler.getEvents()) - .contains(Event.warn("Config value other is not defined in any .rc file")); - } - - private void testAllowUndefinedConfig() throws Exception { - parser.parse("--config=invalid", "--allow_undefined_configs"); - optionHandler.expandConfigOptions(eventHandler, ArrayListMultimap.create()); - assertThat(parser.getResidue()).isEmpty(); - assertThat(optionHandler.getRcfileNotes()).isEmpty(); - } - - @Test - public void testAllowUndefinedConfig_inPlace() throws Exception { - - testAllowUndefinedConfig(); - assertThat(eventHandler.getEvents()) - .contains(Event.warn("Config value invalid is not defined in any .rc file")); - } - private void testUndefinedConfig() throws OptionsParsingException { parser.parse("--config=invalid"); optionHandler.expandConfigOptions(eventHandler, ArrayListMultimap.create()); |