stage2: use std.debug.Trace only when explicitly enabled

Because it bumps up the stack space requirements, which is making a test
case fail on aarch64 drone CI.
This commit is contained in:
Andrew Kelley 2022-06-09 15:33:04 -07:00
parent bc36da0cb8
commit 2bf532fc23
4 changed files with 7 additions and 1 deletions

View File

@ -131,6 +131,7 @@ pub fn build(b: *Builder) !void {
const link_libc = b.option(bool, "force-link-libc", "Force self-hosted compiler to link libc") orelse enable_llvm;
const strip = b.option(bool, "strip", "Omit debug information") orelse false;
const use_zig0 = b.option(bool, "zig0", "Bootstrap using zig0") orelse false;
const value_tracing = b.option(bool, "value-tracing", "Enable extra state tracking to help troubleshoot bugs in the compiler (using the std.debug.Trace API)") orelse false;
const mem_leak_frames: u32 = b.option(u32, "mem-leak-frames", "How many stack frames to print when a memory leak occurs. Tests get 2x this amount.") orelse blk: {
if (strip) break :blk @as(u32, 0);
@ -353,6 +354,7 @@ pub fn build(b: *Builder) !void {
exe_options.addOption(bool, "enable_tracy", tracy != null);
exe_options.addOption(bool, "enable_tracy_callstack", tracy_callstack);
exe_options.addOption(bool, "enable_tracy_allocation", tracy_allocation);
exe_options.addOption(bool, "value_tracing", value_tracing);
exe_options.addOption(bool, "is_stage1", is_stage1);
exe_options.addOption(bool, "omit_stage2", omit_stage2);
if (tracy) |tracy_path| {
@ -402,6 +404,7 @@ pub fn build(b: *Builder) !void {
test_cases_options.addOption(bool, "enable_rosetta", b.enable_rosetta);
test_cases_options.addOption(bool, "enable_darling", b.enable_darling);
test_cases_options.addOption(u32, "mem_leak_frames", mem_leak_frames * 2);
test_cases_options.addOption(bool, "value_tracing", value_tracing);
test_cases_options.addOption(?[]const u8, "glibc_runtimes_dir", b.glibc_runtimes_dir);
test_cases_options.addOption([:0]const u8, "version", try b.allocator.dupeZ(u8, version));
test_cases_options.addOption(std.SemanticVersion, "semver", semver);

View File

@ -99,6 +99,7 @@ pub fn build(b: *Builder) !void {
const force_gpa = b.option(bool, "force-gpa", "Force the compiler to use GeneralPurposeAllocator") orelse false;
const link_libc = b.option(bool, "force-link-libc", "Force self-hosted compiler to link libc") orelse enable_llvm;
const strip = b.option(bool, "strip", "Omit debug information") orelse false;
const value_tracing = b.option(bool, "value-tracing", "Enable extra state tracking to help troubleshoot bugs in the compiler (using the std.debug.Trace API)") orelse false;
const mem_leak_frames: u32 = b.option(u32, "mem-leak-frames", "How many stack frames to print when a memory leak occurs. Tests get 2x this amount.") orelse blk: {
if (strip) break :blk @as(u32, 0);
@ -303,6 +304,7 @@ pub fn build(b: *Builder) !void {
exe_options.addOption(bool, "enable_tracy", tracy != null);
exe_options.addOption(bool, "enable_tracy_callstack", tracy_callstack);
exe_options.addOption(bool, "enable_tracy_allocation", tracy_allocation);
exe_options.addOption(bool, "value_tracing", value_tracing);
exe_options.addOption(bool, "is_stage1", is_stage1);
exe_options.addOption(bool, "omit_stage2", omit_stage2);
if (tracy) |tracy_path| {

View File

@ -2531,7 +2531,7 @@ const TracedOffset = struct {
x: i32,
trace: std.debug.Trace = .{},
const want_tracing = std.debug.Trace.enabled;
const want_tracing = build_options.value_tracing;
};
/// Resolving a source location into a byte offset may require doing work

View File

@ -8,6 +8,7 @@ pub const semver = @import("std").SemanticVersion.parse(version) catch unreachab
pub const enable_logging: bool = @ZIG_ENABLE_LOGGING_BOOL@;
pub const enable_link_snapshots: bool = false;
pub const enable_tracy = false;
pub const value_tracing = false;
pub const is_stage1 = true;
pub const skip_non_native = false;
pub const omit_stage2: bool = @ZIG_OMIT_STAGE2_BOOL@;