commit | 3dc59e400a9e0a57f34aa990ec410a1b2af760d3 | [log] [tgz] |
---|---|---|
author | iirina <elenairina@google.com> | Fri May 31 06:44:21 2019 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Fri May 31 06:45:16 2019 -0700 |
tree | 5453bb1236f0591d90b60a277cc4e9802fdf9e0e | |
parent | f34458b65f6ac8605f29f8773e43c545578b1f91 [diff] |
Fix jacoco-toolchain dependency. Bazel 0.26 added the `jacocorunner` attribute on `java_toolchain`. Java targets now fail when using the new host java_toolchain because of a dependency cycle: ``` @bazel_tools//tools/jdk:JacocoCoverageRunner @bazel_tools//tools/jdk:current_java_toolchain @bazel_tools//tools/jdk:legacy_current_java_toolchain @bazel_tools//tools/jdk:remote_toolchain @remote_java_tools_linux//:toolchain .-> @remote_java_tools_linux//:jacoco_coverage_runner (host) | @bazel_tools//tools/jdk:current_java_toolchain (host) | @bazel_tools//tools/jdk:legacy_current_java_toolchain (host) | @bazel_tools//tools/jdk:remote_toolchain (host) | @remote_java_tools_linux//:toolchain (host) `-- @remote_java_tools_linux//:jacoco_coverage_runner (host) ``` The dependency is happening because `jacocorunner` in `java_toolchain` was declared as a `java_import` which depends on the host `java_toolchain`. The issue was not caught because we only run the java integration tests with `--java_toolchain` built at head. If we had run the tests also with `--host_java_toolchain` the issue would have been caught (see #8530). This PR does the following: * Makes `jacocorunner` attribute a `filegroup` instead of a `java_import` to avoid the dependency cycle. * Converts the type of `jacocoRunner` in `JavaToolchain` from a `TransitiveInfoCollection` to `FilesToRunProvider` to be able to retrieve the executable jar from the `filegroup`. * Adds testing with `--host_java_toolchain` of the java_tools built as head This is a blocker for the new java_tools release (https://github.com/bazelbuild/java_tools/issues/8). Closes #8529. PiperOrigin-RevId: 250876908
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel only rebuilds what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md
Bazel is released in ‘Beta’. See the product roadmap to learn about the path toward a stable 1.0 release.