From 9a53a9412a3f92c8101ccad6ed580297a7a08836 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Tue, 18 Jul 2023 12:39:59 +0300 Subject: [PATCH] Fail build when combining compression with remote-container-build Make clear to users that UPX compression is not yet supported when using remote-container-build. Relates to https://github.com/quarkusio/quarkus/issues/34638 --- .../quarkus/deployment/pkg/steps/UpxCompressionBuildStep.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/UpxCompressionBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/UpxCompressionBuildStep.java index c58500f1be332..d4eadf698f964 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/UpxCompressionBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/UpxCompressionBuildStep.java @@ -51,6 +51,10 @@ public void compress(NativeConfig nativeConfig, NativeImageRunnerBuildItem nativ if (!runUpxFromHost(upxPathFromSystem.get(), image.getPath().toFile(), nativeConfig)) { throw new IllegalStateException("Unable to compress the native executable"); } + } else if (nativeConfig.remoteContainerBuild()) { + log.errorf("Compression of native executables is not yet implemented for remote container builds."); + throw new IllegalStateException( + "Unable to compress the native executable: Compression of native executables is not yet supported for remote container builds"); } else if (nativeImageRunner.isContainerBuild()) { log.infof("Running UPX from a container using the builder image: " + effectiveBuilderImage); if (!runUpxInContainer(image, nativeConfig, effectiveBuilderImage)) {