authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-25 13:30:38-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-29 23:50:20-07:00
logf7e36077e4c616f0560c13bcc80ab056ecf71859
tree3913257c5f0046c52a21053bd6059ac34be749ce
parent0959167e8161b5b19c1ad836aa35778dc9357c17

maker gets its own ZIG_DEBUG_MAKER env var

it can be useful to only set this and not the other one, or vice versa

3 files changed, 6 insertions(+), 3 deletions(-)

ci/x86_64-linux-debug.sh+1-1
......@@ -44,7 +44,7 @@ ninja install
4444
4545# Must be done after zig cc is finished.
4646export ZIG_LIB_DIR="$PWD/../lib"
47export ZIG_DEBUG_CMD=1
47export ZIG_DEBUG_MAKER=1
4848
4949# simultaneously test building self-hosted without LLVM and with 32-bit arm
5050stage3-debug/bin/zig build \
lib/std/zig.zig+1
......@@ -782,6 +782,7 @@ pub const EnvVar = enum {
782782 ZIG_VERBOSE_LINK,
783783 ZIG_VERBOSE_CC,
784784 ZIG_DEBUG_CMD,
785 ZIG_DEBUG_MAKER,
785786 ZIG_IS_DETECTING_LIBC_PATHS,
786787 ZIG_IS_AVOIDING_CALLING_ITSELF,
787788
src/main.zig+4-2
......@@ -360,6 +360,7 @@ fn mainArgs(
360360 .prepend_global_cache_path = true,
361361 .prepend_zig_exe_path = true,
362362 .prepend_seed = true,
363 .debug_env_var = .ZIG_DEBUG_MAKER,
363364 });
364365 },
365366 .clang, .@"-cc1", .@"-cc1as" => {
......@@ -4873,6 +4874,7 @@ const JitCmdOptions = struct {
48734874 capture: ?*[]u8 = null,
48744875 /// Send error bundles via std.zig.Server over stdout
48754876 server: bool = false,
4877 debug_env_var: EnvVar = .ZIG_DEBUG_CMD,
48764878};
48774879
48784880fn jitCmd(
......@@ -4923,7 +4925,7 @@ fn jitCmdInner(
49234925 const self_exe_path = process.executablePathAlloc(io, arena) catch |err|
49244926 fatal("unable to find self exe path: {t}", .{err});
49254927
4926 const optimize_mode: std.lang.OptimizeMode = if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map))
4928 const optimize_mode: std.lang.OptimizeMode = if (options.debug_env_var.isSet(environ_map))
49274929 .Debug
49284930 else
49294931 .ReleaseFast;
......@@ -5062,7 +5064,7 @@ fn jitCmdInner(
50625064
50635065 child_argv.appendSliceAssumeCapacity(args);
50645066
5065 if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map)) {
5067 if (options.debug_env_var.isSet(environ_map)) {
50665068 const cmd: std.zig.SubprocessCommand = .{
50675069 .argv = child_argv.items,
50685070 };