JacocoCoverage_jarjar_deploy.jar's shading of Guava is incomplete, causing some user tests to fail with bazel coverage #15124
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-Java
Issues for Java rules
Description of the problem / feature request:
While upgrading our repo to Bazel 5.1 from 4.2.2, we found some Java tests that depend on Guava were now failing but only with
bazel coverage
, not withbazel test
. Test failures gave this stacktrace:When stepping through in the debugger, I noticed that
com.google.thirdparty.publicsuffix.PublicSuffixPatterns.EXACT
was being loaded from JacocoCoverage_jarjar_deploy.jar, not the Guava jar being pulled in by the code under test. It seems JacocoCoverage has shaded com.google.common using JarJar, but not com.google.thirdparty, which is also part of Guava.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Run
bazel coverage
on a JUnit test that invokescom.google.common.net.InternetDomainName.from("example.com")
What operating system are you running Bazel on?
macOS 12.3
What's the output of
bazel info release
?release 5.1.0
Any other information, logs, or outputs that you want to share?
This looks easy to fix, JacocoCoverage.jarjar just needs a rule to shade com.google.thirdparty.
The text was updated successfully, but these errors were encountered: