-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Header compilation doesn't work on Java 11 source code #8585
Comments
Is this related to 6ef6d87 that was added in 0.27.0rc3? Does it work with 0.27.0rc2? |
Nope, tried that, set up a minimal reproduction here: https://github.com/gmishkin/bazel_8585 |
I looked into it and discovered that Turbine always builds the compile time jars for Java 8 (JavacTurbine.java#L245) @cushon is this still the case? Is there a way to override the javacopts for Turbine or do you see any issues with overriding them? |
@cushon friendly ping :) Why does Turbine make the assumption that compile-time jars always use Java 8? |
Only because we haven't started to use Java 11 internally yet; it needs to be fixed to support 11. |
I'm seeing this problem with Bazel 1.0.1. We have Java 11 source code and it's interfering with our ability to upgrade to a recent version of Bazel. We are using the default remote Java 11 toolchain. The params file for the turbine invocation contains "-source 11" but the code appears to override that to version 8. |
Note for users having the same problem: As a workaround you can disable header compilation using the |
Any update on a timeline for this issue? Thanks. |
This is an issue with Java 14 as well. I am upgrading my codebase to use Java 14 switch expressions. I was able to get most of the way with a java_toolchain configured with I mention Dagger because Bazel has hardcoded logic for enabling Turbine when Dagger's annotation processor is being used. That code links to a Google-internal bug (b/31371210). The workaround in my case was the same as the OP's: This was a surprising issue to run into, because java_toolchain is intended to be the top-level API for working with Java versions. The fact that Java 8 is still involved in my build was unexpected. |
cc @comius since this relates to Java >= 11 support |
Java 11 source should be fully supported in turbine as of 10ffddb |
Description of the problem / feature request:
Recently started using the Bazel 0.27 release candidates to try out the default Java toolchain with our Java 11 code base, passing
--javacopt="--release 11"
tobuild
. But when something depends on one of these targets, it tries to build an hjar, and that fails with errors about language features that are newer than Java 8.Details from
--sandbox_debug
:Snippet from params:
If I delombok our code and run without annotation processing, it works. It seems like it's using the other turbine implementation.
Feature requests: what underlying problem are you trying to solve with this feature?
Will the turbine implementation that's used when you have annotation processors be updated to handle Java 11 language features, or any other workaround?
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
https://github.com/gmishkin/bazel_8585
What operating system are you running Bazel on?
macOS 10.14.5
What's the output of
bazel info release
?release 0.27.0rc3
Have you found anything relevant by searching the web?
Just that there are two different turbine implementations and one of them seems to have
-source 8
hardcoded so maybe this is on purpose.The text was updated successfully, but these errors were encountered: