From ec8e61e60ab4ea09a52eaed1ec0c41be66f9b5e1 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Fri, 9 Jan 2026 17:50:39 +0530 Subject: [PATCH] Fix podman-remote build output not being displayed The podman-remote build command was not displaying build output, causing remotesystem tests to fail when expecting output like "COMMIT", "cache", "Successfully built", etc. Root causes: 1. BuildOptions.Out was set to nil when no --logfile was specified, causing all build output to be discarded 2. BuildOptions.Err was not set, preventing auxiliary build output from being displayed Changes: - Set Out and Err to default to os.Stdout and os.Stderr respectively - Both redirect to logfile when --logfile is specified - Remove incorrect client-side quiet flag handling (already handled by build engine via Quiet option) This matches the behavior of the non-remote build implementation in build.go and ensures build output is properly streamed from the server through the bindings to the client's stdout/stderr. Fixes test failures in make remotesystem for build-related tests. Signed-off-by: Lokesh Mandvekar --- cmd/podman/images/build_remote.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/podman/images/build_remote.go b/cmd/podman/images/build_remote.go index e6f3803865..cf6c536eaf 100644 --- a/cmd/podman/images/build_remote.go +++ b/cmd/podman/images/build_remote.go @@ -363,6 +363,14 @@ func build(cmd *cobra.Command, args []string) error { defer logfile.Close() } + // Set output destinations: logfile if specified, otherwise stdout/stderr + stdout := os.Stdout + stderr := os.Stderr + if logfile != nil { + stdout = logfile + stderr = logfile + } + opts := entities.BuildOptions{ BuildOptions: buildahDefine.BuildOptions{ CommonBuildOpts: &buildahDefine.CommonBuildOptions{ @@ -376,11 +384,12 @@ func build(cmd *cobra.Command, args []string) error { AdditionalTags: tags, Args: buildArgs, ContextDirectory: contextDir, + Err: stderr, Excludes: excludes, ForceRmIntermediateCtrs: buildOpts.ForceRm, Layers: layers, NoCache: buildOpts.NoCache, - Out: logfile, + Out: stdout, Output: output, PullPolicy: pullPolicy, Quiet: buildOpts.Quiet, @@ -392,15 +401,11 @@ func build(cmd *cobra.Command, args []string) error { } // Call the engine to perform the build (which will use bindings for remote) - report, err := registry.ImageEngine().Build(registry.GetContext(), containerFiles, opts) + _, err := registry.ImageEngine().Build(registry.GetContext(), containerFiles, opts) if err != nil { return err } - if cmd.Flag("quiet").Changed { - fmt.Println(report.ID) - } - return nil }