-
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 7 regression: Deploy JARs no longer contain Add-Exports/Opens manifest lines #21243
Comments
@bazel-io fork 7.1.0 |
Thanks for the report, this was an oversight, fixing shortly.
AFAICT, that is an internal attribute that is a no-op for Bazel.
Yes, but looks like that was the always the case, even in the native JavaBinary rule. But the discrepancy was likely just unintentional. Will fix as well. |
Hi @hvadehra, this bug fix is currently scheduled for 7.1.0. Given it will likely be a quick fix, do you think you are able to cherry-pick it and release this fix in 7.0.3? It will help us upgrade Bazel sooner without having to fork or apply our own patch. Thanks in advance! |
I don't think a 7.0.3 release is planned. @meteorcloudy to confirm. |
Also propagates these in the unstripped case, which presumably was missed in unknown commit Fixes: bazelbuild#21243 PiperOrigin-RevId: 605543271 Change-Id: I57bc46074a289fa584acab147e11228e9dcf3eee
Yes, 7.1.0 is around the corner and will contain many other bug fixes and improvements, so I prefer to just wait for it unless this is a serious regression that has wide impact. |
A fix for this issue has been included in Bazel 7.1.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks! |
Description of the bug:
In Bazel 6, if a
java_binary
depends on ajava_library
withadd_exports
/add_opens
set, the deploy JAR would include lines likeAdd-Exports: …
in its manifest. However, this longer happens on Bazel 7.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.
Compared to Bazel 6.3.2:
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?release 7.0.0
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 HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
Yes. The regression comes from the overall Java rule Starlarkification work.
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
We have identified the exact bug: this line does not pass
info.add_exports
andinfo.add_opens
tocreate_deploy_archives
.bazel/src/main/starlark/builtins_bzl/bazel/java/bazel_java_binary_deploy_jar.bzl
Lines 41 to 51 in 773942f
We have confirmed that the
InternalDeployJarInfo
provider is populated correctly forhello_bin
(see below, pretty-printed). So in all likelihood, this bug would not occur ifinfo.add_exports
were passed correctly.Two additional bugs:
add_exports
andadd_opens
, we also see thatinfo.hermetic
is not being passed tocreate_deploy_archives
.create_deploy_archives
,add_exports
andadd_opens
are not being passed tocreate_deploy_archive
in theif strip_as_default
branch.cc @hvadehra
The text was updated successfully, but these errors were encountered: