@@ -147,7 +147,7 @@ val enableEmbeddedJvm = false
147
147
val enableEmbeddedBuilder = false
148
148
val enableBuildReport = true
149
149
val enableHeapReport = false
150
- val enableG1 = true
150
+ val enableG1 = false
151
151
val enablePreinit = true
152
152
val enablePgo = findProperty(" elide.pgo" ) != " false"
153
153
val enablePgoSampling = false
@@ -160,12 +160,14 @@ val enableSbomStrict = false
160
160
val enableJfr = false
161
161
val enableNmt = false
162
162
val enableHeapDump = false
163
+ val enableJvmstat = false
163
164
val enableJmx = false
164
165
val enableVerboseClassLoading = false
165
166
val jniDebug = false
166
167
val glibcTarget = if (enableStatic) " musl" else " glibc"
167
168
val dumpPointsTo = false
168
169
val elideTarget = TargetInfo .current(project)
170
+ val fallbackGc = findProperty(" elide.gc" ) ? : " serial"
169
171
val defaultArchTarget = when {
170
172
TargetCriteria .allOf(elideTarget, Criteria .Amd64 ) -> " x86-64-v3"
171
173
TargetCriteria .allOf(elideTarget, Criteria .MacArm64 ) -> " armv8.1-a"
@@ -184,7 +186,7 @@ val exclusions = listOfNotNull(
184
186
libs.jline.terminal.jna,
185
187
186
188
// only include jline jni integration if ffm is disabled
187
- if (enableFfm) libs.jline.terminal.jni else null ,
189
+ // if (enableFfm) libs.jline.terminal.jni else null,
188
190
189
191
// exclude kotlin compiler if kotlin is not enabled; it includes shadowed jline configs
190
192
if (enableKotlin) null else libs.kotlin.compiler.embedded,
@@ -407,7 +409,8 @@ dependencies {
407
409
api(mn.micronaut.inject)
408
410
implementation(projects.packages.terminal)
409
411
implementation(libs.dirs)
410
- jvmOnly(libs.snakeyaml)
412
+ implementation(libs.snakeyaml)
413
+ implementation(mn.micronaut.json.core)
411
414
412
415
// Native-image transitive compile dependencies
413
416
implementation(libs.jakarta.validation)
@@ -446,7 +449,7 @@ dependencies {
446
449
implementation(libs.jline.terminal.jni)
447
450
448
451
if (enableFfm) {
449
- implementation(libs.jline.terminal.ffm)
452
+ // implementation(libs.jline.terminal.ffm)
450
453
}
451
454
452
455
implementation(libs.jline.builtins)
@@ -728,7 +731,6 @@ val enabledSecurityProviders = listOfNotNull(
728
731
729
732
val preinitializedContexts = if (! enablePreinit) emptyList() else listOfNotNull(
730
733
" js" ,
731
- " ts" ,
732
734
onlyIf(enablePreinitializeAll && enablePython, " python" ),
733
735
onlyIf(enablePreinitializeAll && enableRuby, " ruby" ),
734
736
onlyIf(enablePreinitializeAll && enableJvm, " java" ),
@@ -771,26 +773,20 @@ if (!pluginApiHeader.exists()) {
771
773
}
772
774
773
775
val initializeAtBuildtime: List <String > = listOf (
776
+ " kotlin" ,
774
777
" kotlinx.atomicfu" ,
775
- " elide.tool.io.RuntimeWorkdirManager " ,
776
- " elide.tool.io.RuntimeWorkdirManager \$ Companion " ,
778
+ " org.slf4j " ,
779
+ " ch.qos.logback " ,
777
780
" io.micronaut.context.DefaultApplicationContextBuilder" ,
778
- " elide.tool.err.DefaultErrorHandler" ,
779
- " elide.tool.err.DefaultErrorHandler\$ Companion" ,
780
- " elide.tool.err.DefaultStructuredErrorRecorder" ,
781
- " elide.tool.err.DefaultStructuredErrorRecorder\$ Companion" ,
782
- " elide.runtime.core.internals.graalvm.GraalVMEngine\$ Companion" ,
783
781
" org.fusesource.jansi.io.AnsiOutputStream" ,
784
782
" com.google.common.jimfs.SystemJimfsFileSystemProvider" ,
785
783
" com.google.common.collect.MapMakerInternalMap\$ 1" ,
786
784
" elide.tool.cli.AbstractToolCommand\$ Companion" ,
787
785
" elide.tool.cli.Elide\$ Companion" ,
788
786
" com.google.common.base.Equivalence\$ Equals" ,
789
- " kotlin" ,
790
787
" com.google.common.collect.MapMakerInternalMap" ,
791
788
" com.google.common.collect.MapMakerInternalMap\$ StrongKeyWeakValueSegment" ,
792
789
" com.google.common.collect.MapMakerInternalMap\$ StrongKeyWeakValueEntry\$ Helper" ,
793
- " ch.qos.logback" ,
794
790
" com.sun.tools.javac.resources.compiler" ,
795
791
" com.sun.tools.javac.resources.javac" ,
796
792
" sun.tools.jar.resources.jar" ,
@@ -801,33 +797,61 @@ val initializeAtBuildtime: List<String> = listOf(
801
797
" elide.runtime.gvm.internals.sqlite.SqliteModule" ,
802
798
" elide.runtime.lang.javascript.JavaScriptPrecompiler" ,
803
799
" java.sql" ,
804
- " org.slf4j" ,
805
800
" org.sqlite" ,
806
801
" org.pkl.core.runtime.VmLanguageProvider" ,
807
802
" elide.runtime.lang.typescript" ,
808
803
" elide.runtime.typescript" ,
804
+ " elide.runtime.plugins.js.JavaScript" ,
805
+ " elide.tool.io.RuntimeWorkdirManager" ,
806
+ " elide.tool.io.RuntimeWorkdirManager\$ Companion" ,
807
+ " elide.tool.err.DefaultErrorHandler" ,
808
+ " elide.tool.err.DefaultErrorHandler\$ Companion" ,
809
+ " elide.tool.err.DefaultStructuredErrorRecorder" ,
810
+ " elide.tool.err.DefaultStructuredErrorRecorder\$ Companion" ,
811
+ " elide.runtime.core.internals.graalvm.GraalVMEngine\$ Companion" ,
812
+ " elide.runtime.gvm.intrinsics.BuildTimeIntrinsicsResolver" ,
809
813
)
810
814
811
815
val initializeAtBuildTimeTest: List <String > = listOf (
812
816
" org.junit.platform.launcher.core.LauncherConfig" ,
813
817
" org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter" ,
814
818
)
815
819
816
- val initializeAtRuntimeNonLinux: List <String > = listOfNotNull(
820
+ val initializeAtRuntime: List <String > = listOfNotNull(
821
+ onlyIf(! enableSqliteStatic, " org.sqlite.SQLiteJDBCLoader" ),
822
+ onlyIf(! enableSqliteStatic, " org.sqlite.core.NativeDB" ),
823
+ " org.fusesource.jansi.internal.CLibrary" ,
824
+ " com.github.ajalt.mordant.rendering.TextStyles" ,
825
+ " elide.tool.err.ErrPrinter" ,
826
+ " com.google.protobuf.RuntimeVersion" ,
827
+ " elide.tool.err.ErrorHandler${' $' } ErrorContext" ,
828
+ " com.google.protobuf.RuntimeVersion" ,
829
+ " sun.java2d.pipe.Region" ,
830
+ " sun.rmi.server.Util" ,
831
+ " sun.awt.X11.XWM" ,
832
+ " sun.awt.X11.XSystemTrayPeer" ,
833
+ " sun.awt.X11.XDragAndDropProtocols" ,
834
+ " com.github.ajalt.mordant.terminal.terminalinterface.ffm.TerminalInterfaceFfmLinux" ,
835
+ " com.github.ajalt.mordant.internal.MppInternalKt" ,
836
+
837
+ // @TODO switch to built-in brotli
838
+ " org.apache.commons.compress.compressors.brotli.BrotliCompressorInputStream" ,
839
+ " org.apache.commons.compress.compressors.xz.XZCompressorOutputStream" ,
840
+
841
+ // --- JNA + OSHI -----
842
+
843
+ " com.sun.jna.platform.linux.LibC" ,
844
+ " com.sun.jna.platform.linux.Udev" ,
845
+ " oshi.software.os.linux.LinuxOperatingSystem" ,
817
846
" oshi.hardware.platform.linux" ,
818
847
" oshi.jna.platform.linux.LinuxLibc" ,
819
848
" oshi.util.UserGroupInfo" ,
820
849
" oshi.driver.linux.Lshw" ,
821
- " com.sun.jna.platform.linux.LibC" ,
822
850
" oshi.software.os" ,
823
851
" oshi.software.os.linux" ,
824
- " oshi.software.os.linux.LinuxOperatingSystem" ,
825
852
" oshi.util.platform.linux.DevPath" ,
826
853
" oshi.util.platform.linux.ProcPath" ,
827
854
" oshi.util.platform.linux.SysPath" ,
828
- )
829
-
830
- val initializeAtRuntimeNonMac: List <String > = listOfNotNull(
831
855
" com.sun.jna.platform.mac.CoreFoundation" ,
832
856
" oshi.hardware.platform.mac" ,
833
857
" oshi.hardware.platform.mac.MacFirmware" ,
@@ -847,19 +871,6 @@ val initializeAtRuntimeNonMac: List<String> = listOfNotNull(
847
871
" oshi.util.platform.mac.CFUtil" ,
848
872
" oshi.util.platform.mac.SmcUtil" ,
849
873
" oshi.util.platform.mac.SysctlUtil" ,
850
- )
851
-
852
- val initializeAtRuntime: List <String > = listOfNotNull(
853
- onlyIf(! enableSqliteStatic, " org.sqlite.SQLiteJDBCLoader" ),
854
- onlyIf(! enableSqliteStatic, " org.sqlite.core.NativeDB" ),
855
- onlyIf(enableNativeTransportV2, " io.netty.channel.kqueue.Native" ),
856
- onlyIf(enableNativeTransportV2, " io.netty.channel.kqueue.KQueueEventLoop" ),
857
- " org.fusesource.jansi.internal.CLibrary" ,
858
- " com.github.ajalt.mordant.rendering.TextStyles" ,
859
- " elide.tool.err.ErrPrinter" ,
860
- " com.google.protobuf.RuntimeVersion" ,
861
- " elide.tool.err.ErrorHandler${' $' } ErrorContext" ,
862
- " com.google.protobuf.RuntimeVersion" ,
863
874
864
875
// pkl needs this
865
876
" org.msgpack.core.buffer.DirectBufferAccess" ,
@@ -1017,10 +1028,6 @@ val initializeAtRuntime: List<String> = listOfNotNull(
1017
1028
" elide.tool.cli.cmd.discord" ,
1018
1029
" elide.tool.cli.cmd.discord.ToolDiscordCommand" ,
1019
1030
" elide.tool.cli.cmd.selftest.SelfTestCommand" ,
1020
- ).plus(
1021
- initializeAtRuntimeNonLinux.onlyIf(! HostManager .hostIsLinux)
1022
- ).plus(
1023
- initializeAtRuntimeNonMac.onlyIf(! HostManager .hostIsMac)
1024
1031
)
1025
1032
1026
1033
val initializeAtRuntimeTest: List <String > = emptyList()
@@ -1055,7 +1062,7 @@ val nativeMonitoring = listOfNotNull(
1055
1062
onlyIf(enableJfr, " jfr" ),
1056
1063
onlyIf(enableNmt, " nmt" ),
1057
1064
onlyIf(enableHeapDump, " heapdump" ),
1058
- " jvmstat" ,
1065
+ onlyIf(enableJvmstat, " jvmstat" ) ,
1059
1066
onlyIf(enableJmx, " jmxserver" ),
1060
1067
onlyIf(enableJmx, " jmxclient" ),
1061
1068
onlyIf(enableJmx, " threaddump" ),
@@ -1093,14 +1100,14 @@ val commonNativeArgs = listOfNotNull(
1093
1100
// "--exact-reachability-metadata",
1094
1101
" --enable-url-protocols=http,https" ,
1095
1102
" --color=always" ,
1096
- // "--link -at-build-time",
1103
+ " --initialize -at-build-time" ,
1097
1104
" --exact-reachability-metadata" ,
1098
1105
" --link-at-build-time=elide" ,
1099
1106
" --link-at-build-time=dev.elide" ,
1100
1107
" --link-at-build-time=org.pkl" ,
1101
1108
" --link-at-build-time=picocli" ,
1102
1109
" --enable-native-access=org.graalvm.truffle,ALL-UNNAMED" ,
1103
- " --enable-monitoring=${nativeMonitoring} " ,
1110
+ onlyIf(nativeMonitoring.isNotEmpty(), " --enable-monitoring=${nativeMonitoring} " ) ,
1104
1111
" -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED" ,
1105
1112
" -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.hosted=ALL-UNNAMED" ,
1106
1113
" -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.hosted.c=ALL-UNNAMED" ,
@@ -1202,7 +1209,6 @@ val commonNativeArgs = listOfNotNull(
1202
1209
onlyIf(enablePgoSampling, " --pgo-sampling" ),
1203
1210
onlyIf(enableHeapReport, " -H:+BuildReportMappedCodeSizeBreakdown" ),
1204
1211
onlyIf(enableHeapReport, " -H:+TrackNodeSourcePosition" ),
1205
- onlyIf(enableHeapReport, " -R:-TrackNodeSourcePosition" ),
1206
1212
).asSequence().plus(
1207
1213
languagePluginPaths.plus(umbrellaNativesPath).plus(jniHeaderPaths).filter {
1208
1214
Files .exists(Path .of(it))
@@ -1225,9 +1231,9 @@ val debugFlags: List<String> = listOfNotNull(
1225
1231
" --verbose" ,
1226
1232
" -g" ,
1227
1233
" -H:+SourceLevelDebug" ,
1234
+ " -H:-DeleteLocalSymbols" ,
1228
1235
// "-Dpolyglot.engine.TraceCache=true",
1229
1236
// "-J-Dpolyglot.engine.TraceCache=true",
1230
- // "-H:-DeleteLocalSymbols",
1231
1237
// "-H:+PrintMethodHistogram",
1232
1238
// "-H:+PrintPointsToStatistics",
1233
1239
// "-H:+PrintRuntimeCompileMethods",
@@ -1325,15 +1331,11 @@ val profiles: List<String> = if (enableEdge) listOf(
1325
1331
" ts-sqlite.iprof" ,
1326
1332
) else listOfNotNull(
1327
1333
" cli-help.iprof" ,
1328
- " js-cpu.iprof" ,
1329
- " js-fetch.iprof" ,
1330
- " js-fs.iprof" ,
1334
+ " cli-version.iprof" ,
1331
1335
" js-hello.iprof" ,
1332
- " js-paths.iprof" ,
1333
1336
" pkl-eval.iprof" ,
1334
1337
onlyIf(enablePython, " py-hello.iprof" ),
1335
1338
onlyIf(enablePython, " py-interop.iprof" ),
1336
- " ts-hello.iprof" ,
1337
1339
" ts-sqlite.iprof" ,
1338
1340
)
1339
1341
@@ -1425,7 +1427,7 @@ val pklArgs: List<String> = listOf(
1425
1427
val defaultPlatformArgs: List <String > = listOf ()
1426
1428
1427
1429
val windowsOnlyArgs = defaultPlatformArgs.plus(listOf (
1428
- " --gc=serial " ,
1430
+ " --gc=$fallbackGc " ,
1429
1431
" -R:MaximumHeapSizePercent=80" ,
1430
1432
).plus(if (oracleGvm) listOf (
1431
1433
" -Delide.vm.engine.preinitialize=true" ,
@@ -1439,7 +1441,7 @@ val windowsOnlyArgs = defaultPlatformArgs.plus(listOf(
1439
1441
) else emptyList())
1440
1442
1441
1443
val darwinOnlyArgs = defaultPlatformArgs.plus(listOf (
1442
- " --gc=serial " ,
1444
+ " --gc=$fallbackGc " ,
1443
1445
" -R:MaximumHeapSizePercent=80" ,
1444
1446
" --initialize-at-build-time=sun.awt.resources.awtosx" ,
1445
1447
" -H:NativeLinkerOption=-flto" ,
@@ -1468,7 +1470,7 @@ val windowsReleaseArgs = windowsOnlyArgs
1468
1470
val darwinReleaseArgs = darwinOnlyArgs.toList()
1469
1471
1470
1472
val linuxOnlyArgs = defaultPlatformArgs.plus(
1471
- listOf (
1473
+ listOfNotNull (
1472
1474
" -g" , // always generate debug info on linux
1473
1475
" -H:NativeLinkerOption=-flto" ,
1474
1476
" -H:NativeLinkerOption=-Wl,--gc-sections" ,
@@ -1490,6 +1492,9 @@ val linuxOnlyArgs = defaultPlatformArgs.plus(
1490
1492
" --initialize-at-run-time=io.netty.channel.kqueue.Native" ,
1491
1493
" --initialize-at-run-time=io.netty.channel.kqueue.Native" ,
1492
1494
" --initialize-at-run-time=io.netty.channel.kqueue.KQueueEventLoop" ,
1495
+ " --initialize-at-run-time=io.netty.channel.kqueue.KQueueEventArray" ,
1496
+ " --initialize-at-run-time=io.netty.channel.kqueue.KQueue" ,
1497
+ onlyIf(enableNativeTransportV2, " io.netty.channel.kqueue.Native" ),
1493
1498
).plus(
1494
1499
listOfNotNull(
1495
1500
onlyIf(enableStatic, " --libc=musl" ),
@@ -1508,10 +1513,10 @@ val linuxOnlyArgs = defaultPlatformArgs.plus(
1508
1513
" --gc=G1" ,
1509
1514
" -H:-AuxiliaryEngineCache" ,
1510
1515
" -Delide.vm.engine.preinitialize=false" ,
1511
- ) else listOf (
1512
- " --gc=serial " ,
1516
+ ) else listOfNotNull (
1517
+ " --gc=$fallbackGc " ,
1513
1518
" -R:MaximumHeapSizePercent=80" ,
1514
- " -H:InitialCollectionPolicy=Adaptive" ,
1519
+ onlyIf(fallbackGc == " serial " , " -H:InitialCollectionPolicy=Adaptive" ) ,
1515
1520
).plus(if (oracleGvm && enableAuxCache && ! enableG1) listOf (
1516
1521
" -H:+AuxiliaryEngineCache" ,
1517
1522
" -Delide.vm.engine.preinitialize=true" ,
@@ -2128,6 +2133,7 @@ tasks {
2128
2133
" -Xmx4g" ,
2129
2134
" -XX:+UnlockExperimentalVMOptions" ,
2130
2135
" --enable-native-access=ALL-UNNAMED" ,
2136
+ " -Xverify:none" ,
2131
2137
// "-agentpath:/opt/visualvm/visualvm/lib/deployed/jdk16/linux-amd64/libprofilerinterface.so=/opt/visualvm/visualvm/lib,5140",
2132
2138
)))
2133
2139
0 commit comments