-
Notifications
You must be signed in to change notification settings - Fork 8
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
Only build and include svm-foreign when building with JDK > 21 #398
Only build and include svm-foreign when building with JDK > 21 #398
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.
I'm not convinced we need JDK 21 build support, but your mileage may vary.
Also note that IMO it's an (upstream) bug to add attempt to add |
I think that's fixed in oracle/graal#7980 |
3ed73c9
to
81a8e4e
Compare
CI fails due to too new JDK 23:
Fixed once this PR merges: oracle/graal#8262 |
You are right. Thinking some more about this, we don't need the |
Why is that? All the checks in GraalVM are for |
Since oracle/graal#7980 the foreign API is only available for JDK >= 22 builds.
81a8e4e
to
f332451
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.
It makes little sense to me to try to keep JDK 21 compatibility in master
. The entire JEP 454 story in GraalVM seems not 100% ready yet. See graalvm/mandrel#678
@@ -855,7 +858,7 @@ class Mx | |||
Pattern.compile("\"version\"\\s*:\\s*\"([0-9.]*)\""); | |||
|
|||
static final List<BuildArgs> BUILD_JAVA_STEPS = List.of( | |||
BuildArgs.of("--no-native", "--dependencies", "SVM,SVM_FOREIGN,GRAAL_SDK,SVM_DRIVER,SVM_AGENT,SVM_DIAGNOSTICS_AGENT") | |||
BuildArgs.of("--no-native", "--dependencies", "SVM,GRAAL_SDK,SVM_DRIVER,SVM_AGENT,SVM_DIAGNOSTICS_AGENT" + (Runtime.version().feature() > 21 ? ",SVM_FOREIGN" : "")) |
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.
I'm not sure if it makes sense to conditionalize on this for JDK 21. IIRC, this will only work with JDK 22+ Between JDK 21 and JDK 22 the API changed slightly, so I'd be surprised if this still worked. I think it's also something the GraalVM team is aware of:
oracle/graal#8012 (see the note about "Foreign Function and Memory API support")
We have the 23.1
branch for JDK 21 compatible builds. Not sure if we should fix it in master
.
if (Runtime.version().feature() > 21) | ||
{ | ||
logger.debugf("Copy svm-preview..."); | ||
final Path svmForeign = mandrelJavaHome.resolve(Path.of("lib", "svm-preview", "builder", "svm-foreign.jar")); |
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.
svm-preview
folder is wrong as a target for JDK 22+. See graalvm/mandrel#678 for some details.
Sorry, I was wrong. However, there is a different problem with getting |
See #399, which should fix the |
The primary reason for opening this was to prevent build failures when trying to build with JDK 21 so that we can see the actual blocker/issue which is graalvm/mandrel#598 Closing this for now as there are no plans to build |
Since oracle/graal#7980 the foreign API is only
available for JDK >= 22 builds.
Fixes error message:
When trying to build with JDK 21.
If accepted I will backport it to 24.0 as well.