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...@@ -44,7 +44,7 @@ ninja install
4444
45# Must be done after zig cc is finished.45# Must be done after zig cc is finished.
46export ZIG_LIB_DIR="$PWD/../lib"46export ZIG_LIB_DIR="$PWD/../lib"
47export ZIG_DEBUG_CMD=147export ZIG_DEBUG_MAKER=1
4848
49# simultaneously test building self-hosted without LLVM and with 32-bit arm49# simultaneously test building self-hosted without LLVM and with 32-bit arm
50stage3-debug/bin/zig build \50stage3-debug/bin/zig build \
lib/std/zig.zig+1
...@@ -782,6 +782,7 @@ pub const EnvVar = enum {...@@ -782,6 +782,7 @@ pub const EnvVar = enum {
782 ZIG_VERBOSE_LINK,782 ZIG_VERBOSE_LINK,
783 ZIG_VERBOSE_CC,783 ZIG_VERBOSE_CC,
784 ZIG_DEBUG_CMD,784 ZIG_DEBUG_CMD,
785 ZIG_DEBUG_MAKER,
785 ZIG_IS_DETECTING_LIBC_PATHS,786 ZIG_IS_DETECTING_LIBC_PATHS,
786 ZIG_IS_AVOIDING_CALLING_ITSELF,787 ZIG_IS_AVOIDING_CALLING_ITSELF,
787788
src/main.zig+4-2
...@@ -360,6 +360,7 @@ fn mainArgs(...@@ -360,6 +360,7 @@ fn mainArgs(
360 .prepend_global_cache_path = true,360 .prepend_global_cache_path = true,
361 .prepend_zig_exe_path = true,361 .prepend_zig_exe_path = true,
362 .prepend_seed = true,362 .prepend_seed = true,
363 .debug_env_var = .ZIG_DEBUG_MAKER,
363 });364 });
364 },365 },
365 .clang, .@"-cc1", .@"-cc1as" => {366 .clang, .@"-cc1", .@"-cc1as" => {
...@@ -4873,6 +4874,7 @@ const JitCmdOptions = struct {...@@ -4873,6 +4874,7 @@ const JitCmdOptions = struct {
4873 capture: ?*[]u8 = null,4874 capture: ?*[]u8 = null,
4874 /// Send error bundles via std.zig.Server over stdout4875 /// Send error bundles via std.zig.Server over stdout
4875 server: bool = false,4876 server: bool = false,
4877 debug_env_var: EnvVar = .ZIG_DEBUG_CMD,
4876};4878};
48774879
4878fn jitCmd(4880fn jitCmd(
...@@ -4923,7 +4925,7 @@ fn jitCmdInner(...@@ -4923,7 +4925,7 @@ fn jitCmdInner(
4923 const self_exe_path = process.executablePathAlloc(io, arena) catch |err|4925 const self_exe_path = process.executablePathAlloc(io, arena) catch |err|
4924 fatal("unable to find self exe path: {t}", .{err});4926 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))
4927 .Debug4929 .Debug
4928 else4930 else
4929 .ReleaseFast;4931 .ReleaseFast;
...@@ -5062,7 +5064,7 @@ fn jitCmdInner(...@@ -5062,7 +5064,7 @@ fn jitCmdInner(
50625064
5063 child_argv.appendSliceAssumeCapacity(args);5065 child_argv.appendSliceAssumeCapacity(args);
50645066
5065 if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map)) {5067 if (options.debug_env_var.isSet(environ_map)) {
5066 const cmd: std.zig.SubprocessCommand = .{5068 const cmd: std.zig.SubprocessCommand = .{
5067 .argv = child_argv.items,5069 .argv = child_argv.items,
5068 };5070 };