From 74931fe25cdd94e1cd08b5ece9dcce19959bc079 Mon Sep 17 00:00:00 2001 From: Matthew Lugg Date: Tue, 28 Oct 2025 12:42:05 +0000 Subject: std.debug.lockStderrWriter: also return ttyconf `std.Io.tty.Config.detect` may be an expensive check (e.g. involving syscalls), and doing it every time we need to print isn't really necessary; under normal usage, we can compute the value once and cache it for the whole program's execution. Since anyone outputting to stderr may reasonably want this information (in fact they are very likely to), it makes sense to cache it and return it from `lockStderrWriter`. Call sites who do not need it will experience no significant overhead, and can just ignore the TTY config with a `const w, _` destructure. --- src/link.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/link.zig') diff --git a/src/link.zig b/src/link.zig index 7cf8e5c1a6..5c4354411b 100644 --- a/src/link.zig +++ b/src/link.zig @@ -2215,7 +2215,7 @@ fn resolvePathInputLib( var error_bundle = try wip_errors.toOwnedBundle(""); defer error_bundle.deinit(gpa); - error_bundle.renderToStdErr(color.renderOptions()); + error_bundle.renderToStdErr(.{}, color); std.process.exit(1); } -- cgit v1.2.3