-
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
Bazel 5.0rc1 issue with linking Java 17 records with explicit constructors from a different package #14249
Comments
|
@cushon: When you move the |
That's because header compilation actions only run on Java targets that are dependencies of other targets. The header jar is used as a compile-time optimization when compiling downstream targets, and the action isn't run if record is being built directly. |
Yeah, thanks. So “different package” is probably wrong, it should be “compile unit” or something like that. The same example works in a single package, as long as linking is involved: https://github.com/eikemeier/bazel_jdk17/tree/single-package |
Do we think this is a 5.0 release blocker? |
It's a very basic Java 17 program that cannot be compiled. OTOH lots of tools have problems with Java 17, for example Error Prone 2.9.0 (in Bazel 5.0rc1) has issues with records, fixed in 2.10.0: I don't know what level of Java 17 support is targeted. |
bazelbuild/bazel#14249 PiperOrigin-RevId: 408631525
bazelbuild/bazel#14249 PiperOrigin-RevId: 408952084
google/turbine@972d62a #14249 Partial commit for third_party/*, see #14254. Signed-off-by: Tony Aiuto <[email protected]>
This is fixed in 268bedd, but will require a java_tools release to be available |
I'll try and make a java_tools release today |
Released and merged in d703b7b |
Thanks @hvadehra! |
Description of the problem / feature request:
Bazel 5.0rc1 has an issue with linking Java 17 records with explicit constructors from a different package.
Demonstration in eikemeier/bazel_jdk17.
Feature requests: what underlying problem are you trying to solve with this feature?
Compile a Java 17 program with bazel.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Check out https://github.com/eikemeier/bazel_jdk17, run
bazelisk run //src/main/java/com/example
.What operating system are you running Bazel on?
macOS 10.15
What's the output of
bazel info release
?release 5.0.0rc1
What's the output of
git remote get-url origin ; git rev-parse main ; git rev-parse HEAD
?ssh://[email protected]/eikemeier/bazel_jdk17.git
2c85df80a77291600764d3f193437dec07a41c51
2c85df80a77291600764d3f193437dec07a41c51
Have you found anything relevant by searching the web?
Not really, if you don't count the general Java 17-discussion.
Any other information, logs, or outputs that you want to share?
See the the README.
The text was updated successfully, but these errors were encountered: