aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/BlazeOptionHandler.java
Commit message (Collapse)AuthorAge
* Remove --allow_undefined_configsGravatar ccalvarin2018-06-28
| | | | | RELNOTES: --[no]allow_undefined_configs no longer exists, passing undefined configs is an error. PiperOrigin-RevId: 202518987
* Remove fixed point config expansion.Gravatar ccalvarin2018-06-14
| | | | | | | Deprecates the flag, though it continues to exist as a no-op so that users get a warning before errors. RELNOTES: --noexpand_configs_in_place is deprecated. PiperOrigin-RevId: 200572053
* BlazeOptionHandler: only check in the parent directory, if there is oneGravatar Klaus Aehlig2018-06-08
| | | | | | | | | | | When checking for a file called DO_NOT_BUILD_HERE in the parent direcotry of the workspace path, first verify that there is such a parent directory. This avoids a null pointer exception if the WORKSPACE file is in the top-level directory. Fixes #5349 Change-Id: I81289a27a3f7fb0f4b5a112343de1b454fb5b8c5 PiperOrigin-RevId: 199790735
* Remove alphabetical sorting of options in the canonical list.Gravatar ccalvarin2018-04-09
| | | | | | | This was broken for --config. Doing this properly requires keeping the order in which the options were given, which could be done either by filtering the ordered list according to which values affect the final outcome or by tracking the order correctly. I picked the later: the option order was not explicitly tracked for expansions before but now it is. RELNOTES: canonicalize-flags no longer reorders the flags PiperOrigin-RevId: 192132260
* Improve the warning for malformed recursive configs.Gravatar ccalvarin2018-03-09
| | | | | | | | | 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
* Warn about config expansions as we do for other expansions.Gravatar ccalvarin2017-12-21
| | | | | | | | | If an expanded value overrides an explicit value, users who do not know the contents of the expansion may be surprised. We already warned about this for hard-coded expansions, and this is now applicable for --config expansions as well. This will only warn when a single-valued option has its value replaced. Options that accumulate multiple values in a list (e.g., --copt) will silently include both explicit and expanded values. RELNOTES: None. PiperOrigin-RevId: 179857526
* Add warning for configs that are expanded multiple times.Gravatar ccalvarin2017-11-20
| | | | | | | Some flags are relatively immune to repeated mentions, since only the last mention ends up mattering, but in some cases, the values are accumulated. Expanding the same config twice may lead to surprising results, so provide a friendly warning. RELNOTES: None PiperOrigin-RevId: 176422758
* Add warning for long chain of recursive --configs.Gravatar ccalvarin2017-11-20
| | | | | | | Configs are recursive, but let's be reasonable. If there's an absurdly long list of configs inheritance, warn about it. It is probably unnecessary, and might very well be unintentional and surprising to the user. RELNOTES: None. PiperOrigin-RevId: 176405183
* Change config expansion application order, gated by startup flag ↵Gravatar ccalvarin2017-11-20
| | | | | | | | | | | | | --expand_configs_in_place. --config options were expanded in a fix-point expansion, where in practice, the flags that --config values expanded to ended up between the normal bazelrc options and the command line's explicit options. Since the options parser has an order-based priority scheme and it accepts multiple mentions of a single-valued option, this conflicts with users' expectations of being able to override these config expansions by using the order in which they are mentioned. This change makes it possible to expand the config values defined in your bazelrc (or blazerc) files to occur in-place: --stuff --config=something --laterstuff will interpret the options that --config=something expands to as if they had been mentioned explicitly between --stuff and --laterstuff. In order to not break users relying on complex flag combinations to configure their builds, this behavior will not yet be turned on by default. Instead, use --expand_configs_in_place as a startup flag to test this feature. --announce_rc may be helpful for debugging any differences between the fixed point and in-place expansions. Once you've debugged your problems, add "startup --expand_configs_in_place" to your blazerc to stick to the new behavior. RELNOTES: Use --expand_configs_in_place as a startup argument to change the order in which --config expansions are interpreted. PiperOrigin-RevId: 176371289
* Add option-specified warning.Gravatar ccalvarin2017-11-10
| | | | | | | Accept warnings specified by flag. This flag will cause a warning to be printed like a standard Option deprecation warning or any other warning from options parsing. This can be used to deprecate definitions of config expansion or bazelrc files. This should not be used to deprecate internal option specifications. RELNOTES: None. PiperOrigin-RevId: 175231963
* Make the config expansion behavior modular.Gravatar ccalvarin2017-11-10
| | | | | | | | | | | Reorganize the BlazeOptionHandler to make it easy to exchange out how the config options are expanded using the definitions in the blazerc. Also change the getOptionsMap call to actually structure the rc options in the order that we parse them: we expand them in command order (for the test command, first add all "common" options, then "build," then "test") and then within each command, we expand the options in the rc order. This somewhat simplifies the rc expansion code, and avoids the two-phase regrouping that used to happen. This change should not change the semantics of rc option ordering. A followup change will add an alternative implementation for --config's expansion. RELNOTES: None. PiperOrigin-RevId: 175208971
* Split apart options that should only be set by the client from ↵Gravatar ccalvarin2017-10-27
| | | | | | | | | CommonCommandOptions. client_env and default_override stand apart from the other common options. They can be very long, and should only be used by the environment setup. They should ideally not be passed by option at all, but in the RunRequest proto message, but for now, isolate them so that they don't clutter the common command options, which are passed all over the place. RELNOTES: None. PiperOrigin-RevId: 173592980
* Split out command line handling into its own file.Gravatar ccalvarin2017-10-25
This code is pretty self-contained: the command dispatcher needs to do options processing all at once, before initializing the command's environment. Splitting it out into its own file makes this more obviously a single step, which is less error prone. For changing --config, we will need to gate the behavior on the value of a startup option. This change will make it easier to isolate the new behavior from the old, since everything does not have to be kept in the same class. RELNOTES: None. PiperOrigin-RevId: 173288367