Skip to content

Commit

Permalink
Build SVM_FOREIGN and set up svm-preview folder in install dir
Browse files Browse the repository at this point in the history
--enable-preview part of native-image flags needs some additional jars,
svm-foreign.jar, for example, for it to work. Add it to the dependency
build and copy the relevant artefact to it's place.
  • Loading branch information
jerboaa committed Jan 15, 2024
1 parent 47c449f commit 154dabd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ public static void main(String... args) throws IOException
FileSystem.copy(mandrelRepo.resolve(
Path.of("sdk", "mxbuild", PLATFORM, IS_WINDOWS ? "native-image.exe.image-bash" : "native-image.image-bash",
IS_WINDOWS ? "native-image.cmd" : "native-image")), nativeImage);
logger.debugf("Copy svm-preview...");
final Path svmForeign = mandrelJavaHome.resolve(Path.of("lib", "svm-preview", "builder", "svm-foreign.jar"));
FileSystem.copy(mandrelRepo.resolve(
Path.of("substratevm", "mxbuild", JDK_VERSION, "dists", JDK_VERSION, "svm-foreign.jar")), svmForeign);
}

if (!options.skipNative)
Expand Down Expand Up @@ -871,7 +875,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,GRAAL_SDK,SVM_DRIVER,SVM_AGENT,SVM_DIAGNOSTICS_AGENT")
BuildArgs.of("--no-native", "--dependencies", "SVM,SVM_FOREIGN,GRAAL_SDK,SVM_DRIVER,SVM_AGENT,SVM_DIAGNOSTICS_AGENT")
, BuildArgs.of("--only",
build.IS_WINDOWS ?
"native-image.exe.image-bash," +
Expand Down

0 comments on commit 154dabd

Please sign in to comment.