Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions build.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ public static void main(String... args) throws IOException
logger.debugf("Build native agents...");
buildAgents(nativeImage, fs, os);
}
logger.debugf("Build native-image-configure and rename to native-image-utils...");
buildNativeImageConfigure(nativeImage, fs, os);
Path from = mandrelJavaHome.resolve(Path.of("lib", "svm", "bin", "native-image-configure" + (IS_WINDOWS ? ".exe" : "")));
Path to = mandrelJavaHome.resolve(Path.of("bin", "native-image-configure" + (IS_WINDOWS ? ".exe" : "")));
Files.move(from, to);

generateMandrelReleaseFile(mandrelVersionUntilSpace, mandrelHome);
}
Expand Down Expand Up @@ -308,6 +313,12 @@ private static void buildAgents(Path nativeImage, FileSystem fs, OperatingSystem
os.exec(dagent, false);
}

private static void buildNativeImageConfigure(Path nativeImage, FileSystem fs, OperatingSystem os)
{
final Tasks.Exec agent = Tasks.Exec.of(Arrays.asList(nativeImage.toString(), "--macro:native-image-configure-launcher"), fs.workingDir());
os.exec(agent, false);
}

private static void createArchive(FileSystem fs, OperatingSystem os, Path mandrelHome, String archiveName)
{
final String mandrelHomeParentDir = mandrelHome.getParent().toString();
Expand Down Expand Up @@ -902,17 +913,21 @@ 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,SVM_CONFIGURE,SVM_FOREIGN,GRAAL_SDK,SVM_DRIVER,SVM_AGENT,SVM_DIAGNOSTICS_AGENT")
, BuildArgs.of("--only",
build.IS_WINDOWS ?
"native-image.exe.image-bash," +
"native-image-configure.exe.image-bash," +
"native-image-agent-library_native-image.properties," +
"native-image-launcher_native-image.properties," +
"native-image-configure-launcher_native-image.properties," +
"native-image-diagnostics-agent-library_native-image.properties"
:
"native-image.image-bash," +
"native-image-configure.image-bash," +
"native-image-agent-library_native-image.properties," +
"native-image-launcher_native-image.properties," +
"native-image-configure-launcher_native-image.properties," +
"native-image-diagnostics-agent-library_native-image.properties")
);

Expand Down Expand Up @@ -1015,6 +1030,7 @@ class Mx
macroPaths = Map.ofEntries(
new SimpleEntry<>("native-image-agent-library", sdkBuildPath.resolve(Path.of("native-image.properties", "native-image-agent-library"))),
new SimpleEntry<>("native-image-launcher", sdkBuildPath.resolve(Path.of("native-image.properties", "native-image-launcher"))),
new SimpleEntry<>("native-image-configure-launcher", sdkBuildPath.resolve(Path.of("native-image.properties", "native-image-configure-launcher"))),
new SimpleEntry<>("native-image-diagnostics-agent-library", sdkBuildPath.resolve(Path.of("native-image.properties", "native-image-diagnostics-agent-library")))
);
}
Expand All @@ -1028,6 +1044,7 @@ class Mx
"sdk:POLYGLOT," +
"sdk:WORD," +
"SVM," +
"SVM_CONFIGURE," +
"SVM_CAPNPROTO_RUNTIME," +
"NATIVE_IMAGE_BASE," +
"POINTSTO," +
Expand Down Expand Up @@ -1222,7 +1239,7 @@ static Function<BuildArgs, Tasks.Exec> mxbuild(
, "--java-home"
, javaHome.toString()
, "--native-images=lib:native-image-agent,lib:native-image-diagnostics-agent"
, "--components=ni"
, "--components=ni,nic"
, "--exclude-components=nju,svmnfi,svml,tflm,svmt"
, options.disableDebuginfoStripping ? "--disable-debuginfo-stripping" : ""
, "build"
Expand Down
Loading