Skip to content
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

JacocoRunner script: update for Bazel 5.0+ #1399

Merged
merged 2 commits into from
Jun 6, 2022

Conversation

gergelyfabian
Copy link
Contributor

@gergelyfabian gergelyfabian commented Jun 1, 2022

Description

JacocoRunner builder script needs an update for Bazel 5.0+.

Upgraded jacoco package name for Bazel 5.0+.

Upgraded jacoco from 0.8.3 to 0.8.6.

Jacoco upgrade to 0.8.6 was made in Bazel in:
bazelbuild/bazel#11674
bazelbuild/bazel@cb7c1a2

Removed options for workarounds where those have been fixed in the meantime:

Bazel's handling for branch coverage was fixed in:
bazelbuild/bazel#12696

Motivation

If you use a custom-built Jacoco version for Bazel <5.0, then when you upgrade Bazel to 5.0+ you'll need to rebuild that custom Jacoco version, otherwise your coverage executions would fail with an error similar to the following:

Cause: java.lang.ClassNotFoundException: org.jacoco.agent.rt.internal_b864216.Offline

Upgraded jacoco package name for Bazel 5.0+.

Upgraded jacoco from 0.8.3 to 0.8.6.

Jacoco upgrade to 0.8.6 was made in Bazel in:
bazelbuild/bazel#11674
bazelbuild/bazel@cb7c1a2

Removed options for workarounds where those have been fixed in the meantime:

Bazel's handling for branch coverage was fixed in:
bazelbuild/bazel#12696

Instead of changing the existing script for building Jacoco, added a new
one that can be used for Bazel 5.0.
@gergelyfabian
Copy link
Contributor Author

Added a change to have both versions of the script, pre-Bazel-5.0 and post-Bazel-5.0.

Copy link
Collaborator

@liucijus liucijus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @gergelyfabian!

…va 17

bazelbuild/bazel#15081 fixed a bug when using
coverage with Scala targets on Java 17.
Use the tag 6.0.0-pre.20220520.1 where this was fixed.
@gergelyfabian
Copy link
Contributor Author

Updated Bazel's tag to avoid an error reported in #1400.

Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simuons simuons merged commit 11f61ab into bazelbuild:master Jun 6, 2022
@gergelyfabian gergelyfabian deleted the jacoco-0.8.6 branch June 7, 2022 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants