@@ -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
4747const 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
7073const spawnOpts = {
7174 ...( process . platform === 'win32' ? { shell : true } : { } ) ,
0 commit comments