Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit 2bbc25e

Browse files
Reorder native-image flags
1 parent 4ba0ecc commit 2bbc25e

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

build-scripts/graal.js

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,34 @@ const flagsByPlatformAndArch = new Map([
4141
// See https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/
4242
['linux-x86', ['--static', '--libc=musl']],
4343
['linux-x64', ['--static', '--libc=musl']],
44-
['linux-arm64', ['-H:+StaticExecutableWithDynamicLibC']],
44+
['linux-arm64', ['-H:+StaticExecutableWithDynamicLibC']], // On Graal JDK 24 and newer, this is --static-nolibc
4545
]);
4646

4747
const platformFlags = flagsByPlatformAndArch.get(`${process.platform}-${process.arch}`) || [];
48-
const NATIVE_IMAGE_BUILD_ARGS = platformFlags.concat([
49-
'-H:+UnlockExperimentalVMOptions',
50-
'-H:IncludeResourceBundles=org.kohsuke.args4j.Messages',
51-
'-H:IncludeResourceBundles=org.kohsuke.args4j.spi.Messages',
52-
'-H:IncludeResourceBundles=com.google.javascript.jscomp.parsing.ParserConfig',
53-
'-H:+AllowIncompleteClasspath',
54-
`-H:ReflectionConfigurationFiles=${path.resolve(__dirname, 'reflection-config.json')}`,
55-
'-H:IncludeResources=externs\.zip',
56-
'-H:IncludeResources=.*\.typedast',
57-
'-H:IncludeResources=com/google/javascript/.*\.js',
58-
'-H:IncludeResources=com/google/javascript/.*\.txt',
59-
'-H:IncludeResources=lib/.*\.js',
60-
'-H:IncludeResources=META-INF/.*\.txt',
61-
'-H:+ReportExceptionStackTraces',
62-
// '-H:+GenerateEmbeddedResourcesFile', // Available on Graal JDK 24 and newer
63-
'--report-unsupported-elements-at-runtime',
64-
'--initialize-at-build-time',
65-
'--color=always',
66-
'-jar',
67-
path.resolve(process.cwd(), 'compiler.jar')
68-
]);
48+
const NATIVE_IMAGE_BUILD_ARGS = ['-H:+UnlockExperimentalVMOptions'].concat(
49+
platformFlags,
50+
[
51+
'-H:+UnlockExperimentalVMOptions',
52+
'-H:IncludeResourceBundles=org.kohsuke.args4j.Messages',
53+
'-H:IncludeResourceBundles=org.kohsuke.args4j.spi.Messages',
54+
'-H:IncludeResourceBundles=com.google.javascript.jscomp.parsing.ParserConfig',
55+
'-H:+AllowIncompleteClasspath',
56+
`-H:ReflectionConfigurationFiles=${path.resolve(__dirname, 'reflection-config.json')}`,
57+
'-H:IncludeResources=externs\.zip',
58+
'-H:IncludeResources=.*\.typedast',
59+
'-H:IncludeResources=com/google/javascript/.*\.js',
60+
'-H:IncludeResources=com/google/javascript/.*\.txt',
61+
'-H:IncludeResources=lib/.*\.js',
62+
'-H:IncludeResources=META-INF/.*\.txt',
63+
'-H:+ReportExceptionStackTraces',
64+
// '-H:+GenerateEmbeddedResourcesFile', // Available on Graal JDK 24 and newer
65+
'--report-unsupported-elements-at-runtime',
66+
'--initialize-at-build-time',
67+
'--color=always',
68+
'-jar',
69+
path.resolve(process.cwd(), 'compiler.jar'),
70+
],
71+
);
6972

7073
const spawnOpts = {
7174
...(process.platform === 'win32' ? { shell: true } : {}),

0 commit comments

Comments
 (0)