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

jacoco deploy jar incorrectly built #2904

Closed
hanwen opened this issue Apr 27, 2017 · 7 comments
Closed

jacoco deploy jar incorrectly built #2904

hanwen opened this issue Apr 27, 2017 · 7 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Milestone

Comments

@hanwen
Copy link
Contributor

hanwen commented Apr 27, 2017

split off from #2528

this is still a problem with 0.4.5

$ git checkout -b coverage origin/master
Branch coverage set up to track remote branch master from origin.
Switched to a new branch 'coverage'

hanwen@hanwen:~/vc/gerrit$ bazel coverage --test_output=streamed //gerrit-common:auto_value_tests
WARNING: Streamed test output requested. All tests will be run locally, without sharding, one at a time.
INFO: Using default value for --instrumentation_filter: "//gerrit-common".
INFO: Override the above default with --instrumentation_filter
INFO: Found 1 test target...
JUnit4 Test Runner
.
Time: 0.03

OK (1 test)

BazelTestRunner exiting with a return value of 0
JVM shutdown hooks (if any) will run now.
The JVM will exit once they complete.

-- JVM shutdown starting at 2017-04-27 12:31:18 --

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/devtools/lcovmerger/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
FAIL: //gerrit-common:auto_value_tests (see /home/hanwen/.cache/bazel/_bazel_hanwen/92cfb41f49554b16e2b6f54cafbeca56/execroot/gerrit/bazel-out/local-fastbuild/testlogs/gerrit-common/auto_value_tests/test.log).
Target //gerrit-common:auto_value_tests up-to-date:
bazel-bin/gerrit-common/auto_value_tests.jar
bazel-bin/gerrit-common/auto_value_tests
INFO: Elapsed time: 2.453s, Critical Path: 0.99s
//gerrit-common:auto_value_tests FAILED in 1 out of 2 in 0.6s
/home/hanwen/.cache/bazel/_bazel_hanwen/92cfb41f49554b16e2b6f54cafbeca56/execroot/gerrit/bazel-out/local-fastbuild/testlogs/gerrit-common/auto_value_tests/test.log

Executed 1 out of 1 test: 1 fails locally.

hanwen@hanwen:~/vc/gerrit$ bazel version
Build label: 0.4.5
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Mar 16 12:19:38 2017 (1489666778)
Build timestamp: 1489666778
Build timestamp as int: 1489666778

@hanwen
Copy link
Contributor Author

hanwen commented Apr 27, 2017

sorry : dup. #2663

@hanwen hanwen closed this as completed Apr 27, 2017
@hanwen
Copy link
Contributor Author

hanwen commented May 9, 2017

I still can't run coverage on my google linux laptop.

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/devtools/lcovmerger/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)

looks like lcovmerger is run with the system JVM rather than the bazel one.

I think this is a separate issue from the problems with jarjar in #2663

@hanwen hanwen reopened this May 9, 2017
@hanwen
Copy link
Contributor Author

hanwen commented May 9, 2017

(note that my laptop comes with java 7 preinstalled in /usr/bin/)

@hanwen
Copy link
Contributor Author

hanwen commented May 10, 2017

and it works if I manually set /usr/bin/java to be java 8.

@kchodorow kchodorow added this to the 0.5 milestone May 10, 2017
@hlopko
Copy link
Member

hlopko commented May 17, 2017

@lberki @damienmg Is this really a release blocker?

@damienmg
Copy link
Contributor

Lukacs fixed several things on building jacoco we should retest with 0.5.0rc7 to assess the issue. I am not sure it should be a release blocker if there isa workaround since it is a feature that was not working correctly in previous releases.

@lberki
Copy link
Contributor

lberki commented May 24, 2017

@hanwen , you seem to be right, LcovMerger is called using whatever JVM java gets you:

https://github.com/bazelbuild/bazel/blob/master/tools/test/collect_coverage.sh#L139

Bad!

@damienmg damienmg modified the milestones: 0.6, 0.5 May 24, 2017
@damienmg damienmg added P2 We'll consider working on this in future. (Assignee optional) type: bug and removed Release blocker under investigation labels May 24, 2017
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

5 participants