Gerrit build failing with 0.16.0

已查看 113 次
跳至第一个未读帖子

Hector Oswaldo Caballero

未读,
2018年8月1日 07:50:272018/8/1
收件人 bazel-discuss
Hi,

This morning after upgrading to the latest release, Gerrit no longer builds. It fails with this error:

ERROR: /home/ehecabo/.cache/bazel/_bazel_ehecabo/5a2571fe8bf93894c0fef346d4c0bc98/external/io_bazel_rules_closure/java/io/bazel/rules/closure/worker/BUILD:17:1: Building external/io_bazel_rules_closure/java/io/bazel/rules/closure/worker/libworker.jar (13 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor, ComponentProcessor) failed (Exit 1): java failed: error executing command 
  (cd /home/ehecabo/.cache/bazel/_bazel_ehecabo/5a2571fe8bf93894c0fef346d4c0bc98/execroot/gerrit && \
  exec env - \
    LC_CTYPE=en_US.UTF-8 \
  external/embedded_jdk/bin/java -XX:+UseParallelOldGC -XX:-CompactStrings '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--patch-module=java.compiler=external/bazel_tools/third_party/java/jdk/langtools/java_compiler.jar' '--patch-module=jdk.compiler=external/bazel_tools/third_party/java/jdk/langtools/jdk_compiler.jar' '--add-opens=java.base/java.nio=ALL-UNNAMED' -jar external/bazel_tools/tools/jdk/JavaBuilder_deploy.jar @bazel-out/host/bin/external/io_bazel_rules_closure/java/io/bazel/rules/closure/worker/libworker.jar-2.params)
java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/annotation/Generated
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:158)
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.NoClassDefFoundError: javax/annotation/Generated
at dagger.internal.codegen.SourceFileGenerator.<clinit>(SourceFileGenerator.java:43)
at dagger.internal.codegen.ComponentProcessor.initSteps(ComponentProcessor.java:119)
at dagger.shaded.auto.common.BasicAnnotationProcessor.init(BasicAnnotationProcessor.java:119)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:675)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:774)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:869)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2200(JavacProcessingEnvironment.java:108)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1206)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1315)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1246)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:922)
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)
... 10 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.Generated
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 23 more
Target //:gerrit failed to build
INFO: Elapsed time: 3.026s, Critical Path: 1.94s
INFO: 10 processes: 7 remote cache hit, 2 linux-sandbox, 1 worker.


Version 0.15.2 was working perfectly.

My environment: Ubuntu 16.04.5, JDK 8u181 installed


Maybe related to this commit: 


??

Thanks

Jakob Buchgraber

未读,
2018年8月1日 07:59:462018/8/1
收件人 osw...@gmail.com、bazel-discuss
Hi,

thanks for sharing. The reason for the error is that we upgraded Bazel to JDK9 and that this class
was removed from JDK9. So the error is not related to this commit but to the general switch to
JDK9.

I am sorry about the inconvenience!

Best,
Jakob

Jakob Buchgraber

Software Engineer


Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

    

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.




--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/dbf5047a-0392-495d-86de-fca81ad56ca2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hector Oswaldo Caballero

未读,
2018年8月1日 08:12:082018/8/1
收件人 bazel-discuss
Is it desirable/possible to instruct bazel to run using the installed JDK? That could be a quick workaround.

david.o...@gmail.com

未读,
2018年8月1日 08:53:442018/8/1
收件人 bazel-discuss
@Hector,

Am Mittwoch, 1. August 2018 13:50:27 UTC+2 schrieb Hector Oswaldo Caballero:
> Hi,
>
>
> This morning after upgrading to the latest release, Gerrit no longer builds. It fails with this error:
>
>
>
> ERROR: /home/ehecabo/.cache/bazel/_bazel_ehecabo/5a2571fe8bf93894c0fef346d4c0bc98/external/io_bazel_rules_closure/java/io/bazel/rules/closure/worker/BUILD:17:1: Building external/io_bazel_rules_closure/java/io/bazel/rules/closure/worker/libworker.jar (13 source files) and running annotation processors (AutoAnnotationProcessor, AutoOneOfProcessor, AutoValueProcessor, ComponentProcessor) failed (Exit 1): java failed: error executing command 
>   (cd /home/ehecabo/.cache/bazel/_bazel_ehecabo/5a2571fe8bf93894c0fef346d4c0bc98/execroot/gerrit && \
>   exec env - \
>     LC_CTYPE=en_US.UTF-8 \
>   external/embedded_jdk/bin/java -XX:+UseParallelOldGC -XX:-CompactStrings '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--patch-module=java.compiler=external/bazel_tools/third_party/java/jdk/langtools/java_compiler.jar' '--patch-module=jdk.compiler=external/bazel_tools/third_party/java/jdk/langtools/jdk_compiler.jar' '--add-opens=java.base/java.nio=ALL-UNNAMED' -jar external/bazel_tools/tools/jdk/JavaBuilder_deploy.jar @bazel-out/host/bin/external/io_bazel_rules_closure/java/io/bazel/rules/closure/worker/libworker.jar-2.params)
> java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/annotation/Generated

I've tested 0.16.0 today morning and it works here on Gerrit master.
You haven't mentioned, but I assume, that you are trying to build
stable branch, is that correct?

The reason for the breakage, as Jakob mentioned, is switch to JDK9.
The root cause is outdated Dagger version in rules_closure repository.

I bumped the Dagger version there[1] to be compatible with JDK9
and bumped the rules_closure on Gerrit master: [2], but I forgot
to also apply the same change to stable branches. So the fix should
be trivial, just cherry-pick: [2] to stable branches.

[1] https://github.com/bazelbuild/rules_closure/commit/d1c92e34f28ab9a48ee416115132a5e79fe0e9f6
[2] https://gerrit-review.googlesource.com/c/gerrit/+/187895

Hector Oswaldo Caballero

未读,
2018年8月1日 09:00:402018/8/1
收件人 bazel-discuss
Thanks @David. Indeed, I was trying to build stable branches. I'll propose the change to stable-2.14 
回复全部
回复作者
转发
0 个新帖子