From 06e9ac5948ad0d90414ce30268c515cc6d6eac46 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 10 Aug 2022 11:35:13 +0300 Subject: [PATCH] Ensure that compressed binary used in Amazon Lambda function if present Fixes: #27208 (cherry picked from commit 5481675d6854474104d7199d842f8be02a95cb11) --- .../quarkus/amazon/lambda/deployment/FunctionZipProcessor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/amazon-lambda/common-deployment/src/main/java/io/quarkus/amazon/lambda/deployment/FunctionZipProcessor.java b/extensions/amazon-lambda/common-deployment/src/main/java/io/quarkus/amazon/lambda/deployment/FunctionZipProcessor.java index bcc32c6967a36..74d972cb7a8a8 100644 --- a/extensions/amazon-lambda/common-deployment/src/main/java/io/quarkus/amazon/lambda/deployment/FunctionZipProcessor.java +++ b/extensions/amazon-lambda/common-deployment/src/main/java/io/quarkus/amazon/lambda/deployment/FunctionZipProcessor.java @@ -6,6 +6,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Optional; import java.util.stream.Stream; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; @@ -22,6 +23,7 @@ import io.quarkus.deployment.pkg.builditem.LegacyJarRequiredBuildItem; import io.quarkus.deployment.pkg.builditem.NativeImageBuildItem; import io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem; +import io.quarkus.deployment.pkg.builditem.UpxCompressedBuildItem; import io.quarkus.deployment.pkg.steps.NativeBuild; /** @@ -103,6 +105,7 @@ public void jvmZip(OutputTargetBuildItem target, */ @BuildStep(onlyIf = { IsNormal.class, NativeBuild.class }) public void nativeZip(OutputTargetBuildItem target, + Optional upxCompressed, // used to ensure that we work with the compressed native binary if compression was enabled BuildProducer artifactResultProducer, NativeImageBuildItem nativeImage) throws Exception { Path zipDir = findNativeZipDir(target.getOutputDirectory());