diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildRemoteContainerRunner.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildRemoteContainerRunner.java index 67385a433cdbb..76a04542c3a88 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildRemoteContainerRunner.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildRemoteContainerRunner.java @@ -6,10 +6,14 @@ import java.nio.file.Path; import java.util.List; +import org.jboss.logging.Logger; + import io.quarkus.deployment.pkg.NativeConfig; public class NativeImageBuildRemoteContainerRunner extends NativeImageBuildContainerRunner { + private static final Logger log = Logger.getLogger(NativeImageBuildRemoteContainerRunner.class); + private final String nativeImageName; private String containerId; @@ -22,6 +26,7 @@ public NativeImageBuildRemoteContainerRunner(NativeConfig nativeConfig, Path out protected void preBuild(List buildArgs) throws InterruptedException, IOException { List containerRuntimeArgs = getContainerRuntimeBuildArgs(); String[] createContainerCommand = buildCommand("create", containerRuntimeArgs, buildArgs); + log.info(String.join(" ", createContainerCommand).replace("$", "\\$")); Process createContainerProcess = new ProcessBuilder(createContainerCommand).start(); createContainerProcess.waitFor(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(createContainerProcess.getInputStream()))) { @@ -29,6 +34,7 @@ protected void preBuild(List buildArgs) throws InterruptedException, IOE } String[] copyCommand = new String[] { containerRuntime.getExecutableName(), "cp", outputPath + "/.", containerId + ":" + NativeImageBuildStep.CONTAINER_BUILD_VOLUME_PATH }; + log.info(String.join(" ", copyCommand).replace("$", "\\$")); Process copyProcess = new ProcessBuilder(copyCommand).start(); copyProcess.waitFor(); super.preBuild(buildArgs); @@ -47,6 +53,7 @@ protected void postBuild() throws InterruptedException, IOException { } String[] removeCommand = new String[] { containerRuntime.getExecutableName(), "container", "rm", "--volumes", containerId }; + log.info(String.join(" ", removeCommand).replace("$", "\\$")); Process removeProcess = new ProcessBuilder(removeCommand).start(); removeProcess.waitFor(); } @@ -54,6 +61,7 @@ protected void postBuild() throws InterruptedException, IOException { private void copy(String path) throws IOException, InterruptedException { String[] copyCommand = new String[] { containerRuntime.getExecutableName(), "cp", containerId + ":" + NativeImageBuildStep.CONTAINER_BUILD_VOLUME_PATH + "/" + path, outputPath }; + log.info(String.join(" ", copyCommand).replace("$", "\\$")); Process copyProcess = new ProcessBuilder(copyCommand).start(); copyProcess.waitFor(); } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildRunner.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildRunner.java index af492ea1458cb..23c1f98e6c9a7 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildRunner.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildRunner.java @@ -12,11 +12,15 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import org.jboss.logging.Logger; + import io.quarkus.deployment.pkg.steps.NativeImageBuildStep.GraalVM; import io.quarkus.deployment.util.ProcessUtil; public abstract class NativeImageBuildRunner { + private static final Logger log = Logger.getLogger(NativeImageBuildRunner.class); + public GraalVM.Version getGraalVMVersion() { final GraalVM.Version graalVMVersion; try { @@ -46,8 +50,10 @@ public int build(List args, Path outputDir, boolean processInheritIODisa preBuild(args); try { CountDownLatch errorReportLatch = new CountDownLatch(1); - final ProcessBuilder processBuilder = new ProcessBuilder(getBuildCommand(args)) + final String[] buildCommand = getBuildCommand(args); + final ProcessBuilder processBuilder = new ProcessBuilder(buildCommand) .directory(outputDir.toFile()); + log.info(String.join(" ", buildCommand).replace("$", "\\$")); final Process process = ProcessUtil.launchProcessStreamStdOut(processBuilder, processInheritIODisabled); ExecutorService executor = Executors.newSingleThreadExecutor(); executor.submit(new ErrorReplacingProcessReader(process.getErrorStream(), outputDir.resolve("reports").toFile(), 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 85d8cd4da22ef..b00d58baae185 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 @@ -175,7 +175,6 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa List nativeImageArgs = commandAndExecutable.args; - log.info(String.join(" ", nativeImageArgs).replace("$", "\\$")); int exitCode = buildRunner.build(nativeImageArgs, outputDir, processInheritIODisabled.isPresent()); if (exitCode != 0) { throw imageGenerationFailed(exitCode, nativeImageArgs);