summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-10-24Track expansions in OptionValueDescription.ccalvarin
Add warnings for behavior that is likely unexpected. Expansion values do not accept values at all, and implicit requirements are set regardless of whether the option was turned "on" or not, so warn in the cases where this weird behavior might rear its ugly head. RELNOTES: None PiperOrigin-RevId: 172883214 GitOrigin-RevId: 1a4f4264492a0b37a4132d629342aa961fa1c6b0 Change-Id: I7f125848d4ee9b56184f1ac46343187bd7b79ddf
2017-10-24Remove feature to allow expansion flags to have values.ccalvarin
It was added as a potential fix for --config (an expansion flag with values), but this would have required forcing the parser to know the config's expansions at parsing time, which is not currently possible. Instead, we will use the new addition of option-location tracking to make sure we expand options at a the correct place, even if the expansion is triggered after the fact. This is mostly a straight forward undoing of https://github.com/bazelbuild/bazel/commit/7c7255ec8d6da20526c2c4078c57aadaf3dd3612, except where the context has changed. Notably, implicit requirements are effectively treated like expansion flags, so special casing in OptionDescription could be removed. RELNOTES: None. PiperOrigin-RevId: 172514997 GitOrigin-RevId: 34a9fea78f201caed8ace5c714a0cf288cb97c65 Change-Id: Ic26df46a5ff16f3b6dd89616ef9fcbe9a7971fa6
2017-10-24Migrate all users of OptionsParser.enableParamsFileSupport to use the ↵apell
ShellQuotedParamsFilePreProcessor. This covers all of the tools packaged in the ResourceProcessorBusyBox. RELNOTES: None. PiperOrigin-RevId: 172485486 GitOrigin-RevId: 20264552e18d8413f77b22b124e84e0267ce2b5e Change-Id: I124e1843794e7c6f6deb8e30305546cf1dd944ee
2017-10-24Track Option placement within a priority category.ccalvarin
An option has precedence over previous options at the same enum-valued priority. Track its placement in this ordering explicitly. This will allow after-the-fact expansion of expansion options such that they correctly take precedence or not compared to other mentions of the same flag. This is needed to fix --config's expansion. RELNOTES: None. PiperOrigin-RevId: 172367996 GitOrigin-RevId: 7cd9e883dd31f54cd505844aa1f1e0ed7bd9f380 Change-Id: Ia0c09601ac24ffceb31e47b9113a636849c9b2f4
2017-10-24Make option conflicts less spammy.ccalvarin
Remove an unnecessary warning and make all warnings for option conflicts print only if the option values are not equal. RELNOTES: None. PiperOrigin-RevId: 172124261 GitOrigin-RevId: 2553875c285dcca454ee830182d238296ce70aa2 Change-Id: I335a346ac2f8c92deba52fc3b5ce582f8d0fa20e
2017-10-24Desugar-singlejar integration tests for double-checking default methods.kmb
PiperOrigin-RevId: 171980809 GitOrigin-RevId: 9cf05abe06ee687d21e8a5bb12399a33f3fe0498 Change-Id: I4995c684a6d1d7440a125e1f56daa47209c60cdc
2017-10-24Expand implicitRequirements in the location of the option that required it.ccalvarin
Removes the special casing of implicit requirements. Accumulating them and parsing them at the end of the parse() function was never enough to actually guarantee that the value not be replaced. I've gone through all options with implicit requirements to make sure that the expectation is checked after options parsing, so this change should be relatively safe. Implicit requirements is still a broken concept - they don't actually expand based on the value given, so a user that is explicitly NOT setting a flag might unwittingly be setting all the requirements for that unset flag. Removing it fully requires redesigning or removing the flags that set it, though, so for now we are standardizing the behavior so that it behaves like any other expansion options, just one with a value. Also consolidate the deprecated wrapper option behavior into the expansion work. It will soon be removed entirely, but for now it can get grouped in with the expansion logic, so that its differences are more explicit. RELNOTES: None. PiperOrigin-RevId: 171957502 GitOrigin-RevId: faf2db22277bd0b074a0a8c5cd4533a735eff31a Change-Id: I84a1461624207d3d43786ebc69d17ab6f16f9ec8
2017-10-24Remove the implicit requirement of core_library.ccalvarin
The semantics of implicit requirements will soon change to adding the requirements in-place in the command line. This particular implicit requirement was not necessary. RELNOTES: None. PiperOrigin-RevId: 171841036 GitOrigin-RevId: b95f41b7aa8a53bee1fe0d4dc8dc843ddc22d2f7 Change-Id: Id8fda8f69c2ad6be85b381be4bc0d06ece4d0ceb
2017-10-24Clean up InvocationPolicy's use of OptionDescription.ccalvarin
OptionDescription is basically a hack to get the expansion data for options from outside the options parser, but it was being used at various points of invocation policy enforcement. In order to correctly track option origin, we only want to get this information once. Do it during the invocation policy expansion stage, not at enforcement, so that we track the information of the option's origin in the original invocation policy passed to the enforcer, not the expanded one. PiperOrigin-RevId: 171661669 GitOrigin-RevId: ca74482825e0c0ca5d119eceab74ba4292428557 Change-Id: Ib57ed5c67054c051a420507506807a8eb6809f47
2017-10-24Report the structured Bazel command line via the BEP.ccalvarin
This is part of the effort outlined in https://bazel.build/designs/2017/07/13/improved-command-line-reporting.html. The refactoring of the options parser is not yet complete, so we still do not have complete & correct information about the canonical command line. Where the information is blatantly incorrect, a best approximation was made, with comments and tests documenting the deficiencies. Change the names of the initial CommandLine fields in the BEP to be explicitly identified as unstructured. RELNOTES: None. PiperOrigin-RevId: 171625377 GitOrigin-RevId: ceb1013c1ca0238188e2714442fcfb2efb16bc6a Change-Id: I3a40b8e1ebd5d6a7d7e893be369d6d25de758ac7
2017-10-24Do not rewrite static interface method invocations from bootclasspathGoogler
RELNOTES: n/a PiperOrigin-RevId: 171344856 GitOrigin-RevId: 38da0c2e6e082964e32e8646439cdec7cd50808f Change-Id: Ice56501cd04133409dacde89318abac85b1828b9
2017-10-24Downgrade the default invocation policy log levels to fine.ccalvarin
Unfortunately, since the invocation policy gets enforced on a user's command line early in the command environment setup, so the effective log level is not yet set. For this run, keep the logs at INFO, since any other level will disappear into the ether. InvocationPolicy gets enforced not only at invocation startup but also elsewhere to recompute the default values. The log statements from these different runs overwhelm the log output from our tests, making it hard to find other events without filtering the log. Make all extra invocation policy enforcements log at FINE so that they only appear when extra detail is requested. PiperOrigin-RevId: 171151573 GitOrigin-RevId: 334d2f155d85fca1797e249dc0acf2c47be089b0 Change-Id: I2bd3fbd782b2b077a8e82ae6e38abb07a9d8df5d
2017-10-24Categorize build options for BuildConfiguration.gregce
PiperOrigin-RevId: 171017483 GitOrigin-RevId: e1b09f2f072231ed882c1de364fe3ea5c1f7d5af Change-Id: I697b9bfbf16dbd4186ec50362795d8a0f937dd73
2017-10-24add flags to desugar to emit metadata that can be used for double-checking ↵kmb
correctness of default and static interface desugaring. RELNOTES: none PiperOrigin-RevId: 170779637 GitOrigin-RevId: bdb12ceeb7c23d7d2293e8006d0aa7127a91b973 Change-Id: I6969cc42323b5299a90af9e8084658e9f654825f
2017-10-24Add new option categorization and tagging information to HelpCommand's output.ccalvarin
If setting flag --use_new_category_enum, group the options by the new categories in both the command line output and the "everything-as-html" output used for the generated docs at https://bazel.build/versions/master/docs/command-line-reference.html. In the html output, the effect and metadata tags are listed for each option, with links to their descriptions at the bottom of the page. The tags only appear in the terminal output in -l/--long/--help_verbosity=long, and only the names appear. This is still experimental as the majority of options do not yet use the new categorization system. The new output can be seen in command-line-reference.html format by adding the new flag to the "help everything-as-html" line in //src/main/java/com/google/devtools/build/lib:gen_command-line-reference. The html output is in the same order as before (by blaze rule, with inherited options not repeated), which means it still has duplicate options, that should ideally be fixed separately. I propose either dropping the high-level grouping and just grouping the options by documentation category, or potentially grouping them by optionsbase in some non-class-naming way, and listing the commands that they apply to, as more and more optionsbases are used by multiple commands without being inherited (for example, all BuildEventServiceOptions are listed 20 times). People probably use ctrl-f to navigate this page anyway. Once we know that we only list each option once, we can actually have links to the options, which will make it possible to have links in the expansion lists. Issue #3758 RELNOTES: added experimental --use_new_category_enum to the help command to output options grouped by the new type of category. PiperOrigin-RevId: 170116553 GitOrigin-RevId: 77e3a5ca955a3834406a837dbd4607b0b432b2d8 Change-Id: Id3f1fea6833f0cc05d127eb1454f21c92b22e03a
2017-10-24Move the canonicalization of an option value to the option value itself.ccalvarin
Ideally, the canonical form we output from OptionUtils would be the same as for the command canonicalize-flags, but that must wait for dependencies to be cleaned up. Still, in the meantime, keep the --foo=1 normalization of --foo, and apply it to all other boolean flag values (t,true,yes,y, and false equivalents), so that the canoncalize-flags output is more canonical, even if it isn't using the --[no]foo form yet. RELNOTES: Boolean flag values will now get normalized to 1 or 0 in canonicalize-flags output. PiperOrigin-RevId: 170084599 GitOrigin-RevId: 659feca7dee332f75801010b018505b7ba5a185e Change-Id: I65e969918c0ce0129d52e3fcdda4d95cde5175b7
2017-10-22Use final release of ASM 6.0 am: 24351c4eab am: b94c5b8efd am: c6068560adColin Cross
am: 6c5f891f50 Change-Id: Ia095b297760c9dc39dc0d6049063eea99c0620ea
2017-10-22Use final release of ASM 6.0 am: 24351c4eab am: b94c5b8efdColin Cross
am: c6068560ad Change-Id: I037907bbdf9eb7bcd0691e64985acc3c440cf11d
2017-10-22Use final release of ASM 6.0 am: 24351c4eabColin Cross
am: b94c5b8efd Change-Id: I9c4ae59929524f4447606673543453e112f0db03
2017-10-22Use final release of ASM 6.0Colin Cross
am: 24351c4eab Change-Id: Idcd580dcd5609002682c1a1f4eb5221bbc098e0c
2017-10-20Use final release of ASM 6.0Colin Cross
Test: m checkbuild Change-Id: I841aadecf4b9ee3318eb10a67bd460d07a6d3860
2017-10-17Move OpenJDK9-specific javacflags am: 46cd42316b am: 543731678d am: 73f0f562e9Colin Cross
am: f5d9b7abf2 Change-Id: Ibc528050de868ebb7efa00eac6ac22603ff32062
2017-10-17Move OpenJDK9-specific javacflags am: 46cd42316b am: 543731678dColin Cross
am: 73f0f562e9 Change-Id: I3268aa3d1fc727096ed1a448ac6ad6b8e1e2a7cb
2017-10-17Move OpenJDK9-specific javacflags am: 46cd42316bColin Cross
am: 543731678d Change-Id: I2bef0258b2c6131417a0a7cb202793a138ebeb03
2017-10-17Move OpenJDK9-specific javacflagsColin Cross
am: 46cd42316b Change-Id: Ifa1f7cf7f367cf050933958457713a334ddffb2a
2017-10-12Move OpenJDK9-specific javacflagsColin Cross
Test: m -j checkbuild Change-Id: I498a662390177bfcd6301d19d5834b7ea3361709
2017-09-25Merge remote-tracking branch 'aosp/upstream-master' am: 14905bc683 am: ↵Ivan Gavrilovic
3a238ab3dd am: 34477e8629 am: 01ca295d00 Change-Id: Id923cb5e1f5be4125f1905bcd607d00a32e74441
2017-09-25Merge remote-tracking branch 'aosp/upstream-master' am: 14905bc683 am: ↵Ivan Gavrilovic
3a238ab3dd am: 34477e8629 Change-Id: I036c4ea04f82b177d5262d7021a05667e403c209
2017-09-25Merge remote-tracking branch 'aosp/upstream-master' am: 14905bc683Ivan Gavrilovic
am: 3a238ab3dd Change-Id: I42c5bc3246a1d22ac12ba53425aada744a1544d4
2017-09-25Merge remote-tracking branch 'aosp/upstream-master'Ivan Gavrilovic
am: 14905bc683 Change-Id: Icde73e5b33f3c10662bced068a7a9a21f19558e4
2017-09-25Merge remote-tracking branch 'aosp/upstream-master'Ivan Gavrilovic
* aosp/upstream-master: (25 commits) Track the origin of an option in the option instance, not its final value. Deprecate wrapperOptions. Track all option instances. Cleanup of expansion option naming Create multiple ParamsFilePreProcessors to allow parsing files using the formats specified in ParameterFile.ParameterFileType. Also maintain the currently used parsing style of whitespace split arguments that allows single and double quoting and whitespace and quote escaping. This style of parsing is for a format not currently generated and will be removed once all consuming actions have been converted to using a supported format explicitly. Document the options in smaller commands. Treat parsed option values differently by option type. Throw away the confusing UnparsedOptionValueDescription name. Introduce "bazel help flags-as-proto" to print information about supported flags as a text protobuf. Pass the UnparsedOptionValues when setting or adding option values. Consolidate the "unparsed" option value tracking. Open source tests for Android desugarer. Move option value tracking classes to their own file. Replace referrals to options by their name to option definitions. Option value tracking should refer to the option definitions, not just track option name. Options with oldNames will no longer get reported twice in the effective option lists. fix for legacy jacoco instrumentation in interfaces behind flag RELNOTES: n/a Expansion flags need some restraints. Rename all logger instances to "logger" (instead "LOG" or "log"). Update comments about the option processor. ... Test: mma external/desugar Change-Id: I718bba35f1eb9eaacd68cb37d79a5c2068d3b9c1
2017-09-25Update copybara to exclude test resources am: d0f248dbc7 am: f64f5e13f4 am: ↵Ivan Gavrilovic
550655cfbe am: 7c095d65af Change-Id: I1ea702d0a63c66ecac3c987dafba690d4be2d1a6
2017-09-25Update copybara to exclude test resources am: d0f248dbc7 am: f64f5e13f4Ivan Gavrilovic
am: 550655cfbe Change-Id: Ie999f654aca2a172f1523f2dce2fa1fe74535029
2017-09-25Update copybara to exclude test resources am: d0f248dbc7Ivan Gavrilovic
am: f64f5e13f4 Change-Id: I08193f1aa05efe22901767f4b43b293d992e0e05
2017-09-25Update copybara to exclude test resourcesIvan Gavrilovic
am: d0f248dbc7 Change-Id: I8eb73a10b9f06f247b4be95a816dcdae169701b7
2017-09-22Update copybara to exclude test resourcesIvan Gavrilovic
Excluded test txt and jar files from Apache 2.0 license verification. Test: copybara import Change-Id: I7e651e7e9e8f9bb4e8878fd40c3408aa6f9e5cce
2017-09-22Track the origin of an option in the option instance, not its final value.ccalvarin
A single instance of an option has a single origin, but the final value only has a single origin if it has a single value. For multi-valued options, it is wrong to expect that the final value of an option will have a single parent. Track the option parents (which option expanded to the current instance, if any) in the right place, with the ParsedOptionDescription. Also fix some inconsistent spelling of 'dependent,' in favor of the American English standard. RELNOTES: None. PiperOrigin-RevId: 169487515 GitOrigin-RevId: 3a0df3cb0637d71dfcf0add7057332c09cd508c5 Change-Id: Ic187397f8204aea3638b109b71d590920e968bdb
2017-09-22Deprecate wrapperOptions.ccalvarin
In order to discourage new uses (there shouldn't be any, but just in case), make it illegal to set wrapperOption=true for non deprecated options. RELNOTES: None. PiperOrigin-RevId: 169477990 GitOrigin-RevId: 125e88d693f04df7f9039906dc7bb03245fb61f7 Change-Id: Iab3e66245c1cfb53aada05654cc304a4334ddd9a
2017-09-22Track all option instances.ccalvarin
Regardless of option type, have the OptionValueDescription track information about the parsed option. This does not yet change the values that we output as part of the GotOptionsEvent, as the expansion, implicit req, and wrapper options still don't actually track anything in their option value. RELNOTES: None. PiperOrigin-RevId: 169469793 GitOrigin-RevId: 1ad38ea0dd4eb10cad92daf0fb2710ff118147c9 Change-Id: If2f29862ffabb190cbb9fcdc1a56685fa2916a5e
2017-09-22Cleanup of expansion option namingccalvarin
Options that expand to other options are expansion options and the options they expand to have values that were expansions. This can be a bit confusing. Removes the isExpansion() call that is somewhat ambiguous, and forces option users to explicitly check the option definition for this information. Also provide a parallel boolean function for implicit requirements, so that we stop querying for the length of the implicit requirement all over the place. RELNOTES: None. PiperOrigin-RevId: 169461566 GitOrigin-RevId: 4acb36c048a620abd7a0f5dff274851bd6dd9c28 Change-Id: I75068dceefa40f56201d3b6817d551741137085d
2017-09-22Create multiple ParamsFilePreProcessors to allow parsing files using the ↵apell
formats specified in ParameterFile.ParameterFileType. Also maintain the currently used parsing style of whitespace split arguments that allows single and double quoting and whitespace and quote escaping. This style of parsing is for a format not currently generated and will be removed once all consuming actions have been converted to using a supported format explicitly. RELNOTES: None. PiperOrigin-RevId: 169437362 GitOrigin-RevId: bcb3c5798390d6901681e74e19099378a9afae0a Change-Id: I203a3cabbf693bc3e85ed1d63e7001e9787aa036
2017-09-22Document the options in smaller commands.ccalvarin
RELNOTES: None. PiperOrigin-RevId: 169258065 GitOrigin-RevId: 2573540ae538f117a7ac919783298561ed484e3e Change-Id: Ib1f1f1e1ae7b082c70bb5d65b4a9044aa8b0e24f
2017-09-22Treat parsed option values differently by option type.ccalvarin
There is a vexingly large world of possible option types, each with its own quirks of how it interfaces with new inputs as they come in: values can be - overridden (default) - concatenated (allowMultiple) - flattened (allowMultiple that accepts list inputs) - disappear into additional flag inputs (expansion flags) Or some combination of the above, in the case of flags with implicit dependencies and wrapper options. Begin removing the error-prone treatment of all option types with conditional branches. This model of the different options will make it much easier to isolate the option-type specific logic with the command-line parsing logic. Flags that affect other flags (implicit requirements, expansions, and wrappers) will be migrated in a later change. This CL does not change flag parsing semantics, just migrates the current parsing logic to the new class structure. RELNOTES: None. PiperOrigin-RevId: 169239182 GitOrigin-RevId: 3ab171a1b03861d40fcf49fb56e2d8df87db25ab Change-Id: I2933cb6d69e3d5b3c605bc6d9308f8be84dd3714
2017-09-22Throw away the confusing UnparsedOptionValueDescription name.ccalvarin
We get UnparsedValues after ... parsing the options. So that doesn't make sense. What was meant was that it wasn't converted to the final value. In an effort to make this distinction more clear, this change will make the terminology more consistent. The `--foo=bar` step is "parsing" and the `bar -> Object` step is "converting" (it is, in fact, done by Converters). RELNOTES: None. PiperOrigin-RevId: 168852847 GitOrigin-RevId: fb153cd83c6f801271048ec1d62d17a68562376d Change-Id: I90065b60724e698b93e685c045a21f901adb3c14
2017-09-22Introduce "bazel help flags-as-proto" to print information about supported ↵fwe
flags as a text protobuf. PiperOrigin-RevId: 168695297 GitOrigin-RevId: 346c8ff48419cf612c34a2fc9d7daa885f8f16c0 Change-Id: I80a6d82222886c97da2aa56db7bcefc2acbdd5e3
2017-09-22Pass the UnparsedOptionValues when setting or adding option values.ccalvarin
Stop breaking the value apart to be recombined later. Also stop using OptionValueDescriptions as though we have a final option when expanding flags for invocation policy. These values are explicitly the output from parsing the expansion strings, not yet converted or combined with other values of the same flag. After this change, only UnparsedOptionValueDescription should be used when strings of flags are parsed, and OptionValueDescription should be used when the final version of a flag is created or used. PiperOrigin-RevId: 168688063 GitOrigin-RevId: a8c0c8dfad38437bc617b4b66d271bc0beb1b7c1 Change-Id: I159b1a1a076704bc3b90760b8c8ad628a135830a
2017-09-22Consolidate the "unparsed" option value tracking.ccalvarin
In preparation for linking the parsed and unparsed values of options, consolidate and standardize our representation of the flag values as we received them (what is meant by "unparsed" values in this case). This was being done separately in ParseOptionResult, which, with extra context added, is being folded into UnparsedOptionValueDescription. We now track how an option was provided and where it came from for all option parsing. RELNOTES: None. PiperOrigin-RevId: 168682082 GitOrigin-RevId: 5fe8e6629e09ce44c6835d1b8f3a36bc3d69f131 Change-Id: I3964b563289ee39ab3a9a7ac496ed033459546c0
2017-09-22Open source tests for Android desugarer.ajmichael
These tests will fail with a helpful error message if you do not have android_sdk_repository set up. They currently require that platform 25 be installed in your SDK. RELNOTES: None PiperOrigin-RevId: 168570577 GitOrigin-RevId: d60e0d02eb56e27f98086d764c6d9f88898d920d Change-Id: I27f71669816c963111a92762a9f3dffddabfa0f6
2017-09-22Move option value tracking classes to their own file.ccalvarin
These classes are mostly used during the options parsing process itself, and are barely a part of the options parser interface, so they really don't belong in OptionsParser.java. They are also about to change significantly, so taking this opportunity to split them out. RELNOTES: None. PiperOrigin-RevId: 168400162 GitOrigin-RevId: 7da54b5e2942bdb444abbf68ac3c7f34a453b4d9 Change-Id: I476d951094068ca828d3503c8c8af9dfe5648e5e
2017-09-14Revert "Revert "Convert desugar to Android.bp"" am: 8c363aa283 am: ↵Colin Cross
166683c634 am: a06597bf86 am: 95754daeb4 Change-Id: I7839b4bf7d16c1c7ce387411436f930321995f63