Add a flag --allow_undefined_configs, with default value true.
Setting this flag to false makes Bazel exit with an error on undefined configs. The default value is true, so this change has no impact unless users explicitly pass --noallow_undefined_configs.
This change supersedes an unmerged one, I'm taking the problem from fkp@.
Credit to him for the original change.
PiperOrigin-RevId: 157593338
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 76d9715..97bec45 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
@@ -206,6 +206,14 @@
public boolean alwaysProfileSlowOperations;
@Option(
+ name = "allow_undefined_configs",
+ defaultValue = "true",
+ category = "flags",
+ help = "Do not throw an error when the config is not defined."
+ )
+ public boolean allowUndefinedConfigs;
+
+ @Option(
name = "profile",
defaultValue = "null",
category = "misc",