Skip to content
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

[7.0.0] Add add_exports & add_opens parameters to JavaInfo constructor #20244

Closed
wants to merge 1 commit into from

Conversation

iancha1992
Copy link
Member

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 JavaInfos 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 #20033.

Closes #20036.

Commit d2783a3

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
@iancha1992 iancha1992 added team-Rules-Java Issues for Java rules awaiting-review PR is awaiting review from an assigned reviewer labels Nov 17, 2023
@iancha1992 iancha1992 requested a review from a team as a code owner November 17, 2023 18:06
@iancha1992
Copy link
Member Author

@Wyverald @cushon @hvadehra I am not sure why the tests are failing. Could you please take a look?

@keertk keertk closed this Nov 18, 2023
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Nov 18, 2023
@keertk
Copy link
Member

keertk commented Nov 18, 2023

#20033 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-Java Issues for Java rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants