-
Notifications
You must be signed in to change notification settings - Fork 455
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
Open com.sun.tools.javac modules on JDK 16+ #1224
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
cc @nedtwigg |
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.
This needs an entry in each of the three CHANGES.md
(root and plugin-maven/plugin-gradle).
If I understand correctly, the intent of this change is that users won't have to add the --add-opens
commands most of the time? Have you been able to confirm this on your machine in an integration test?
Signed-off-by: tison <wander4096@gmail.com>
…levant Signed-off-by: tison <wander4096@gmail.com>
@nedtwigg comments addressed. I'd like to know how to apply a local plugin jar so that I can verify with the SNAPSHOT on my projects - I'm working on this issue because I don't want my project contains a JDK16+ workaround gradle.properties file, which will fail JDK8 build. |
OK. I've checked that this patch work for my project by I'm glad to add an integration test if I learn how to. Or you may verify by yourself since I think if we workaround a JDK limitation, it should be straightforward and it's hard to me to construct such a test. |
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.
Thanks!
Released in |
@nedtwigg sorry that I miss a local commit that we should get unsafe from reflection otherwise it will throw exceptions. |
Does it fix the same issue with palantir-java-format? |
Re: palantir-java-format
|
@nedtwigg This fix has an interesting side-effect that can cause apparent flakiness: Since the modules are opened for the VM as a whole, this means that any other plugin that runs GJF in the same VM piggy-backs on this solution, iff Spotless gets to run first. I've just been scratching my head as to why one invocation of Gradle works but not the other. It could be worth looking into closing the modules after use. |
@davidburstrom Can you provide a reproduce here? I'm curious how an extra opened module hurts? |
BarreraVIP
Rabu, 01 Maret 2023, 04:16PM +08:00 dari tison ***@***.***>:
…
@davidburstrom Can you provide a reproduce here? I'm curious how an extra opened module hurts?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
@tisonkun I don't have a public reproducer at hand, but consider this: You have a custom It hurts because hermeticity and reproducibility has been broken. |
@davidburstrom I get your point now. Basically, I ever thought of just fixing the issue in GJF upstream and all downstreams need not to do any trick. But it seems the upstream is relatively inactive so I fix my case here. You may try to pick related changes to the upstream and remove this trick :) |
Thank's boss |
Technically speaking, it would be the same issue upstream too: Any other library X that require the same compiler modules to be exported would work if GJF has been executed in the same VM and vice versa. It'd be better if the open was matched with a corresponding close when GJF is done, which obviously requires reference counting and would still be susceptible to race conditions (the library X would work only when GJF is executing). |
This is an attempt to fix #834.
The solution is pointed out from google/google-java-format#612 (comment).
I'm new to this community and I'm glad to know how to move forward this effort.