| ... | @@ -163,7 +163,6 @@ pub fn main(init: process.Init.Minimal) !void { | ... | @@ -163,7 +163,6 @@ pub fn main(init: process.Init.Minimal) !void { |
| 163 | | 163 | |
| 164 | var arena_instance: std.heap.ArenaAllocator = .init(std.heap.page_allocator); | 164 | var arena_instance: std.heap.ArenaAllocator = .init(std.heap.page_allocator); |
| 165 | defer arena_instance.deinit(); | 165 | defer arena_instance.deinit(); |
| 166 | defer if (debugMakerLeaks()) log.debug("used {Bi} of arena", .{arena_instance.queryCapacity()}); | | |
| 167 | const arena = arena_instance.allocator(); | 166 | const arena = arena_instance.allocator(); |
| 168 | | 167 | |
| 169 | const args = try init.args.toSlice(arena); | 168 | const args = try init.args.toSlice(arena); |
| ... | @@ -444,8 +443,6 @@ pub fn main(init: process.Init.Minimal) !void { | ... | @@ -444,8 +443,6 @@ pub fn main(init: process.Init.Minimal) !void { |
| 444 | } else if (mem.cutPrefix(u8, arg, "--debug-rt=")) |rest| { | 443 | } else if (mem.cutPrefix(u8, arg, "--debug-rt=")) |rest| { |
| 445 | graph.debug_compiler_runtime_libs = stringToEnum(std.lang.Optimize, rest) orelse | 444 | graph.debug_compiler_runtime_libs = stringToEnum(std.lang.Optimize, rest) orelse |
| 446 | fatal("unrecognized optimization mode: {s}", .{rest}); | 445 | fatal("unrecognized optimization mode: {s}", .{rest}); |
| 447 | } else if (is_debug_mode and mem.eql(u8, arg, "--debug-maker-leaks")) { | | |
| 448 | debug_maker_leaks = true; | | |
| 449 | } else if (mem.eql(u8, arg, "--libc-runtimes") or mem.eql(u8, arg, "--glibc-runtimes")) { | 446 | } else if (mem.eql(u8, arg, "--libc-runtimes") or mem.eql(u8, arg, "--glibc-runtimes")) { |
| 450 | // --glibc-runtimes was the old name of the flag; kept for compatibility for now. | 447 | // --glibc-runtimes was the old name of the flag; kept for compatibility for now. |
| 451 | graph.libc_runtimes_dir = nextArgOrFatal(args, &arg_i); | 448 | graph.libc_runtimes_dir = nextArgOrFatal(args, &arg_i); |
| ... | @@ -819,10 +816,7 @@ pub fn main(init: process.Init.Minimal) !void { | ... | @@ -819,10 +816,7 @@ pub fn main(init: process.Init.Minimal) !void { |
| 819 | .message => |payload| { | 816 | .message => |payload| { |
| 820 | const header: Client.Message.Header = try payload; | 817 | const header: Client.Message.Header = try payload; |
| 821 | switch (header.tag) { | 818 | switch (header.tag) { |
| 822 | .exit => { | 819 | .exit => return cleanExit(io, &scanned_config), |
| 823 | cleanExit(io, &scanned_config); | | |
| 824 | process.exit(0); | | |
| 825 | }, | | |
| 826 | .bsp_build_steps => { | 820 | .bsp_build_steps => { |
| 827 | // Cancel existing file watching | 821 | // Cancel existing file watching |
| 828 | select.cancelDiscard(); | 822 | select.cancelDiscard(); |
| ... | @@ -2550,8 +2544,7 @@ fn makeSteps( | ... | @@ -2550,8 +2544,7 @@ fn makeSteps( |
| 2550 | break :code 2; // failure; do not print build command | 2544 | break :code 2; // failure; do not print build command |
| 2551 | }; | 2545 | }; |
| 2552 | if (code == 0) { | 2546 | if (code == 0) { |
| 2553 | removePoisonedConfiguration(io, maker.scanned_config); | 2547 | return cleanExit(io, maker.scanned_config); |
| 2554 | if (debugMakerLeaks()) return; | | |
| 2555 | } | 2548 | } |
| 2556 | cleanup_task.await(io); // There is a defer above but an exit below. | 2549 | cleanup_task.await(io); // There is a defer above but an exit below. |
| 2557 | _ = io.lockStderr(&.{}, graph.stderr_mode) catch {}; | 2550 | _ = io.lockStderr(&.{}, graph.stderr_mode) catch {}; |
| ... | @@ -3639,11 +3632,6 @@ fn removePoisonedConfiguration(io: Io, scanned_config: *const ScannedConfig) voi | ... | @@ -3639,11 +3632,6 @@ fn removePoisonedConfiguration(io: Io, scanned_config: *const ScannedConfig) voi |
| 3639 | } | 3632 | } |
| 3640 | } | 3633 | } |
| 3641 | | 3634 | |
| 3642 | inline fn debugMakerLeaks() bool { | | |
| 3643 | if (!is_debug_mode) return false; | | |
| 3644 | return debug_maker_leaks; | | |
| 3645 | } | | |
| 3646 | | | |
| 3647 | const BuildRoot = struct { | 3635 | const BuildRoot = struct { |
| 3648 | directory: Cache.Directory, | 3636 | directory: Cache.Directory, |
| 3649 | close_directory: bool, | 3637 | close_directory: bool, |