diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/GraalVM.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/GraalVM.java index c4a441876f141..49808129a70d6 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/GraalVM.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/GraalVM.java @@ -25,6 +25,7 @@ public static final class Version implements Comparable { static final Version VERSION_21_3_0 = new Version("GraalVM 21.3.0", "21.3.0", Distribution.ORACLE); public static final Version VERSION_22_3_0 = new Version("GraalVM 22.3.0", "22.3.0", Distribution.ORACLE); public static final Version VERSION_22_2_0 = new Version("GraalVM 22.2.0", "22.2.0", Distribution.ORACLE); + public static final Version VERSION_23_0_0 = new Version("GraalVM 23.0.0", "23.0.0", Distribution.ORACLE); public static final Version MINIMUM = VERSION_22_2_0; public static final Version CURRENT = VERSION_22_3_0; diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java index 4d411fef2a028..b226f7863b86f 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java @@ -702,6 +702,18 @@ public NativeImageInvokerInfo build() { nativeImageArgs.add("-H:-ParseOnce"); } + if (nativeConfig.debug.enabled && graalVMVersion.isNewerThan(GraalVM.Version.VERSION_23_0_0)) { + /* + * Instruct GraalVM / Mandrel to keep more accurate information about source locations when generating + * debug info for debugging and monitoring tools. This parameter may break compatibility with Truffle. + * Affected users should explicitly pass {@code -H:-TrackNodeSourcePosition} through + * {@code quarkus.native.additional-build-args} to override it. + * + * See https://github.com/quarkusio/quarkus/issues/30772 for more details. + */ + nativeImageArgs.add("-H:+TrackNodeSourcePosition"); + } + /** * This makes sure the Kerberos integration module is made available in case any library * refers to it (e.g. the PostgreSQL JDBC requires it, seems plausible that many others will as well):