Skip to content

4.0 breaking change: Java coverage #12793

@alexeagle

Description

@alexeagle

I'm not sure if there is a bug, or if this is just missing documentation (and if such documentation would be in the 4.0 release)

It seems that 4.0 introduces a breaking change for bazel coverage on Java targets, where the jacocorunner must now be configured in a toolchain. The default auto-discovered toolchain does not have one set, and after some digging I have not been able to create my own.

Every attempt to make a default_java_toolchain gives me an error like this:

(16:42:43) ERROR: Misconfigured toolchains: @remote_java_tools_darwin//:toolchain is declared as a toolchain but has inappropriate dependencies. Declared toolchains should be created with the 'toolchain' rule and should not have dependencies that themselves require toolchains.
.-> RegisteredToolchains
|   @remote_java_tools_darwin//:toolchain
|   @bazel_tools//tools/jdk:proguard_whitelister
|   toolchain types @bazel_tools//tools/python:toolchain_type, @bazel_tools//tools/cpp:toolchain_type
|   toolchain type @bazel_tools//tools/cpp:toolchain_type
`-- RegisteredToolchains

Is it expected that users need to create their own java_toolchain to keep coverage working? If so, how?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions