-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix jacoco-toolchain dependency. #8529
Closed
Closed
Conversation
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
Not ready for review. |
@hlopko This PR is ready for review now. |
hlopko
approved these changes
May 31, 2019
irengrig
pushed a commit
to irengrig/bazel
that referenced
this pull request
Jun 18, 2019
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 bazelbuild#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 bazelbuild#8529. PiperOrigin-RevId: 250876908
irengrig
pushed a commit
to irengrig/bazel
that referenced
this pull request
Jul 15, 2019
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 bazelbuild#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 bazelbuild#8529. PiperOrigin-RevId: 250876908
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bazel 0.26 added the
jacocorunner
attribute onjava_toolchain
. Java targets now fail when using the new host java_toolchain because of a dependency cycle:The dependency is happening because
jacocorunner
injava_toolchain
was declared as ajava_import
which depends on the hostjava_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:
jacocorunner
attribute afilegroup
instead of ajava_import
to avoid the dependency cycle.jacocoRunner
inJavaToolchain
from aTransitiveInfoCollection
toFilesToRunProvider
to be able to retrieve the executable jar from thefilegroup
.--host_java_toolchain
of the java_tools built as headThis is a blocker for the new java_tools release (bazelbuild/java_tools#8).