From 52623fe7eff5d5be14bce44a25ce41c7ea7d2823 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Thu, 20 Aug 2026 09:59:24 +0800 Subject: [PATCH] chore: don't let cargo's build progress show up as a "failed command" Cargo prints its progress to stderr. Zig's build sees the stderr content and prints it as a "failed command: ...". Capture cargo's stderr to silence this fake-error. A status != 0 still causes the error to be printed. --- build.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.zig b/build.zig index 7ccff15f7..ec613c997 100644 --- a/build.zig +++ b/build.zig @@ -347,6 +347,10 @@ fn linkHtml5Ever(b: *Build, mod: *Build.Module) void { exec_cargo.addFileInput(b.path(path)); } + // don't let cargo's progress report (sent to stderr) cause Zig's build to + // print a 'failed command: ...' message. (non-zero status still outputs the error) + _ = exec_cargo.captureStdErr(.{}); + // TODO: We can prefer `--artifact-dir` once it become stable. const out_dir = exec_cargo.addPrefixedOutputDirectoryArg("--target-dir=", "html5ever");