Repository navigation
Closed
Labels
P0This is an emergency and more important than other current work. (Assignee required)
Description
Description of the problem / feature request:
A Bazel binary built at current HEAD (3ac44db) can't successfully bazel build //src:bazel, due to an unhandled exception from error-prone. I'm able to succesfully build Bazel using the 0.15.0 branch.
Since it's complaining about an unknown class, I wonder if buildjar is missing a dependency.
ERROR: /Users/jmillikin/src/bazel/src/objc_tools/bundlemerge/BUILD:16:1: Building src/objc_tools/bundlemerge/libbundlemerge_lib.jar (1 source file) failed (Exit 1)
src/objc_tools/bundlemerge/java/com/google/devtools/build/xcode/bundlemerge/BundleMerging.java:138: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
static BundleMerging merging(Path tempDir, FileSystem fileSystem, Control control)
^
Please report this at https://github.com/google/error-prone/issues/new and include the following:
error-prone version: 2.3.1
BugPattern: CheckReturnValue
Stack Trace:
java.lang.NoClassDefFoundError: javax/annotation/CheckReturnValue
at com.google.errorprone.bugpatterns.CheckReturnValue.matchMethod(CheckReturnValue.java:142)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:889)
at com.google.errorprone.scanner.ErrorProneScanner.visitMethod(ErrorProneScanner.java:145)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:898)
at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
at jdk.compiler/com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:187)
at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:587)
at com.google.errorprone.scanner.ErrorProneScanner.visitClass(ErrorProneScanner.java:145)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808)
at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:82)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:42)
at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:113)
at jdk.compiler/com.sun.source.util.TreeScanner.visitCompilationUnit(TreeScanner.java:144)
at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:602)
at com.google.errorprone.scanner.ErrorProneScanner.visitCompilationUnit(ErrorProneScanner.java:145)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591)
at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:56)
at com.google.errorprone.scanner.Scanner.scan(Scanner.java:64)
at com.google.errorprone.scanner.ErrorProneScannerTransformer.apply(ErrorProneScannerTransformer.java:43)
at com.google.errorprone.ErrorProneAnalyzer.finished(ErrorProneAnalyzer.java:152)
at com.google.devtools.build.buildjar.javac.plugins.errorprone.ErrorPronePlugin.postFlow(ErrorPronePlugin.java:110)
at com.google.devtools.build.buildjar.javac.BlazeJavaCompiler.flow(BlazeJavaCompiler.java:112)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1363)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:959)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
at com.google.devtools.build.buildjar.javac.BlazeJavacMain.compile(BlazeJavacMain.java:110)
at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder$2.invokeJavac(SimpleJavaLibraryBuilder.java:122)
at com.google.devtools.build.buildjar.ReducedClasspathJavaLibraryBuilder.compileSources(ReducedClasspathJavaLibraryBuilder.java:54)
at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.compileJavaLibrary(SimpleJavaLibraryBuilder.java:125)
at com.google.devtools.build.buildjar.SimpleJavaLibraryBuilder.run(SimpleJavaLibraryBuilder.java:133)
at com.google.devtools.build.buildjar.BazelJavaBuilder.processRequest(BazelJavaBuilder.java:105)
at com.google.devtools.build.buildjar.BazelJavaBuilder.runPersistentWorker(BazelJavaBuilder.java:67)
at com.google.devtools.build.buildjar.BazelJavaBuilder.main(BazelJavaBuilder.java:45)
Caused by: java.lang.ClassNotFoundException: javax.annotation.CheckReturnValue
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 43 more
What operating system are you running Bazel on?
MacOS
What's the output of bazel info release?
I'm using Bazel build from Git at 3ac44db (current HEAD)
Activity
lfpino commentedon Jul 6, 2018
@cushon can you please take a look?
jmillikin-stripe commentedon Jul 6, 2018
@buchgr I think this may be caused by 4c9a0c8 ("reduce the size of bazel's embedded jdk")
cushon commentedon Jul 7, 2018
I can reproduce this on my mac, and I confirmed that it was introduced by 4c9a0c8.
cushon commentedon Jul 7, 2018
Also, I can't repro on linux. Is the reduced mac JDK supposed to be different than the linux one?
buchgr commentedon Jul 9, 2018
I am taking a look. I built the JDK containing all modules listed ./full-jdk/bin/java --list-modules on all platforms. The class
javax.annotation.CheckReturnValuedoes not appear to be part of the JDK. Also, everything seems to be working on CI. Is it possible that we don't test with embedded JDK?buchgr commentedon Jul 9, 2018
The class seems to be part of the jsr305 third party dependency and it also exists in there.
cushon commentedon Jul 9, 2018
The tests build
//src:bazelwith a previous release (e.g.0.15.0-homebrew), and then run the tests against the output of//src:bazelwithout overriding--host_javabase, so it's using the embedded JDK. Apparently there aren't any tests that build Bazel at head with itself, though.buchgr commentedon Jul 9, 2018
@cushon we have a bazel determinism test that does just that and that for reasons has been disabled on macOS. I ll enable it again on our postsubmit pipeline once my fix is in.
openjdk: update macOS openjdk image. Fixes #5532
openjdk: update macOS openjdk image. Fixes bazelbuild#5532
Release 0.16.0 (2018-07-31)
openjdk: update macOS openjdk image. Fixes bazelbuild#5532
Release 0.16.0 (2018-07-31)
Revert "openjdk: update macOS openjdk image. Fixes bazelbuild#5532"
openjdk: update macOS openjdk image. Fixes #5532
openjdk: update macOS openjdk image. Fixes bazelbuild#5532
Release 0.16.1 (2018-08-13)
openjdk: update macOS openjdk image. Fixes #5532