-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 (bazelbuild/java_tools#8). Closes #8529. PiperOrigin-RevId: 250876908
- Loading branch information
1 parent
f34458b
commit 3dc59e4
Showing
7 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters