authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-29 16:58:23-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-29 23:50:20-07:00
logcc9463e45782e469f3d3282f9abc900fb3978d4e
treed4df3d9f66ed0ed6fdb8ece5b3db290ebea91f0d
parent3b2af05df10a92a0ce6ec70e2f926dfddc2d4ba9

Maker: avoid printing configure cmdline on compilation errors


2 files changed, 5 insertions(+), 1 deletions(-)

lib/compiler/Maker.zig+1
...@@ -1237,6 +1237,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {...@@ -1237,6 +1237,7 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig {
1237 .cache_manifest = &config_man,1237 .cache_manifest = &config_man,
1238 .arch_os_abi = target_arch_os_abi,1238 .arch_os_abi = target_arch_os_abi,
1239 .progress_node = compile_prog_node,1239 .progress_node = compile_prog_node,
1240 .skip_log_cmdline_on_compile_errors = !graph.verbose,
1240 })) |r| r.path else |err| return err;1241 })) |r| r.path else |err| return err;
1241 defer gpa.free(configure_exe_path.sub_path);1242 defer gpa.free(configure_exe_path.sub_path);
12421243
lib/std/zig.zig+4-1
...@@ -1637,6 +1637,7 @@ pub const BuildExeSubprocessOptions = struct {...@@ -1637,6 +1637,7 @@ pub const BuildExeSubprocessOptions = struct {
1637 arch_os_abi: ?[]const u8 = null,1637 arch_os_abi: ?[]const u8 = null,
1638 cpu_features: ?[]const u8 = null,1638 cpu_features: ?[]const u8 = null,
1639 progress_node: std.Progress.Node = .none,1639 progress_node: std.Progress.Node = .none,
1640 skip_log_cmdline_on_compile_errors: bool = false,
1640};1641};
16411642
1642pub const BuildExeSubprocessError = error{1643pub const BuildExeSubprocessError = error{
...@@ -1820,7 +1821,9 @@ pub fn buildExeSubprocess(...@@ -1820,7 +1821,9 @@ pub fn buildExeSubprocess(
1820 return error.AlreadyReported;1821 return error.AlreadyReported;
1821 },1822 },
1822 };1823 };
1823 log.err("command reported {d} compilation errors: {f}", .{ result_error_bundle.errorMessageCount(), cmd });1824 if (!options.skip_log_cmdline_on_compile_errors) log.err("command reported {d} compilation errors: {f}", .{
1825 result_error_bundle.errorMessageCount(), cmd,
1826 });
1824 if (received_fs_inputs) return error.FailedButCacheIntact;1827 if (received_fs_inputs) return error.FailedButCacheIntact;
1825 return error.AlreadyReported;1828 return error.AlreadyReported;
1826 }1829 }