-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[GR-60382] Handle Enable-Native-Access manifest attribute if present #10009
base: master
Are you sure you want to change the base?
Conversation
thanks for the contribution @zakkak. I'll have a look as soon as time allows. |
Sorry for the delay, @zakkak. A lot of side tracking this week. I agree that #10008 is something we need to fix. In the current state, That said, I believe that #10076 will break this PR, or at least partially defeat its purpose. I suggest we wait until #10076 lands and then revisit this and #10008. Would that work for you? |
Thank you for the update @zapster .
Yes, that's fine with us. As said in quarkusio/quarkus#44257 (comment) this is still a warning. |
Quarkus is not using modules, so I am not sure how much we can test this on our side other than passing |
That is totally fine. Out of interest, are you already passing |
No, we currently don't do anything about it. For some cases setting it via the manifest attribute would be enough, but we will definitely need to pass The Quarkus issue tracking this is quarkusio/quarkus#44257. |
1924173
to
e099a6c
Compare
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java
Outdated
Show resolved
Hide resolved
e099a6c
to
8fd44ef
Compare
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 for the update, the change looks good now. I'll integrate it asap, but I'm still busy with post-branch-off tasks, so it could take a bit. However, I'll make sure that this is backported to the GraalVM for 24 release branch.
Great, thank you @zapster 🙏 |
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java
Outdated
Show resolved
Hide resolved
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.
Small changes requested
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.
Since there are anyways pending changes, I've added another minor suggestion.
String enableNativeAccess = mainAttributes.getValue("Enable-Native-Access"); | ||
if (enableNativeAccess != null) { | ||
if (!"ALL-UNNAMED".equals(enableNativeAccess)) { | ||
NativeImage.showError("illegal value \"" + enableNativeAccess + "\" for Enable-Native-Access manifest attribute. Only ALL-UNNAMED is allowed"); |
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.
NativeImage.showError("illegal value \"" + enableNativeAccess + "\" for Enable-Native-Access manifest attribute. Only ALL-UNNAMED is allowed"); | |
throw NativeImage.showError("illegal value \"" + enableNativeAccess + "\" for Enable-Native-Access manifest attribute. Only " + ALL_UNNAMED + " is allowed"); |
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.
Out of curiosity, what's the point of throw
here since showError
never actually returns. Looking in other showError
usages the use of throw
doesn't seem to be consistent.
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.
It helps me to see that execution will stop here without knowing the implementation of showError
. Of course one can look it up, but I find it more readable. But it is a matter of taste, mostly.
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java
Outdated
Show resolved
Hide resolved
8fd44ef
to
29067f5
Compare
Closes #10008