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

JacocoCoverage deploy jar is broken #2663

Closed
ulfjack opened this issue Mar 10, 2017 · 2 comments
Closed

JacocoCoverage deploy jar is broken #2663

ulfjack opened this issue Mar 10, 2017 · 2 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug

Comments

@ulfjack
Copy link
Contributor

ulfjack commented Mar 10, 2017

Exception in thread "Thread-0" java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
com/google/testing/coverage/BranchDetailAnalyzer.mapProbes(Lorg/objectweb/asm/ClassReader;)Ljava/util/Map; @21: invokevirtual
Reason:
Type 'org/jacoco/core/internal/flow/ClassProbesAdapter' (current frame, stack[1]) is not assignable to 'org/objectweb/asm/ClassVisitor'
Current Frame:
bci: @21
flags: { }
locals: { 'com/google/testing/coverage/BranchDetailAnalyzer', 'org/objectweb/asm/ClassReader', 'com/google/testing/coverage/ClassProbesMapper', 'org/jacoco/core/internal/flow/ClassProbesAdapter' }
stack: { 'org/objectweb/asm/ClassReader', 'org/jacoco/core/internal/flow/ClassProbesAdapter', integer }
Bytecode:
0x0000000: bb00 2459 b700 254d bb00 2659 2c03 b700
0x0000010: 274e 2b2d 03b6 0028 2cb6 0029 b0

at com.google.testing.coverage.JacocoCoverageRunner.analyzeBranch(JacocoCoverageRunner.java:138)
at com.google.testing.coverage.JacocoCoverageRunner.create(JacocoCoverageRunner.java:84)
at com.google.testing.coverage.JacocoCoverageRunner$2.run(JacocoCoverageRunner.java:258)
@ulfjack
Copy link
Contributor Author

ulfjack commented Mar 10, 2017

It looks like the jarjar rewrite is breaking the deploy jar. This patch fixes the issue:

diff --git a/src/java_tools/junitrunner/java/com/google/testing/coverage/BUILD b/src/java_tools/junitrunner/java/com/google/testing/coverage/BUILD
index c43814b83..afd704835 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/coverage/BUILD
+++ b/src/java_tools/junitrunner/java/com/google/testing/coverage/BUILD
@@ -102,11 +102,7 @@ genrule(
         # runfiles trees. The Java launcher script looks in the runfiles tree
         # for the jars (and rightfully so), thus, invoking the binary directly
         # won't work.
-        "if [[ $$(uname -a) =~ MSYS ]] || [[ $$(uname -a) =~ freebsd ]]; then",
-        "  cp \"$(location :JacocoCoverage_deploy.jar)\" \"$@\";",
-        "else",
-        "  \"$(JAVA)\" -jar \"$(location //third_party/java/jarjar:jarjar_bin_deploy.jar)\" process \"$(location :JacocoCoverage.jarjar)\" \"$(location :JacocoCoverage_deploy.jar)\" \"$@\"",
-        "fi",
+        "cp \"$(location :JacocoCoverage_deploy.jar)\" \"$@\"",
     ]),
     tools = [
         "//third_party/java/jarjar:jarjar_bin_deploy.jar",

@lberki
Copy link
Contributor

lberki commented Apr 19, 2017

#2820 is a duplicate of this (and was fixed in 3a5d3db)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants