From ba293eb820e5c2f62ac7a8ef623d8bffde3dc4f1 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 11 Feb 2026 10:44:04 -0800 Subject: [PATCH] Revert "compiler: override debug_io in release + evented mode" This reverts commit 68403267117bf5cf73e0f747887f2834336ae4a2. The commit bungled deinitialization in main. --- lib/std/debug/ElfFile.zig | 6 +----- src/main.zig | 19 +++++-------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/lib/std/debug/ElfFile.zig b/lib/std/debug/ElfFile.zig index 6d8ed0bdce85ee7b0fdaca22a2247fc767a8ef8e..892510601591bc305a0331dea4a95e0992f65765 100644 --- a/lib/std/debug/ElfFile.zig +++ b/lib/std/debug/ElfFile.zig @@ -86,11 +86,7 @@ pub const DebugInfoSearchPaths = struct { }, .exe_dir = std.fs.path.dirname(exe_path) orelse ".", }; - return .{ - .debuginfod_client = null, - .global_debug = &.{"/usr/lib/debug"}, - .exe_dir = std.fs.path.dirname(exe_path) orelse ".", - }; + @compileError("std.Options.elf_debug_info_search_paths must be provided"); } }; diff --git a/src/main.zig b/src/main.zig index c49bb0f03393702eca6ab03af27cf6f97fd03603..82a1fcf0503c1c88eb074d4334d85ebd00cfa30a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -51,17 +51,6 @@ pub const std_options: std.Options = .{ }, }; pub const std_options_cwd = if (native_os == .wasi) wasi_cwd else null; -pub const std_options_debug_threaded_io: ?*Io.Threaded = switch (build_options.io_mode) { - .threaded => &io_impl, - .evented => switch (builtin.mode) { - .Debug => Io.Threaded.global_single_threaded, - .ReleaseFast, .ReleaseSmall, .ReleaseSafe => null, - }, -}; -pub const std_options_debug_io: Io = switch (build_options.io_mode) { - .threaded => io_impl.ioBasic(), - .evented => io_impl.io(), -}; pub const debug = struct { pub fn printCrashContext(terminal: Io.Terminal) void { @@ -200,6 +189,7 @@ pub fn main(init: std.process.Init.Minimal) anyerror!void { var root_allocator: RootAllocator = .init; defer _ = root_allocator.deinit(); const root_gpa = root_allocator.allocator(); + var io_impl: IoImpl = undefined; switch (build_options.io_mode) { .threaded => io_impl = .init(root_gpa, .{ .stack_size = thread_stack_size, @@ -215,6 +205,7 @@ pub fn main(init: std.process.Init.Minimal) anyerror!void { }), } defer io_impl.deinit(); + io_impl_ptr = &io_impl; const io = io_impl.io(); const gpa = switch (build_options.io_mode) { .threaded => root_gpa, @@ -7824,7 +7815,7 @@ const IoImpl = switch (build_options.io_mode) { .threaded => Io.Threaded, .evented => Io.Evented, }; -var io_impl: IoImpl = undefined; +var io_impl_ptr: *IoImpl = undefined; fn setThreadLimit(arena: std.mem.Allocator, n: usize) Allocator.Error!void { switch (build_options.io_mode) { .threaded => { @@ -7833,8 +7824,8 @@ fn setThreadLimit(arena: std.mem.Allocator, n: usize) Allocator.Error!void { // linker can run concurrently, so we need to set both the async *and* the // concurrency limit. const limit: Io.Limit = .limited(n - 1); - io_impl.setAsyncLimit(limit); - io_impl.concurrent_limit = limit; + io_impl_ptr.setAsyncLimit(limit); + io_impl_ptr.concurrent_limit = limit; }, .evented => {}, } -- 2.54.0