aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
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
* cpp: add unit tests for MakeAbsolute()Gravatar Thiago Farina2017-06-28
| | | | | | | | | | | While fixing its TODO. Tested with the following command line: $ bazel test //src/test/cpp/... Change-Id: I62d5d0f19b7242fd2eeae7901e1e236c782ebfb5 PiperOrigin-RevId: 160270960
* 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
* Fixes #3188: Implement sandboxing for remote_worker on Linux.Gravatar Philipp Wollermann2017-06-28
| | | | | | | RELNOTES: Bazel's remote_worker backend for remote execution supports sandboxing on Linux now. Check https://github.com/bazelbuild/bazel/blob/master/src/tools/remote_worker/README.md for details. Change-Id: I918b0291472c8c7d4884850d9ca0f03674ef2f31 PiperOrigin-RevId: 160266742
* 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
* Move the docker tests in src/test/dockerGravatar dmarting2017-06-27
| | | | | | | | | | | | This is a better location and tools/cpp is packaged in embedded_tools that make the test ends-up in embedded_tools, which is requiring network access to build embedded_tools! Side-effect: have to correctly mock the bazel workspace file on a couple of tests. This is blocking on https://bazel-review.googlesource.com/c/12350/ PiperOrigin-RevId: 160265524
* Bazel, python tests: add more context to failuresGravatar Laszlo Csomor2017-06-27
| | | | | | | | | | The Python integration tests will now print the stderr if the inner Bazel failed. This should help diagnosing test failures on CI. Change-Id: I138c1a6327cc263ba6a6e2c720c39ec5d4858d87 PiperOrigin-RevId: 160265298
* 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
* Minor Bash improvementsGravatar Androbin2017-06-27
| | | | | | | | | | | | | | | | | Based on output of static analysis tool. https://github.com/koalaman/shellcheck/wiki/SC2166 https://github.com/koalaman/shellcheck/wiki/SC2207 https://github.com/koalaman/shellcheck/wiki/SC2145 https://github.com/koalaman/shellcheck/wiki/SC2001 https://github.com/koalaman/shellcheck/wiki/SC2129 https://github.com/koalaman/shellcheck/wiki/SC2128 https://github.com/koalaman/shellcheck/wiki/SC2004 https://github.com/koalaman/shellcheck/wiki/SC2048 Closes #3162. PiperOrigin-RevId: 160261247
* use procstat_getpathname to get self pathGravatar Jov2017-06-27
| | | | | | | | Use procstat_getpathname instead of /proc/curproc/file to get self path, as /proc do not always exists, and need root privilege to mount. procstat_getpathname is preferred on FreeBSD. Closes #3179. PiperOrigin-RevId: 160260464
* 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
* give the duration of test in the fallback xml fileGravatar Benjamin Peterson2017-06-27
| | | | | | | | | A common extension to junitxml is to provide the duration of each test case in seconds. Here, we add the duration to the xml file that test-setup.sh provides if the test driver doesn't generate one. Change-Id: I25f94f10bb99db7078919f3e0bcdf7bd3cbb637d PiperOrigin-RevId: 160252993
* Don't set the +x bit by default on WriteFile().Gravatar lberki2017-06-27
| | | | | | | This change is a spiritual successor of https://bazel-review.googlesource.com/c/7410/ . That one had a merge conflict and it was small enough that a rewrite was easier than updating it. RELNOTES: None. PiperOrigin-RevId: 160251282
* 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
* Internal changeGravatar Googler2017-06-27
| | | | PiperOrigin-RevId: 160155305
* 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
* Correct test name in bazel_server_mode_test.pyGravatar pcloudy2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 160113701
* Internal changeGravatar Googler2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 160111047
* Move command.log writing to a moduleGravatar ulfjack2017-06-26
| | | | | | | This is part of refactoring / simplifying the BlazeCommandDispatcher. RELNOTES: None. PiperOrigin-RevId: 160110866
* Update incorrect build.proto documentation for AttributeDefinition.name field.Gravatar Googler2017-06-26
| | | | | RELNOTES: None. PiperOrigin-RevId: 160013691
* 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