From 6d280dc1b0779209b4790da9e939d8254d11348a Mon Sep 17 00:00:00 2001 From: Matthew Lugg Date: Mon, 10 Nov 2025 12:55:39 +0000 Subject: [PATCH 1/2] compiler: update logFn to use color To match the new default implementation. In fact, I implemented this by simply dispatching *to* the default implementation after the debug log guard; no need to complicate things! --- src/main.zig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.zig b/src/main.zig index 9606bf2c30..0f2a0a225c 100644 --- a/src/main.zig +++ b/src/main.zig @@ -155,11 +155,8 @@ pub fn log( } else return; } - const prefix1 = comptime level.asText(); - const prefix2 = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): "; - - // Print the message to stderr, silently ignoring any errors - std.debug.print(prefix1 ++ prefix2 ++ format ++ "\n", args); + // Otherwise, use the default implementation. + std.log.defaultLog(level, scope, format, args); } var debug_allocator: std.heap.DebugAllocator(.{ From 13993c4f62d8603aa5a25de70e2d111a01cbfaab Mon Sep 17 00:00:00 2001 From: Matthew Lugg Date: Mon, 10 Nov 2025 12:56:35 +0000 Subject: [PATCH 2/2] compiler: warn when using -fincremental with LLVM backend This configuration hasn't had much work put into it yet, so is all but guaranteed to miscompile or crash. Since users are starting to try out `-fincremental`, and LLVM is still the default backend in many cases, it's worth having this warning to avoid bug reports like https://github.com/ziglang/zig/issues/25873. --- src/main.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.zig b/src/main.zig index 0f2a0a225c..52bb4b9c4e 100644 --- a/src/main.zig +++ b/src/main.zig @@ -3360,6 +3360,10 @@ fn buildOutputType( fatal("--debug-incremental requires -fincremental", .{}); } + if (incremental and create_module.resolved_options.use_llvm) { + warn("-fincremental is currently unsupported by the LLVM backend; crashes or miscompilations are likely", .{}); + } + const cache_mode: Compilation.CacheMode = b: { // Once incremental compilation is the default, we'll want some smarter logic here, // considering things like the backend in use and whether there's a ZCU.