From d0d135dbe2c7869a8705e98991a455611f49e310 Mon Sep 17 00:00:00 2001 From: Mac Malone Date: Fri, 27 Mar 2026 12:49:14 -0400 Subject: [PATCH] refactor: lake: log process output as info on errors (#13151) This PR changes `Lake.proc` to always log process output as `info` if the process exits with a nonzero return code. This way it behaves the same as `captureProc` on errors. --- src/lake/Lake/Util/Proc.lean | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lake/Lake/Util/Proc.lean b/src/lake/Lake/Util/Proc.lean index 46025384cc..bb84fc3d56 100644 --- a/src/lake/Lake/Util/Proc.lean +++ b/src/lake/Lake/Util/Proc.lean @@ -36,8 +36,10 @@ public def mkCmdLog (args : IO.Process.SpawnArgs) : String := public def proc (args : IO.Process.SpawnArgs) (quiet := false) : LogIO Unit := do withLogErrorPos do let out ← rawProc args - logOutput out (if quiet then logVerbose else logInfo) - if out.exitCode ≠ 0 then + if out.exitCode = 0 then + logOutput out (if quiet then logVerbose else logInfo) + else + logOutput out logInfo error s!"external command '{args.cmd}' exited with code {out.exitCode}" public def captureProc' (args : IO.Process.SpawnArgs) : LogIO (IO.Process.Output) := do