-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[GR-34108] Extend boot module layer to include required modules #3821
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-34108] Extend boot module layer to include required modules #3821
Conversation
substratevm/src/com.oracle.svm.hosted.jdk11/src/com/oracle/svm/hosted/ModuleLayerFeature.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.hosted.jdk11/src/com/oracle/svm/hosted/ModuleLayerFeature.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.hosted.jdk11/src/com/oracle/svm/hosted/ModuleLayerFeature.java
Outdated
Show resolved
Hide resolved
/** | ||
* This method creates Module instances that will populate the runtime boot module layer of the image. | ||
* This implementation is copy-pasted from {@link java.lang.Module#defineModules(Configuration, Function, ModuleLayer)} | ||
* with few simplifications (removing multiple classloader support) and removal of VM state updates |
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.
removal of VM state updates
😬 if java.lang.Module#defineModules
would have been written in a way that partitions module creation from VM state update we could reuse the module creation part without this reflection-orgy.
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.
Looks good now.
Please also run mx eclipseformat --primary
to see where you need to adjust the formatting.
Unfortunately it e.g. fails
The current solution is not able to deal with optional required modules ( graal/substratevm/mx.substratevm/suite.py Lines 1237 to 1241 in f49b9d1
Those are optional dependencies. I.e. we have to be able to handle the situation where these modules are not necessarily available during image build time. |
@ivan-ristovic please rebase to |
substratevm/src/com.oracle.svm.hosted.jdk11/src/com/oracle/svm/hosted/ModuleLayerFeature.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.
Running in CI now
@ivan-ristovic I see style errors:
|
And JDK 17 gate errors like
|
Style issues fixed. I believe the reflection error that you sent is something we have seen earlier and is related to it behaving differently on 16+. If you recall we discussed a similar "reflection bug" where the field is present in a class and reflection for some reason does not pick it up. Is this the same issue then, because as far as I see there is no reason why |
I have tracked the problem down to filters in |
@ivan-ristovic CI passes now mostly. Except for one little style issue:
|
@ivan-ristovic ... aaand one more style issue:
|
This PR implements #3733