aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2018-03-09 11:08:45 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-09 11:10:20 -0800
commita8b5ec677dd49cfff25d0439edbcc742e3e32017 (patch)
tree80355d7668d99565e91e8fa44dc61a8e3d42ab23 /src/main
parenta12fd23445f7583b8ff16328e22b00df139b1208 (diff)
Improve the warning for malformed recursive configs.
Unlike in fixed-point (legacy) expansion of configs, with --expand_configs_in_place we do not use the options parser to parse each config-definition default override - we first find the full expansion and then expand it in place of the original --config=value instance. For this reason though, we don't support space-separation of recursive configs and their values. The old warning for this was confusing though, and did not provide much guidance. This should be better, now the warning specifies which config is malformed, in what file, and that it expects the "=" character. RELNOTES: None. PiperOrigin-RevId: 188509060
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java8
1 files changed, 7 insertions, 1 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 c7c72ec77a..812854a84e 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
@@ -541,7 +541,13 @@ public abstract class BlazeOptionHandler {
// we will only accept --config=value, and will not accept value on a following line.
int charOfConfigValue = arg.indexOf('=');
if (charOfConfigValue < 0) {
- throw new OptionsParsingException("Config flag was provided without a value.");
+ throw new OptionsParsingException(
+ String.format(
+ "In file %s, the definition of config %s expands to another config "
+ + "that either has no value or is not in the form --config=value. For "
+ + "recursive config definitions, please do not provide the value in a "
+ + "separate token, such as in the form '--config value'.",
+ rcArgs.rcFile, configToExpand));
}
String newConfigValue = arg.substring(charOfConfigValue + 1);
LinkedHashSet<String> extendedConfigAncestorSet =