-
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
Java --add-opens
should not be passed to javac; breaks with -Werror
#19876
Comments
Thanks for the report, I noticed this in #19850 (comment) and have a pending fix |
Lucky timing! Could you also backport the PR to 7.x and also ideally 6.x if possible? |
@bazel-io flag |
They are unnecessary at compile-time, and this avoids a warning on recent javac versions: ``` warning: [options] --add-opens has no effect at compile time ``` They are still collected and passed as runtime JVM flags. See also * #19850 (comment) * #19876 Closes: #19859 PiperOrigin-RevId: 574527220 Change-Id: Ie9bfb8162869a3479b9401945e140c09875cc05e
@timothyg-stripe We can cherry-pick this into 7.0.0, but unfortunately won't be able to cherry-pick into 6.4.0 because we're scheduled to do the final release tomorrow. But if this is critical and have to be included for 6.4.0, then let us know. Thank you! cc: @bazelbuild/triage |
@bazel-io fork 7.0.0 |
@iancha1992 that's fine, thanks for letting me know! |
@iancha1992 One more question: are future bugfix releases planned for 6.x? like 6.4.1 / 6.5.0? Or will the release of 7.0.0 mean that 6.x is no longer supported |
|
@cushon I am not sure this should be merged. I have a concern with |
@guw this PR should be a no-op, passing i.e. this is the difference between |
This is fixed by 367994a, right? |
They are unnecessary at compile-time, and this avoids a warning on recent javac versions: ``` warning: [options] --add-opens has no effect at compile time ``` They are still collected and passed as runtime JVM flags. See also * bazelbuild#19850 (comment) * bazelbuild#19876 Closes: bazelbuild#19859 PiperOrigin-RevId: 574527220 Change-Id: Ie9bfb8162869a3479b9401945e140c09875cc05e
Cherry-picked in #20016 |
They are unnecessary at compile-time, and this avoids a warning on recent javac versions: ``` warning: [options] --add-opens has no effect at compile time ``` They are still collected and passed as runtime JVM flags. See also * #19850 (comment) * #19876 Closes: #19859 Commit 367994a PiperOrigin-RevId: 574527220 Change-Id: Ie9bfb8162869a3479b9401945e140c09875cc05e Co-authored-by: Googler <[email protected]>
@bazel-io fork 6.0.0 |
@timothyg-stripe this will be included in the release-7.0.0 which is set to release its RC3 next week. We will keep you updated! Thanks :) |
@iancha1992 Would it be possible to cherry-pick into 6.x also? It will likely take us some time to upgrade to 7.0.0. I'm happy to supply a patch, considering the 7.0.0 commit earlier doesn't apply cleanly to 6.x. |
We don't have plans to create a 6.5.0 as of yet; but can consider it if more backport requests show up. |
A fix for this issue has been included in Bazel 7.0.0 RC5. Please test out the release candidate and report any issues as soon as possible. Thanks! |
@bazel-io fork 6.5.0 |
A fix for this issue has been included in Bazel 6.5.0 RC1 as well. Please test out the release candidate and report any issues as soon as possible. Thanks! |
Description of the bug:
If a target is declared with an
add_opens
attribute, it appears that the--add-opens
flag is getting passed tojavac
. But this is incorrect, as--add-opens
is a runtime-only flag. The consequence is that if-Werror
is part ofjavacopts
and JDK ≥17 is used, then build will fail. See reproduction case below.Which category does this issue belong to?
Java Rules
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
https://github.com/timothyg-stripe/bazel-add-opens-repro
cc @cushon who wrote 2217b13
Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?release 6.3.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: