From ac3e7b3e00d2c3202aff224c59c982d736715dbf Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Wed, 16 Oct 2024 10:05:23 +0300 Subject: [PATCH] Don't pass '--enable-monitoring=heapdump' unconditionally on windows The feature is not supported on Windows Closes https://github.com/quarkusio/quarkus/issues/43895 --- .../deployment/pkg/steps/NativeImageBuildStep.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 5a6f9643ceb58..2c4be668f23d7 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 @@ -932,13 +932,18 @@ public NativeImageInvokerInfo build() { } List monitoringOptions = new ArrayList<>(); - monitoringOptions.add(NativeConfig.MonitoringOption.HEAPDUMP); + if (!SystemUtils.IS_OS_WINDOWS || containerBuild) { + // --enable-monitoring=heapdump is not supported on Windows + monitoringOptions.add(NativeConfig.MonitoringOption.HEAPDUMP); + } if (nativeConfig.monitoring().isPresent()) { monitoringOptions.addAll(nativeConfig.monitoring().get()); } - nativeImageArgs.add("--enable-monitoring=" + monitoringOptions.stream() - .distinct() - .map(o -> o.name().toLowerCase(Locale.ROOT)).collect(Collectors.joining(","))); + if (!monitoringOptions.isEmpty()) { + nativeImageArgs.add("--enable-monitoring=" + monitoringOptions.stream() + .distinct() + .map(o -> o.name().toLowerCase(Locale.ROOT)).collect(Collectors.joining(","))); + } if (nativeConfig.autoServiceLoaderRegistration()) { addExperimentalVMOption(nativeImageArgs, "-H:+UseServiceLoaderFeature");