From 28bcd7dbdda7fb2c2fe80dbdb5981479a04e973a Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Sat, 18 Dec 2021 00:57:23 +0100 Subject: [PATCH] os: disable unexpected error tracing on stage 2 builds The self-hosted compiler cannot yet deal with the print function that this field enables. It is not critical, however, and allows us to remove formatting from the list of neccesary features to implement to get the page allocator working. --- lib/std/os.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/std/os.zig b/lib/std/os.zig index e16a660741..1728c2ac0d 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -4968,7 +4968,11 @@ pub fn toPosixPath(file_path: []const u8) ![MAX_PATH_BYTES - 1:0]u8 { /// if this happens the fix is to add the error code to the corresponding /// switch expression, possibly introduce a new error in the error set, and /// send a patch to Zig. -pub const unexpected_error_tracing = builtin.mode == .Debug; +/// The self-hosted compiler is not fully capable of handle the related code. +/// Until then, unexpected error tracing is disabled for the self-hosted compiler. +/// TODO remove this once self-hosted is capable enough to handle printing and +/// stack trace dumping. +pub const unexpected_error_tracing = !builtin.zig_is_stage2 and builtin.mode == .Debug; pub const UnexpectedError = error{ /// The Operating System returned an undocumented error code.