-
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
Add add_exports & add_opens parameters to JavaInfo constructor #20036
Add add_exports & add_opens parameters to JavaInfo constructor #20036
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'd like @cushon to review as well, in case there are any concerns with this that I'm not aware of.
@hvadehra can we put this behind the same allowlist as Otherwise it seems fine, there isn't a principled reason this can be configured with |
@bazel-io fork 7.0.0 |
There is currently no non-hacky way for third-party rule implementations to add `add_exports` and `add_opens` to a `JavaInfo`, though hacky ways exist (like using a macro to generate a `java_library` with `add_exports` / `add_opens` and add it as a dependency). Having an official way to create `JavaInfo`s with `add_exports` and `add_opens` helps third-party JVM rules better support JDK 9+ (and especially 17+, which requires `--add-opens` flags to access JDK internals through reflection). Addresses half of bazelbuild#20033. Closes bazelbuild#20036. PiperOrigin-RevId: 580472097 Change-Id: I159e3410c5480ac683fd9af85bfd1d83ac0e6d8a
There is currently no non-hacky way for third-party rule implementations to add `add_exports` and `add_opens` to a `JavaInfo`, though hacky ways exist (like using a macro to generate a `java_library` with `add_exports` / `add_opens` and add it as a dependency). Having an official way to create `JavaInfo`s with `add_exports` and `add_opens` helps third-party JVM rules better support JDK 9+ (and especially 17+, which requires `--add-opens` flags to access JDK internals through reflection). Addresses half of bazelbuild#20033. Closes bazelbuild#20036. PiperOrigin-RevId: 580472097 Change-Id: I159e3410c5480ac683fd9af85bfd1d83ac0e6d8a
There is currently no non-hacky way for third-party rule implementations to add
add_exports
andadd_opens
to aJavaInfo
, though hacky ways exist (like using a macro to generate ajava_library
withadd_exports
/add_opens
and add it as a dependency, or creating an empty source file and compiling it usingjava_common.compile
).Having an official way to create
JavaInfo
s withadd_exports
andadd_opens
helps third-party JVM rules better support JDK 9+ (and especially 17+, which requires--add-opens
flags to access JDK internals through reflection).Addresses half of #20033.