aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
Commit message (Collapse)AuthorAge
* Use java.time.Duration for timeoutsGravatar ulfjack2017-08-09
| | | | PiperOrigin-RevId: 164577062
* Change logic of Blaze Java coverage.Gravatar elenairina2017-08-08
| | | | | | | | | | | | | | | | | | Change is needed due to the fact that java_import or other custom rules (genrules or Skylark) do not propagate coverage information. The lack of coverage data is caused by the fact that it is retrieved from compilation information and it is passed around through providers as Artifact(s) (also known as instrumentation metadata). The problem with the current implementation is that there is no way of retrieving instrumentation metadata from arbitrary jars provided by java_import or other custom rules. The instrumentation metadata in the current implementation is a separate jar that contains uninstrumented classes for offline Jacoco instrumentation. This change addresses that problem by having just one jar instead of 2 (the build jar and the instrumentation jar), adding the uninstrumented classes in the build jar and completely removing any other instrumentation metadata. Implementation details: * For each build jar there is a .txt file created that contains the relative path of each Java file. This file will also be included in the final build jar. It is used for recreating the correct path for each covered file when included in the coverage report. * java_binary/java_test will set 2 environment variables: 1) JACOCO_METADATA_JARS - replaces the previous JACOCO_METADATA_JAR that was a jar that merged all the uninstrumented classes on the classpath in one jar. The new environment variable holds the paths of the runtime classpath jars - only some of them contain uninstrumented classes, letting the Jacoco coverage runner to filter and analyze them. 2) JACOCO_MAIN_CLASS - The main class to be called for the current coverage run. Previously this information was embedded in the JACOCO_METADATA_JAR's manifest. PiperOrigin-RevId: 164562533
* Use Sets.new...WithExpectedSize to presize some collectionsGravatar michajlo2017-08-08
| | | | | | | | | | It was noticed that we missed this in commments on https://github.com/bazelbuild/bazel/commit/2266a6f88030e7121031db19fb5efc3fc7cb149c. This a better job of preventing resizes than the former, with the caveat that it may create a larger collection than is necessary. PiperOrigin-RevId: 164520695
* Micro-optimization - presize internal Selector mapGravatar michajlo2017-08-08
| | | | | | No reason not to. PiperOrigin-RevId: 164502264
* Rollforward of "Framework dependency subtraction uses runfiles path instead ↵Gravatar cparsons2017-08-08
| | | | | | | of full artifact path" RELNOTES: None. PiperOrigin-RevId: 164496520
* Improve SyntaxTreeVisitor API.Gravatar laurentlb2017-08-08
| | | | | RELNOTES: None. PiperOrigin-RevId: 164481927
* Clean up Label validation, and introduce a factory method for constructing a ↵Gravatar nharmata2017-08-08
| | | | | | | Label without validation. RELNOTES: None PiperOrigin-RevId: 164479651
* Use Iterators.unmodifiableIterator() for readabilityGravatar brandjon2017-08-08
| | | | | RELNOTES: None PiperOrigin-RevId: 164457611
* Move MakeVariableProvider to lib.analysisGravatar ulfjack2017-08-08
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164456961
* Slight refactor to AttributeValuesMap to permit multiple different efficient ↵Gravatar nharmata2017-08-08
| | | | | | | implementations. RELNOTES: None PiperOrigin-RevId: 164456778
* Only add coverage flags when gcno file is expectedGravatar hlopko2017-08-08
| | | | | | | | | Change https://github.com/bazelbuild/bazel/commit/63dabb6cfd55febc14e221ec51b18120558bc23c refactored the coverage feature, but wrongly started add coverage flags when the gcno file was not expected/read by bazel. This can be harmful, since the size of inputs increases unnecessarily. RELNOTES: None. PiperOrigin-RevId: 164455431
* Do not expand inputs in CppLinkAction.execute().Gravatar Benjamin Peterson2017-08-07
| | | | | | | | All spawn strategies must expand artifacts, so actions shouldn't themselves. Change-Id: I051f7a6fee31330893271fbec7b93197bd4292f3 PiperOrigin-RevId: 164449128
* Move RuleConfiguredTargetFactory to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164446955
* Move AliasProvider to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164438390
* bes,remote: update default auth scope.Gravatar buchgr2017-08-07
| | | | PiperOrigin-RevId: 164436416
* Add tuple * int multiplication operatorGravatar brandjon2017-08-07
| | | | | | | I.e., ('a', 'b') * 3 == ('a', 'b', 'a', 'b', 'a', 'b'), like lists. RELNOTES: None PiperOrigin-RevId: 164403099
* Fix mutability bug in SkylarkList/SkylarkMap Java APIsGravatar brandjon2017-08-07
| | | | | | | | | Previously, you could modify a frozen MutableList indirectly via its iterator(). This CL wraps the underlying list with a Collections.unmodifiableList when obtaining the iterator, and likewise for other methods that return views over Skylark data structures. This also eliminates the SkylarkList#getContents method in favor of just using the SkylarkList object itself. RELNOTES: None PiperOrigin-RevId: 164402129
* Turn off C++ provider propagation from java_proto_library, until ↵Gravatar carmi2017-08-07
| | | | | | | J2ObjcAspect ignores them. RELNOTES: None PiperOrigin-RevId: 164335492
* Introduce AbstractParallelEvaluatorGravatar mschaller2017-08-07
| | | | | | | | | | This change enables alternate evaluation strategies. Drive-by fix to GraphTester, making TestFunction static because it has no dependencies on its outer class, and adding #unsetConstantValue. RELNOTES: None. PiperOrigin-RevId: 164327055
* Automated rollback of commit 496d3ded0bce12b7371a93e1183ba30e6aa88032.Gravatar buchgr2017-08-07
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll-forward. unknown commit fixed the internal protoc to also accept full paths, just as the external one does. Fixes #2265 *** Original change description *** Automated rollback of commit bcd23553f38f54fd4846aa507c827a4ee40cfab4. *** Reason for rollback *** RELNOTES: None PiperOrigin-RevId: 164324424
* Make selector list construction n^2 -> n efficient.Gravatar gregce2017-08-07
| | | | | | | | | | | | | | | On the subject of simpler toString output (i.e. "selector" vs. "selector({dictionary contents here})", I'm not changing that here because there are consistency concerns. BuildType.SelectorList.toString is defined to match lib.syntax.SelectorList's Skylark serialization. That follows a standard pattern defined here: https://github.com/bazelbuild/bazel/blob/67bd6fc6354f2abbbc149fcd0120228b538842d3/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkValue.java#L37 which has concerns about deserialization. If you want to take this further we can discuss with the Skylark devs. PiperOrigin-RevId: 164311511
* Adding further error messages for cases where invalid labels are used with ↵Gravatar John Cater2017-08-07
| | | | | | | | | register_toolchains. Fixes #3429. Change-Id: Iae5632c4b866994a849032bbc2757a6a5151cc6a PiperOrigin-RevId: 164304020
* Make Bazel enforce requirement on build-tools 26.0.1 or later.Gravatar ajmichael2017-08-07
| | | | | | | | Fixes #3469 Fixes #3258 RELNOTES: Bazel Android support now requires build-tools 26.0.1 or later. PiperOrigin-RevId: 164301571
* Bypass unnecessary ArrayLists in SkylarkNestedSet constructorGravatar michajlo2017-08-07
| | | | | | | No need for the intermediate collection/objects when we can go direct to ImmutableList, which has a good chance of doing something more efficient anyway... PiperOrigin-RevId: 164295659
* Minor optimization to function arg parsingGravatar michajlo2017-08-07
| | | | | | | No need for the intermediate collection/objects when we can go direct to ImmutableList, which has a good chance of doing something more efficient anyway... PiperOrigin-RevId: 164294883
* fix for bazel 303 redirect bug: https://github.com/bazelbuild/bazel/issues/3343Gravatar Googler2017-08-07
| | | | | | | manually turn off HTTP internal reconnection so HTTP can utilize MAX_REDIRECTS, etc. RELNOTES: None. PiperOrigin-RevId: 164294282
* Add keywords to BES PublishBuildToolEventStreamRequest.Gravatar Googler2017-08-07
| | | | | | | | | | | | | Notification keywords published BES include:command_name and protocol_name. These keywords can be used by subscribers to filter BES streams of interest. This change also cleans up use of deprecated fields in in PublishBuildToolEventStreamRequest. RELEASE_NOTES: None. Change-Id: I331fc9a818728ad6986230ebdea7d4019e8e49fc PiperOrigin-RevId: 164285745
* Required toolchains set on rule classes are inherited.Gravatar cpeyser2017-08-07
| | | | PiperOrigin-RevId: 164281027
* Add a little more context to an error message for when a rule returns the ↵Gravatar Googler2017-08-07
| | | | | | | wrong thing RELNOTES: None. PiperOrigin-RevId: 164280579
* Micro-optimization for TransitiveBaseTraversalFunctionGravatar michajlo2017-08-07
| | | | | | No need to create 2-3 collections when we only need one. PiperOrigin-RevId: 164273126
* Move most test options from BuildConfiguration to TestConfiguration.Gravatar tomlu2017-08-07
| | | | | | --test_env isn't moved in this CL since it's exposed to Skylark via BuildConfiguration, making it a somewhat riskier refactor. PiperOrigin-RevId: 164266168
* Aspects that apply to files cannot apply to source files.Gravatar dslomov2017-08-07
| | | | | | | Make them not crash. RELNOTES: None. PiperOrigin-RevId: 164265379
* Do not expand nested sets in the analysis phase in CustomCommandLine.Gravatar tomlu2017-08-04
| | | | PiperOrigin-RevId: 164262702
* Cleanup SkylarkListGravatar brandjon2017-08-04
| | | | | | | | | | | | | | | - Made abstract collection classes in SkylarkMutable more systematic. Added javadoc. Added a BaseMutableList class to factor out List stubs from SkylarkList. Alphabetized the methods to make it easier to verify that all overrides are covered. - Simplified MutableList constructors. Added MutableList#copyOf factory, and deprecated public access to the existing constructor to be more in line with Guava collections. Made Tuple#create private. - Made mutation methods for MutableList take in mutabilities rather than environments. For symmetry with the other mutators, pushed SkylarkList#set down to MutableList and moved the evaluation of its index to the caller. - Made SkylarkList#getSlice an abstract method that's implemented symmetrically in Tuple and MutableList -- instead of the bizarre thing it was doing before, where its return type was a List that sometimes got passed through SkylarkType.convertToSkylark in the caller. - Removed final modifier on methods where it wasn't obviously appropriate. Removed redundant super() calls. Renamed type variables to always be one letter, and to not reuse the instance's own type variable name from within static methods. RELNOTES: None PiperOrigin-RevId: 164257778
* Refactor BuildRequest out of sandboxed spawn runner initialization.Gravatar Benjamin Peterson2017-08-04
| | | | | | | | | | | | | Remove BuildRequest as parameter to sandboxed spawn runner constructors. Previously, the build request was used to obtain some options, but those can be extricated from a CommandEnvironment, which is passed in, too. Also, remove LinuxSandboxedSpawnRunner's aliased sandboxOptions member variable. It can just use the superclass's. Change-Id: I1ef1a45cbf7e800d0809f05673f097a148289740 PiperOrigin-RevId: 164257471
* Make sure copts is the last feature in osx crosstoolsGravatar hlopko2017-08-04
| | | | | | | | | | | | | Change https://github.com/bazelbuild/bazel/commit/646cfd81793fc3b87979089aab873310d14e95e6 moved copts to the build variable and in order to keep the ordering of the flags as before the copts feature needs to be the last feature in the toolchain. Osx crosstool generator sometimes appended additional features, that broke this assumption. This cl makes sure copts is the last feature. In addition, flags directly from action_config will be added first, not last as they were before. RELNOTES: Flags from action_config get added first to the command line first, before the flags from features. PiperOrigin-RevId: 164257469
* grpc: Consolidate gRPC code from BES and Remote Execution. Fixes #3460, #3486Gravatar buchgr2017-08-04
| | | | | | | | | | | BES and Remote Execution have separate implementations of gRPC channel creation, authentication and TLS. We should merge them, to avoid duplication and bugs. One such bug is #3640, where the BES code had a different implementation for Google Application Default Credentials. RELNOTES: The Build Event Service (BES) client now properly supports Google Applicaton Default Credentials. PiperOrigin-RevId: 164253879
* Android BusyBox: deprecate --libraries flagGravatar laszlocsomor2017-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate the --libraries flag of the GENERATE_BINARY_R tool in favour of --library. The new flag is multi-value and uses "," as the pair-separator instead of ":". The value converter still supports ":"-separated pairs as well, but looks for "," first. Old format: --libraries=key1:value1,key2:value2,... New format: --library=key1,value1 --library=key2,value2 Motivation: - the ":"-separator prevents using absolute paths on Windows The old flag is still supported, but will be removed after 2018-02-28 (about 6 months from now). Also in this commit: - add a new method to CustomCommandLine.Builder to lazily construct the command line for the --library flag See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 164246506
* Add no_stripping feature to MSVC CROSSTOOLGravatar Yun Peng2017-08-04
| | | | | | | | | | | | If no_stripping feature is enabled, then strip action config is not necessary, building stripped binary will just copy the orignial binary. Fix https://github.com/bazelbuild/bazel/issues/3482 Also fixed CI breakage: https://github.com/bazelbuild/bazel/issues/3505 Change-Id: Ie78fe174c42248c9b3e930008eef96dcd1864741 PiperOrigin-RevId: 164237588
* Add --windows_exe_launcher optionGravatar Yun Peng2017-08-04
| | | | | | | | | | | | | If this is enabled, Bazel will build a Windows native exe binary launcher for sh_binary, in the future this flag will also apply to py_binary and java_binary. By default, it's turned ON, set --windows_exe_launcher=0 to turn it off. Fix https://github.com/bazelbuild/bazel/issues/3491 Change-Id: Ic55bff745670446e585e3cc62af9dc6561527d4f PiperOrigin-RevId: 164234552
* Use @CompileTimeConstant on SpawnAction.Builder#setProgressMessage.Gravatar tomlu2017-08-04
| | | | | | | | | Add SpawnAction.Builder#setProgressMessageNonLazy for dynamic strings. This should help guide users to the right method. This also helped find a few methods I'd missed previously that could use a constant-string version. RELNOTES: None PiperOrigin-RevId: 164150264
* Make MutableList#EMPTY privateGravatar brandjon2017-08-04
| | | | | RELNOTES: None PiperOrigin-RevId: 164131012
* Automated rollback of commit 0abf5fa2d64c76def5a8fa0f960b73ce0566af4d.Gravatar laszlocsomor2017-08-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks Bazel CI (https://github.com/bazelbuild/bazel/issues/3501) *** Original change description *** Android BusyBox: actions use the default shell env SpawnActions that run the Android BusyBox now use the default shell environment. This has the following benefits: - Bazel propagates the PATH, TMPDIR envvars to the action - Bazel propagates the --action_env envvars to the action This allows the Bazel client to pass --action_env=TMP or --action_env=TEMP (whichever of the envvars is defined) to the server, so the BusyBox actions will have TMP/TEMP set... *** PiperOrigin-RevId: 164126020
* Use the rule location when a handler isn't foundGravatar kchodorow2017-08-03
| | | | | | | | | | | | I think this code predates being able to load Skylark .bzl files from the WORKSPACE. As most non-trivial projects are using load() in the WORKSPACE, it's fairly uninformative to say "it was defined in the WORKSPACE file" for this error. This is to help debug the Tensorflow issue (#3478) but should generally be more useful than the current message. PiperOrigin-RevId: 164118176
* Android BusyBox: actions use the default shell envGravatar Laszlo Csomor2017-08-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SpawnActions that run the Android BusyBox now use the default shell environment. This has the following benefits: - Bazel propagates the PATH, TMPDIR envvars to the action - Bazel propagates the --action_env envvars to the action This allows the Bazel client to pass --action_env=TMP or --action_env=TEMP (whichever of the envvars is defined) to the server, so the BusyBox actions will have TMP/TEMP set (to the same value as the clientenv), so they can create temp directories using java.nio.file.Files.createTempDirectory. This method seems to be calling the GetTempPath WinAPI function, which needs the TMP or TEMP envvar, otherwise it falls back to returning c:\windows which is non-writable. There's one drawback of using the default shell environment, although @ulfjack is working on it: - PATH is now also part of the action's cache key. However in a single-machine environment (no remote execution) and assuming PATH isn't likely to change between builds, this probably doesn't poision the action cache in practice. This change is a short-term solution. Propagating the client env's TMP/TEMP means we make that part of the action's cache key. The ideal long-term solution will be to not propagate this envvar, and instead let the execution strategy set it to some client-env-independent value. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: I756a4203b5d86c881bc36cc089e35cde0d419914 PiperOrigin-RevId: 164114502
* Update doc of ctx.coverage_instrumented.Gravatar elenairina2017-08-03
| | | | | | Fixes #3434 PiperOrigin-RevId: 164113116
* Use feature configuration to construct command line for 'strip' actionGravatar hlopko2017-08-03
| | | | | | | | | | This cl introduces new action_config named 'strip' for the strip action. While at it, it fixes support for executionRequirements. Fixed #209 RELNOTES: 'strip' action is now configured via feature configuration PiperOrigin-RevId: 164110478
* Documentation fix for 'str' and 'repr' functions.Gravatar laurentlb2017-08-03
| | | | | RELNOTES: None. PiperOrigin-RevId: 164102319
* Use getExecPathString when getting bash_main_fileGravatar pcloudy2017-08-03
| | | | | | | Fix https://github.com/bazelbuild/bazel/issues/3491 RELNOTES: None PiperOrigin-RevId: 164089270
* Compute progress message lazily in spawn action.Gravatar tomlu2017-08-03
| | | | | | | | | | Consumers using spawn action builder now have access to handy overloads that behind the scene do a lazy String.format. In 95% of cases progress messages are expressible as 0, 1, or 2 argument String.formats. This saves memory because the format string is constant and shared between all actions, and the captured subjects are usually live on the heap anyway (eg. labels). Skylark still computes its progress messages eagerly. If we want similar savings there I'd have to follow up with a Skylark proposal. PiperOrigin-RevId: 164068816