diff --git a/ci/x86_64-linux-debug.sh b/ci/x86_64-linux-debug.sh index 91f6291d90b345139f394f4ee0c26bbe80a5ac57..0316d3bef37f4058d256c97b62ae0e212160aead 100755 --- a/ci/x86_64-linux-debug.sh +++ b/ci/x86_64-linux-debug.sh @@ -44,7 +44,7 @@ ninja install # Must be done after zig cc is finished. export ZIG_LIB_DIR="$PWD/../lib" -export ZIG_DEBUG_CMD=1 +export ZIG_DEBUG_MAKER=1 # simultaneously test building self-hosted without LLVM and with 32-bit arm stage3-debug/bin/zig build \ diff --git a/lib/std/zig.zig b/lib/std/zig.zig index c875663d67e028ecccfc6e5cac6a9647fc4d7d26..cf6a1c3eb8131de1c16e4bcd2d227460ab78e52a 100644 --- a/lib/std/zig.zig +++ b/lib/std/zig.zig @@ -782,6 +782,7 @@ pub const EnvVar = enum { ZIG_VERBOSE_LINK, ZIG_VERBOSE_CC, ZIG_DEBUG_CMD, + ZIG_DEBUG_MAKER, ZIG_IS_DETECTING_LIBC_PATHS, ZIG_IS_AVOIDING_CALLING_ITSELF, diff --git a/src/main.zig b/src/main.zig index 7ddb635c87944ffc2c40bcccd31fbc6eeed20eba..39652f0996e5ddc6e69d24e603006eed9646ca80 100644 --- a/src/main.zig +++ b/src/main.zig @@ -360,6 +360,7 @@ fn mainArgs( .prepend_global_cache_path = true, .prepend_zig_exe_path = true, .prepend_seed = true, + .debug_env_var = .ZIG_DEBUG_MAKER, }); }, .clang, .@"-cc1", .@"-cc1as" => { @@ -4873,6 +4874,7 @@ const JitCmdOptions = struct { capture: ?*[]u8 = null, /// Send error bundles via std.zig.Server over stdout server: bool = false, + debug_env_var: EnvVar = .ZIG_DEBUG_CMD, }; fn jitCmd( @@ -4923,7 +4925,7 @@ fn jitCmdInner( const self_exe_path = process.executablePathAlloc(io, arena) catch |err| fatal("unable to find self exe path: {t}", .{err}); - const optimize_mode: std.lang.OptimizeMode = if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map)) + const optimize_mode: std.lang.OptimizeMode = if (options.debug_env_var.isSet(environ_map)) .Debug else .ReleaseFast; @@ -5062,7 +5064,7 @@ fn jitCmdInner( child_argv.appendSliceAssumeCapacity(args); - if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map)) { + if (options.debug_env_var.isSet(environ_map)) { const cmd: std.zig.SubprocessCommand = .{ .argv = child_argv.items, };