-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Description of the problem / feature request:
Two parts to this issue:
First, I ran into an exception during Java header compilation. Turbine does an unsafe cast here, which caused an annotation processor to fail during header compilation. This seems like a straightforward bug -- I'm not sure if there's a better place to report it since the turbine
repo does not allow issues.
Second, and more bazel-specific, I only ran into this issue upon upgrading to JDK 15. I followed the process outlined here to use the JDK 15 release of the remote tools. For some reason, this failure only happens with that toolchain, not with Java 8 or 11. Is there something different about the turbine jar it uses or how it invokes it? I could not figure out the difference.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Full reproducer here: https://github.com/jfancher/bazel-issues/tree/turbine-elements
The basic setup is:
- Have an annotation processor (and
java_plugin
)P
that calls the offending method (note: withgenerates_api
flag) - Have a lib
A
that usesP
- Have a lib
B
that referencesA
- Build
B
What operating system are you running Bazel on?
macOS
What's the output of bazel info release
?
release 3.7.0
Have you found anything relevant by searching the web?
Nope.
Any other information, logs, or outputs that you want to share?
Full build log:
$ bazel build --config=jdk15 //:C2
INFO: Build options --host_java_toolchain, --host_javabase, --java_toolchain, and 1 more have changed, discarding analysis cache.
INFO: Analyzed target //:C2 (1 packages loaded, 714 targets configured).
INFO: Found 1 target...
INFO: From Compiling Java headers libAnno-hjar.jar (1 source file):
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
INFO: From Compiling Java headers libAnno-hjar.jar (1 source file):
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
INFO: From Building libC1.jar (1 source file) and running annotation processors (Proc):
warning: deprecated
ERROR: /Users/jfancher/github/jfancher/bazel-issues/BUILD.bazel:14:13: Compiling Java headers libC1-hjar.jar (1 source file) and running annotation processors (Proc) failed (Exit 1): java failed: error executing command external/jdk15_macos/bin/java -Xverify:none '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED' ... (remaining 12 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox java failed: error executing command external/jdk15_macos/bin/java -Xverify:none '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED' ... (remaining 12 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
<>: error: java.lang.ClassCastException: class com.google.turbine.processing.TurbineElement$TurbineExecutableElement cannot be cast to class com.google.turbine.processing.TurbineElement$TurbineTypeElement (com.google.turbine.processing.TurbineElement$TurbineExecutableElement and com.google.turbine.processing.TurbineElement$TurbineTypeElement are in unnamed module of loader 'app')
at com.google.turbine.processing.TurbineElements.isDeprecated(TurbineElements.java:133)
at ex.Proc.process(Proc.java:22)
at com.google.turbine.binder.Processing.process(Processing.java:181)
at com.google.turbine.binder.Binder.bind(Binder.java:102)
at com.google.turbine.main.Main.bind(Main.java:246)
at com.google.turbine.main.Main.fallback(Main.java:221)
at com.google.turbine.main.Main.compile(Main.java:165)
at com.google.turbine.main.Main.compile(Main.java:127)
at com.google.turbine.main.Main.main(Main.java:84)