| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
The type was ignored, and it was expected that all expansion flags had
no value of their own, but was not checked.
PiperOrigin-RevId: 158261788
|
|
|
|
| |
PiperOrigin-RevId: 157878648
|
|
|
|
|
|
|
|
| |
The no_ prefix was initially undocumented, but its support has over time
lead to a number of inconsistencies.
RELNOTES: --no_ prefix no longer recognized.
PiperOrigin-RevId: 157631435
|
|
|
|
|
|
|
| |
Before it was omitting category titles / section breaks if the first option of the new category happened to be undocumented.
RELNOTES: None
PiperOrigin-RevId: 155458981
|
|
|
|
|
|
|
| |
You can now use the annotation @UsesOnlyCoreTypes on a subclass of OptionsBase, to indicate that all of its options' types are restricted to a whitelist of immutable and serializable types. Subclasses of the annotated class must also follow the same restriction.
RELNOTES: None
PiperOrigin-RevId: 154328920
|
|
|
|
| |
PiperOrigin-RevId: 153610163
|
|
|
|
|
|
|
| |
Added toMap()/fromMap() to OptionsParser, and moved the implementation of OptionsBase#asMap away from OptionsParserImpl.
RELNOTES: None
PiperOrigin-RevId: 153602479
|
|
|
|
|
|
|
|
| |
restrictions.
Prevent the old category strings "undocumented," "hidden," or "internal" from being used as categories, to prevent developers from relying on deprecated behavior.
PiperOrigin-RevId: 153525499
|
|
|
|
|
|
|
|
|
| |
Reduce spaghetti code by exposing the parser's OptionsData as package-private, rather than exposing individual methods ad hoc between OptionsParser and OptionsParserImpl.
Also change some calls from static constructors to diamond syntax.
RELNOTES: None
PiperOrigin-RevId: 153457442
|
|
|
|
|
|
|
| |
This lets us easily get all options classes of a parser, or all fields of those options classes, in a deterministic way.
RELNOTES: None
PiperOrigin-RevId: 153376699
|
|
|
|
|
|
|
|
| |
This prevents having to parse the category, and allows the category to potentially be used in the future for information about all options, included undocumented, hidden, or internal options.
Also rename DocumentationLevel to OptionUsageRestrictions, since INTERNAL was not really documentation related.
PiperOrigin-RevId: 153367769
|
|
|
|
|
|
|
|
| |
There's no reason an expansion flag should not expand to multiple values for a repeatable flag (a flag with allowMultiple set to true.) If this expansion flag is set in a SetValue policy, group its repeatable subflags into a single SetValue per subflag.
For an overridable SetValue policy on an expansion, any repeatable flag that it expands to should append its value, and not override the user's original values.
PiperOrigin-RevId: 153233784
|
|
|
|
|
| |
--no_ prefixes for boolean flags are deprecated. Error out nicely if --no_ is supplied.
PiperOrigin-RevId: 152434290
|
|
|
|
|
|
|
|
|
|
| |
This adds a new warning when the same flag is expanded to by multiple expansion flags. This extends an existing suite of warnings, e.g. for when an expansion flag conflicts with an explicit option.
The blaze canonicalize-flags command now takes a new flag --show_warnings. This flag causes any warnings encountered while parsing the given command line to be printed to stderr.
RELNOTES: blaze canonicalize-flags now takes a --show_warnings flag
PiperOrigin-RevId: 152186672
|
|
|
|
|
|
|
|
|
|
| |
Now that policy expands itself before being applied, clearValues never has to
clear more than a single value. This makes that more clear.
OptionValueDescription had not been consistently storing the snake_case name
for an option, leading to some weird behavior when removing the map of return
values from clearValues.
PiperOrigin-RevId: 152156746
|
|
|
|
|
|
|
|
|
|
|
|
| |
--incompatible_* flags
Note that if a developer adds a poorly-formatted incompatible change @Option, constructing an OptionsParser will now fail with an unchecked exception. This can cause some unit tests to fail in unexpected ways, but the developer should see an appropriate error message when the server starts up.
To be added: A separate integration test that ensures the expansions of --all_incompatible_changes don't clobber each other.
RELNOTES: None
PiperOrigin-RevId: 151858287
|
|
|
|
|
|
|
|
|
|
| |
The exception is unchecked. The reasoning is that errors during parser construction should not occur, and when they do occur it is an internal error like a failed assertion.
This allows casual uses of the options parser to stay oblivious to the possibility of failures, consistent with how DuplicateOptionDeclarationException is currently [not] handled. At the same time, the dispatcher can catch the exception to fail gracefully (by printing to stdout instead of a log file) when parser construction fails for any reason.
RELNOTES: None
PiperOrigin-RevId: 151839620
|
|
|
|
|
|
|
|
|
| |
Prevent OptionsBases with conflicting names due to --no boolean flag aliases to
successfully combine into parser.
Also remove the comment about --no_ not being documented, since it has been documented since Bazel was open-sourced.
PiperOrigin-RevId: 151738453
|
|
|
|
|
|
|
|
| |
For SetValue and UseDefault policies on expansion flags or flags with implicitRequirements, expand the policy into policy for each of its sub-flags. For SetValue, this addresses the issue with policies on expansion flags with overridable=true not actually letting user flags overrride the expansion. For UseDefault, this formalizes the behavior where UseDefault will wipe all user-provided flags that expand from a banned expansion flag, and will allow later work to guarantee that a later policy can override the expansion policy's subflags.
Since expansion flags do not have value, break if the invocation policy uses AllowValue or DisallowValue on an expansion flag.
PiperOrigin-RevId: 151718539
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides a way to programmatically define expansions of options based on what other options are defined for the parser. In particular, it will be used for the --incompatible_* changes mechanism, to turn on all incompatible change flags.
Expansion functions are specified in the @Option annotation, similar to converters. They are computed when an OptionsParser is constructed, and inspect a preliminary version of its OptionsData to determine the expansion result. This is then cached in the final OptionsData used by the parser.
Expansion information for usage strings is available, but only when the usage strings are obtained via the parser.
--
PiperOrigin-RevId: 150817553
MOS_MIGRATED_REVID=150817553
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is intended to be used for "flags" which should never appear on the
command line - things like configuration distinguishers, which are used
internally and must be part of the build options, but should always be set
to their default value at the top level.
This is already a convention within Bazel, but doesn't actually work the way
Bazel expects - flags with spaces can be set by simply escaping or quoting
the spaces so that word splitting will not break on them. This means they
can also be matched by config_settings, which pass a single string.
Forbidding the parser from matching these flags solves both of these
unintended cases.
Existing cases like this have also been converted to internal.
--
PiperOrigin-RevId: 150497246
MOS_MIGRATED_REVID=150497246
|
|
|
|
|
|
|
|
| |
Moved default converters from parser implementation to Converters. Moved other helpers to OptionsData. Also factored out new function getFieldSingularType.
--
PiperOrigin-RevId: 150473455
MOS_MIGRATED_REVID=150473455
|
|
|
|
|
|
|
|
|
|
| |
ParsedOptionEntry and OptionValueDescription were redundant and error-prone,
since converting from one to the other involved adding a name that could easily
be unrelated to the option value described.
--
PiperOrigin-RevId: 149111525
MOS_MIGRATED_REVID=149111525
|
|
|
|
|
|
|
|
| |
Fixes https://github.com/bazelbuild/bazel/issues/2416
--
PiperOrigin-RevId: 145595491
MOS_MIGRATED_REVID=145595491
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 145473123
MOS_MIGRATED_REVID=145473123
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Roll-forward with fix.
Tested with `bazel build src:srcs //src/test/...` using a bootstrapped bazel.
Fixes #1923.
RELNOTES[INC]: Non test-only targets can no longer depends on test-only targets.
*** Original change description ***
Automated [] rollback of commit a9f20b0d6459d395444c45cf5e94a899f3443633.
*** Reason for rollback ***
Broke Bazel CI:
ERROR: /home/ci/workspace/Bazel/JAVA_VERSION/1.8/PLATFORM_NAME/linux-x86_64/src/BUILD:284:1: in filegroup rule //src:srcs: non-test target '//src:srcs' depends on testonly target '//src/java_tools/junitrunner/java/com/google/testing/junit/junit4:srcs' and doesn't have testonly attribute set.
ERROR: Analysis of target '//scripts/packages:packages' failed; build aborted.
http://ci.bazel.io/view/Bazel%20b...
***
--
MOS_MIGRATED_REVID=136589937
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding an options parameter to DiffAwareness#getCurrentView seems like the
simplest way to achieve that.
Alternatives considered:
1. Making the diff awareness modules stateful. However, I did not want to do so
as I've also been working on improving the module API to reduce state, or at
least to have a proper lifecycle management for any necessary state.
2. Making the watchFs flag a constructor parameter. However, that would also
invalidate any implementations that don't use the flag (of which we have
several).
3. Only passing in a single boolean flag instead of an options class provider;
however, this is a more principled, futureproof API, which allows other
modules / awareness implementations to use their own options.
RELNOTES: --watchfs is now a command option; the startup option of the same
name is deprecated. I.e., use bazel build --watchfs, not blaze --watchfs
build.
--
MOS_MIGRATED_REVID=136154395
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Causes our integration tests on Darwin to time out
*** Original change description ***
Make --watchfs a common command option.
Adding an options parameter to DiffAwareness#getCurrentView seems like the
simplest way to achieve that.
Alternatives considered:
1. Making the diff awareness modules stateful. However, I did not want to do so
as I've also been working on improving the module API to reduce state, or at
least to have a proper lifecycle management for any necessary state.
2. Making the watchFs flag a constructor parameter. However, that would also
invalidate any implement...
***
--
MOS_MIGRATED_REVID=136070807
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding an options parameter to DiffAwareness#getCurrentView seems like the
simplest way to achieve that.
Alternatives considered:
1. Making the diff awareness modules stateful. However, I did not want to do so
as I've also been working on improving the module API to reduce state, or at
least to have a proper lifecycle management for any necessary state.
2. Making the watchFs flag a constructor parameter. However, that would also
invalidate any implementations that don't use the flag (of which we have
several).
3. Only passing in a single boolean flag instead of an options class provider;
however, this is a more principled, futureproof API, which allows other
modules / awareness implementations to use their own options.
RELNOTES: --watchfs is now a command option; the startup option of the same
name is deprecated. I.e., use bazel build --watchfs, not blaze --watchfs
build.
--
MOS_MIGRATED_REVID=136026835
|
|
|
|
|
|
|
|
|
|
|
| |
- change options to print --foo=value
- allow option to specify what "value" should be
- update the documentation for the startup options
- add some indentation to the descriptions
- add some spacing between flag texts
--
MOS_MIGRATED_REVID=125960618
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=125665042
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=125662988
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=125568305
|
|
|
|
|
|
|
| |
An upcoming change will pipe this to an actual page.
--
MOS_MIGRATED_REVID=125545220
|
|
|
|
|
|
|
| |
correctly with flags that have expansion flags or implicit requirements.
--
MOS_MIGRATED_REVID=121862297
|
|
|
|
|
|
|
|
|
| |
This saves the cost of (1) collecting all Options classes and (2) getting all their @Option annotations. Note that there is no savings on reflection costs, since that's already memoized internally by OptionsParser.
This saves ~250us per Blaze invocation.
--
MOS_MIGRATED_REVID=121153156
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for retrieving
the default values of options.
The field defaultMultipleValue was introduced in commit 51a491b89a9cd5f15c9a093a5693bc37e696e6e1 to allow defining a
default value for options that set allowMultiple. However due to the limitations of
the optionsParser end up being not useful since we cannot guarantee that an option
that allows multiple has a converter that returns a list of values.
Thus this CL deletes code that may confuse even more and clarifies the mechanism
that the options currently use to obtain their default values.
--
MOS_MIGRATED_REVID=120317261
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=118042058
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=117939121
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
default values for
flags whose allowMultiple is true.
The behavior is the following:
- If allowMultiple is false then behave as previously.
- Otherwise for retrieving the default we now look at defaultMultipleValue instead of defaultValue and
in the process it will apply the converter to each element. If no defaultMultipleValue is specified
then the default value will be an empty list.
--
MOS_MIGRATED_REVID=117558645
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The --help option is currently broken when allow residue is false as the --help option cannot be parsed and results in exit(2) after emitting the unhelpful message:
Error parsing command line: Unrecognized option: --help
Try --help.
In this case, --help is never reached, and so cannot be used.
Solution:
In the proposed code, if any argument is --help, the --help message will be preferred over emitting parsing errors. The process will now exit(0) prior to parsing any other arguments if --help is passed.
--
MOS_MIGRATED_REVID=115495600
|
|
|
|
|
|
|
|
|
| |
value of an option with null.
Currently it returns the original default value if the new value is null.
--
MOS_MIGRATED_REVID=115442253
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=112267123
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=111853144
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=109067924
|
|
|
|
|
|
|
| |
old name.
--
MOS_MIGRATED_REVID=107611961
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=107389541
|
|
|
|
|
|
|
| |
annotation for the options parser. oldName indicates the old name for the option, and the option will be parsed under both name and oldName. wrapperOption indicates that the option is a wrapper for other options. For example, in "--foo=--bar=baz", --foo wraps --bar=baz. With wrapperOption set to true for --foo, the options parser will "unwrap" --bar=baz and parse them as top-level flags.
--
MOS_MIGRATED_REVID=105924412
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=105511114
|
|
|
|
|
|
|
| |
--invocation_policy startup flag and allows an application invoking Bazel to set or override flag values (whether from the command line or a bazelrc).
--
MOS_MIGRATED_REVID=104160290
|