aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
Commit message (Collapse)AuthorAge
* Add the default category and tag to all options.Gravatar ccalvarin2017-06-28
| | | | | | | | Move the default from the annotation to every mention. This makes the incompleteness explicit. Will add the defaults to test targets in a separate change. Once all dependencies are cleaned up, the Option annotation will no longer allow options without the documentationCategory or effectTag, to prevent new options being added without categories while we migrate to the new option categorization. PiperOrigin-RevId: 160281252
* BEP: Gracefully handle null configurationsGravatar Klaus Aehlig2017-06-28
| | | | | | | Those may occur, e.g., if the target is simply a source file. Change-Id: Ia64c54e8543dd93712b00428c443922c67e2b6cd PiperOrigin-RevId: 160278149
* Add more helpers to ParserGravatar brandjon2017-06-28
| | | | | | | This simplifies parsing a lone statement or expression in unit tests. RELNOTES: None PiperOrigin-RevId: 160276410
* Tests + cleanup + docs for ctx.actions.declare_{file,directory}Gravatar dslomov2017-06-28
| | | | | RELNOTES: None. PiperOrigin-RevId: 160273273
* Fix typo in JsonFormatFileTransport.javaGravatar Eric Dobson2017-06-28
| | | | | | | | Invlaid -> Invalid Closes #3119. PiperOrigin-RevId: 160270924
* BEP: also report test sizesGravatar Klaus Aehlig2017-06-28
| | | | | | | The size of a test is a relevant property of a test target. Report it. Change-Id: Ia529a11f4a6920bca7d233e3493640d319cca5ae PiperOrigin-RevId: 160268370
* Add 'ctx.actions.declare_directory'Gravatar dslomov2017-06-28
| | | | | RELNOTES: None. PiperOrigin-RevId: 160267763
* Turn unary minus into a proper AST nodeGravatar brandjon2017-06-28
| | | | | | | This unifies unary minus with NotExpression, and moves the minus logic from a fake builtin function into the interpreter proper. RELNOTES: None PiperOrigin-RevId: 160266266
* Enable connection pooling for the remote REST cacheGravatar Benjamin Peterson2017-06-27
| | | | | | | | | | | | | | | | | Connection pooling is a useful optimization for REST caches that are far away as it avoids constantly redoing the TCP handshake. It also prevents large builds from exhausting the local interface's source ports through tens of thousands of one-transaction connections. The default connection pool size of 20 is fairly arbitrary. Users probably want to set this to something close to the value of --jobs. We introduce some generic infrastructure for closing remote cache instances and use it to cleanly shutdown the connection pool between builds. Change-Id: I73adc29ecae15cc10a1217ffbaa483892bcd4f9a PiperOrigin-RevId: 160264681
* Add 'ctx.actions' and implement 'ctx.action.declare_file'.Gravatar dslomov2017-06-27
| | | | | RELNOTES: None. PiperOrigin-RevId: 160264501
* BuildEventStreamUtils: update TODO to reflect the new plan of actionGravatar aehlig2017-06-27
| | | | | | | | | It seems preferable to make the TestStatus in the build event protocol the primary one. So update the TODO entry to reflect the new plan to get rid of the old BlazeTestStatus. RELNOTES: None PiperOrigin-RevId: 160263709
* Simplify the RemoteActionCache interfaceGravatar ulfjack2017-06-27
| | | | | | | | | | | | | | | | | | | - merge all the inputs upload functionality into a single ensureInputsPresent method - merge all of the action result upload functionality into a single upload method - merge all the download functionality into a single download method This significantly simplifies the caller of this interface, and opens the door for additional performance improvements in implementations which now have more control over the upload / download flows; in particular, in the gRPC case, we can upload stdout / stderr using the existing chunker - upload of stdout / stderr is no longer serialized with file upload. In particular, the CachedLocalSpawnRunner test becomes much simpler, since it no longer needs to handle the previous more complex upload code path. PiperOrigin-RevId: 160260161
* BlazeCommandDispatcher: make parseArgsAndConfigs not take a CommandEnvironmentGravatar ulfjack2017-06-27
| | | | | | | | | | | | | Accept an ExtendedEventHandler in ProjectFileSupport, and use an ExtendedEventHandler in BlazeCommandDispatcher that captures the posts, and delay posting the GotProjectFileEvent until the initialization is complete. This is a small step towards simplifying the BlazeModule API - the plan is to merge beforeCommand, checkEnvironment, and handleOptions into a single method, but introduce a new method (commandInit) to participate in the early command initialization. PiperOrigin-RevId: 160259628
* Fix the name of a flag in an error messageGravatar dmarting2017-06-27
| | | | | | | The name of the flag was camelCased whereas the correct name is underscore separated. PiperOrigin-RevId: 160245462
* LLVM FDO zipped profiles contain the LLVM raw profile file whose contentsGravatar Googler2017-06-27
| | | | | | | | | | | | | are named fdocontrolz_gen_profile.profraw. LLVM zipped profiles are obtained via fdocontrolz which names the raw profile file fdocontrol_gen_profile.profraw. Previously, this file was named to be identical to the zip file but that had to be changed as users want to retain the ability to rename the zip file. RELNOTES[NEW]: Change to handle LLVM FDO zipped profile contents correctly. PiperOrigin-RevId: 160230719
* Fix RuleContext documentation typo.Gravatar gregce2017-06-27
| | | | PiperOrigin-RevId: 160191135
* Add idl_preprocessed field to android_library.Gravatar Googler2017-06-27
| | | | | RELNOTES: Add idl_preprocessed attribute to android_library, so that preprocessed aidl files can be passed to android_library for compiling PiperOrigin-RevId: 160185474
* Add option tagging and categorizing enums.Gravatar ccalvarin2017-06-27
| | | | | | | | | | | | | | Begin work of transferring option categorization to a sustainable, documented setup. DocumentationCategories will replace the existing string category field, and will group flags in generated documentation. Each flag must belong to exactly 1 DocumentationCategory, whichever is most applicable or a new one. OptionEffectTags will document the effects of tags and will be used for filtering flags. These tags, unlike the categories, should be complete. All options that do affect Bazel's output should be tagged as affecting Bazel's output, for example. This is necessary for them to be useful when trying to isolate the cause of an issue or behavior by allowing irrelevant options to be filtered out. Each flag must have at least 1 intended behavior, so should have 1+ OptionEffectTag. If no effect tag applies, find a general tag that would apply and add it to all relevant options. OptionMetadataTags will hold information about the flag itself. Information about the lifecycle of a flag, for example, should belong in an OptionMetadataTag. It is useful for filtering, since it describes how trustworthy we might think the flag would be, but does not actually describe the “intent” or “meaning” of a flag. This can be an empty list, but options can also have multiple OptionMetadataTags All options will be switched from the old "category" field to this new system. A few general OptionsBases are provided as an example. PiperOrigin-RevId: 160180328
* Add the ability to provide source_jars to java_common.create_providerGravatar Googler2017-06-27
| | | | | | | | This should allow macros using 'custom rule' + java_import to move the full java_import logic into their rule implementation. Also, fix the definition so that the default values work and the keyword args can be omitted. PiperOrigin-RevId: 160167191
* Refactor SkyQueryEnvironment to allow preprocessing or postprocessing targetsGravatar Googler2017-06-27
| | | | | | | | Refactor SkyQueryEnvironment and a few other query helpers to make it easier to work with targets. RELNOTES: None PiperOrigin-RevId: 160165398
* Forbid octal sequences greater than \377 (0xff) in strings.Gravatar laurentlb2017-06-26
| | | | | | | | RELNOTES[INC]: In strings, octal sequences greater than \377 are now forbidden (e.g. "\\600"). Previously, Blaze had the same behavior as Python 2, where "\\450" == "\050". PiperOrigin-RevId: 160147169
* Add JavaSkylarkApiProvider to aar_import rule.Gravatar Googler2017-06-26
| | | | | | | Without this, aar_import targets will not have java attribute in skylark, therefore not able to generate any ide info by intellij_info_aspect in intellij_info.bzl. RELNOTES: None. PiperOrigin-RevId: 160146803
* Enabling Aapt2 processing:Gravatar corysmith2017-06-26
| | | | | | | | | | | | * Add a new aapt_version attribute to android_binary * Add a new android_aapt_version flag to control the version of aapt used. * Add a new implicit output for aapt2 produced static libraries. * Add a new implicit output for aapt2 produced .flat files zip. RELNOTES: New property on android_sdk: aapt2 Choose the version of aapt on android_binary PiperOrigin-RevId: 160145530
* Remove usage of --ios_cpu from Bazel.Gravatar cpeyser2017-06-26
| | | | PiperOrigin-RevId: 160143322
* ResourceFilter properly handles special language qualifiersGravatar Googler2017-06-26
| | | | | | | | | | | | | | | | | | | | Two special types of language qualifiers are commonly used: Serbian can be written in Latin or Cyrillic characters. Serbian in Latin characters is referred to as sr-Latn (or, with a misplaced region prefix, sr-rLatn, or with the permutation common in some code for the old verions of regions supported by Aapt, sr_Latn). Spanish spoken across Latin America and the Caribbean can be represented by es-419 (or, using the permutation for old qualifier formats, es_419). For both of these, transform the resource qualifier into an appropriate BCP-47 representation that can be handled by FolderConfiguration. Also, add attribute warnings when these qualifiers are used in their specially-handled form (instead of in BCP-47 form). RELNOTES: none PiperOrigin-RevId: 160143247
* Remove remaining xcodegen references.Gravatar schmitt2017-06-26
| | | | | | | Deletes last code references to xcodegen tool as well as tool itself. RELNOTES: None. PiperOrigin-RevId: 160137807
* Make BuildEventStreamer flushable before first eventGravatar Klaus Aehlig2017-06-26
| | | | | | | | | | | | | | | Make the BuildEventStreamer capable of handling the flush() method, even before the initial build event is seen. This happens, if a lot (more than 10240 bytes) of output is produced before the BuildStartingEvent is generated- This is not unlikely, as the whole option processing happens before the build starts. As the promise of flush() is that the OutErrProvider is cleared, and that all output between two flush() get into separate events, numbered in order, we have to temporarily store a list of stdout/stderr String pairs. RELNOTES: None. PiperOrigin-RevId: 160137478
* Make Metadata an interface for FileArtifactValueGravatar ulfjack2017-06-26
| | | | | | | | | | Replace all previous uses of Metadata with FileArtifactValue (or a simple inner class in the case of ActionCacheChecker.CONSTANT_METADATA). Care was taken to make the equals method obey the equals contract, even in the presence of multiple implementations. PiperOrigin-RevId: 160115080
* Automated rollback of commit 68b9a7e2dc17e32b194238d287e79bee1ba035b9.Gravatar cushon2017-06-26
| | | | | | | | | *** Reason for rollback *** The depot is fixed RELNOTES: None. PiperOrigin-RevId: 160115070
* BlazeCommandDispatcher: all options parsing and editing in one placeGravatar ulfjack2017-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The invocation policy must be the last step in determining the active options for the current command. Take precautions to prevent accidental options editing of options after the policy is applied by declaring the options as an OptionsProvider (interface has no mutating methods); technically, this could be circumvented by casting to OptionsParser, but it's at least safer than before. As part of this, I'm moving the BlazeCommand.editOptions call to before the invocation policy, and also making minor changes to the CommandEnvironment. Commands that expect to have the last word on options could therefore see options changes after this commit. There are three commands that override editOptions: 1. TestCommand Current behavior: if test_output=streamed is set, also sets --test_sharding_strategy=disabled and --test_strategy=exclusive. Overriding --test_sharding_strategy is not a concern; in fact, maybe we shouldn't be setting that in the first place, since it can cause tests to timeout (timeout is usually applied per shard, so a 10-way sharded test will very likely timeout). If you override the test_strategy to local or standalone, then you may get interleaved stdout / stderr output from tests that run in parallel - a bit surprising, but no showstopper. If you override the test_strategy to remote, you won't get streamed output, because no remote strategy currently supports that. You may get interleaved output, if multiple tests finish very close to each other. There are no correctness concerns, it's just a slightly worse user experience. The code is safe in all cases, AFAICT. We could consider changing streamed to not require serialized execution, and instead use something like a lock - the first test to produce output gets streamed, and all others get delayed until the lock is released, but could still execute concurrently. However, it's unlikely that that's the desired behavior for most users. 2. CoverageCommand Current behavior: sets --collect_code_coverage, increases default --test_timeout. bazel coverage --nocollect_code_coverage is effectively bazel test. You can actually now run bazel test --collect_code_coverage --test_timeout and it will behave exactly the same way as bazel coverage. It's mostly a convenience thing. Note that CoverageCommand inherits TestCommand, so the case above also applies. 3. MobileInstallCommand Current behavior: sets --aspects, and --output_groups. If you override the aspect or output_groups, then the command will fail or run an old binary from a previous build. Not what you'd expect, but no correctness concerns. Summary: IMO, the impact on the existing commands is minor. The advantage of this change is that it's more secure, and gives us an escape hatch if a command ever overrides options in a way that turns out to be wrong or broken in some way. RELNOTES: None. PiperOrigin-RevId: 160114902
* Move command.log writing to a moduleGravatar ulfjack2017-06-26
| | | | | | | This is part of refactoring / simplifying the BlazeCommandDispatcher. RELNOTES: None. PiperOrigin-RevId: 160110866
* Add apple_stub_binary rule.Gravatar allevato2017-06-26
| | | | | | | | This rule will be used by the Skylark bundling rules for product types that use stub binaries copied out of the SDK instead of user-built binaries. RELNOTES: None. PiperOrigin-RevId: 159998782
* Fix NullPointerException when enable_data_binding is omitted.Gravatar gregce2017-06-26
| | | | | | | | | DataBinding.isEnabled has outdated logic that enabled data binding for a rule even if only its deps use data binding. It's now required for all rules up the dependency chain to explictily enable data binding. RELNOTES: None. PiperOrigin-RevId: 159998478
* Remove last traces of experimental_obj_libraryGravatar cparsons2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 159990790
* BEP: Support longer streams on non building commandsGravatar Klaus Aehlig2017-06-26
| | | | | | | | | | | | | While the build event protocol is mainly targeted for commands that actually build, a minimal stream is generated for all commands. For commands like "query", it is desirable that the stream contains the full output of the command. To achieve this, introduce an optional second event indicating the end of the stream; note that the NoBuildEvent has to come before the payload answer as the experimental UI uses this event to determine the transition to the payload answer that is passed through unchanged. RELNOTES: None. PiperOrigin-RevId: 159977543
* Update --incompatible_* error messagesGravatar brandjon2017-06-26
| | | | | RELNOTES: None PiperOrigin-RevId: 159954456
* Forbid 'in' operator on depset with --incompatible_depset_is_not_iterableGravatar laurentlb2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 159948522
* Forbid duplicate keys in dictionary literalsGravatar laurentlb2017-06-26
| | | | | | | RELNOTES: When using the dictionary literal syntax, it is now an error to have duplicated keys (e.g. {'ab': 3, 'ab': 5}). PiperOrigin-RevId: 159945431
* Make len(depset()) fail when --incompatible_depset_is_not_iterable is setGravatar laurentlb2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 159945244
* Remove last implicit dep on //tools/objc:xcodegenGravatar schmitt2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 159837451
* Refactor ProjectFileSupport to work without a CommandEnvironmentGravatar ulfjack2017-06-26
| | | | | | | | | | | | Reading project files happens very early in the command initialization, and my plan is to change it so CommandEnvironment is created after we did that; the reason for that is that it makes the options final upon CommandEnvironment creation, which in turn allows simplifying the BlazeModule API. Since we no longer need a CommandEnvironment, or a BlazeWorkspace, or a BlazeRuntime, make the ProjectFileSupportTest a unit test. PiperOrigin-RevId: 159830404
* Expose the correct JavaSkylarkApiProvider from JavaProtoAspect.Gravatar tomlu2017-06-26
| | | | | | To unblock, regression tests for the breakage will come in a follow-up CL. PiperOrigin-RevId: 159829368
* Do not use link_dynamic_library.sh when toolchain doesn't support interface ↵Gravatar hlopko2017-06-26
| | | | | | | | | | | | | | | libraries Before, Bazel would always use link_dynamic_library.sh, even though the toolchain doesn't support interface libraries and therefore its arguments would always be "no ignored ignored ignored". And since link_dynamic_library.sh is a shell script, it unnecessarily complicates the Windows toolchain. This cl also removes the script as a dependency of the toolchain (so it won't be set as an input of c++ actions). RELNOTES: None. PiperOrigin-RevId: 159827038
* Make FakeCppCompileAction.LOG lowercaseGravatar hlopko2017-06-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 159811352
* Make Metadata fields privateGravatar ulfjack2017-06-22
| | | | | | | | | | | | | Adjust the interface of Metadata to match the interface of FileArtifactValue. These classes are almost the same, but not quite, so we currently have to create and return new objects whenever the MetadataHandler is called; by making the interfaces identical, we can just return a FileArtifactValue instead (in a future change). This is in preparation for merging the ActionInputFileCache and MetadataHandler interfaces. PiperOrigin-RevId: 159802834
* Fix LIPO to ThinLTO mapping to work with AutoFDO.Gravatar Googler2017-06-22
| | | | | | | | LIPO to ThinLTO mapping was added in https://github.com/bazelbuild/bazel/commit/c61f86f56b86e442369725ad79299ccc5519b000. This fixes a bug to ignore lipo context when compiler is LLVM. RELNOTES:None PiperOrigin-RevId: 159776286
* Use targets' labels' package identifier for query output=packageGravatar mschaller2017-06-22
| | | | | | | | | | Subinclude targets' packages are the package containing the load statement. Subinclude targets' labels are the bzl files they refer to. The latter has the appropriate package to display for --output=package. Fixes #3122. PiperOrigin-RevId: 159750840
* Fix source jars no longer being exposed to Skylark from java_library.Gravatar tomlu2017-06-22
| | | | | | | | | | Regression test added for java_library. Unfortunately, due to the nature of the skylark provider, similar regression tests should probably be added to every Java providing rule. In the long term, the better solution is to expose JavaProvider directly and remove JavaSkylarkApiProvider. Fixes #3238 PiperOrigin-RevId: 159748655
* In the Blaze Query implementation, use Set and Map implementations backed by ↵Gravatar nharmata2017-06-22
| | | | | | | the same KeyExtractor used that the Uniquifier implementation uses. This fixes a hypothetical issue where we were previously relying on Target#equals/hashCode. RELNOTES: None PiperOrigin-RevId: 159741545
* Add back --sysroot argument for objc compile actions when grte_top is specified.Gravatar rduan2017-06-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 159740106