-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,10 +138,13 @@ public static void main(String... args) throws IOException | |
FileSystem.copy(mandrelRepo.resolve( | ||
Path.of("sdk", "mxbuild", PLATFORM, "native-image.exe.image-bash", "native-image.export-list")), nativeImageExport); | ||
} | ||
logger.debugf("Copy svm-preview..."); | ||
final Path svmForeign = mandrelJavaHome.resolve(Path.of("lib", "svm-preview", "builder", "svm-foreign.jar")); | ||
final Path svmForeignSource = PathFinder.getFirstExisting(mandrelRepo.resolve(Path.of("substratevm", "mxbuild")).toString(), "svm-foreign.jar"); | ||
FileSystem.copy(svmForeignSource, svmForeign); | ||
if (Runtime.version().feature() > 21) | ||
{ | ||
logger.debugf("Copy svm-preview..."); | ||
final Path svmForeign = mandrelJavaHome.resolve(Path.of("lib", "svm-preview", "builder", "svm-foreign.jar")); | ||
final Path svmForeignSource = PathFinder.getFirstExisting(mandrelRepo.resolve(Path.of("substratevm", "mxbuild")).toString(), "svm-foreign.jar"); | ||
FileSystem.copy(svmForeignSource, svmForeign); | ||
} | ||
} | ||
|
||
if (!options.skipNative) | ||
|
@@ -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") | ||
jerboaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 commentThe 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: We have the |
||
, BuildArgs.of("--only", | ||
build.IS_WINDOWS ? | ||
"native-image.exe.image-bash," + | ||
|
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.