| ... | ... | @@ -1038,7 +1038,7 @@ fn buildOutputType( |
| 1038 | 1038 | } else if (mem.startsWith(u8, arg, "-")) { |
| 1039 | 1039 | if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { |
| 1040 | 1040 | try Io.File.stdout().writeStreamingAll(io, usage_build_generic); |
| 1041 | | return cleanExit(); |
| 1041 | return cleanExit(io); |
| 1042 | 1042 | } else if (mem.eql(u8, arg, "--")) { |
| 1043 | 1043 | if (arg_mode == .run) { |
| 1044 | 1044 | // args_iter.i is 1, referring the next arg after "--" in ["--", ...] |
| ... | ... | @@ -3646,7 +3646,7 @@ fn buildOutputType( |
| 3646 | 3646 | all_args, |
| 3647 | 3647 | runtime_args_start, |
| 3648 | 3648 | ); |
| 3649 | | return cleanExit(); |
| 3649 | return cleanExit(io); |
| 3650 | 3650 | }, |
| 3651 | 3651 | .ip4 => |ip4_addr| { |
| 3652 | 3652 | const addr: Io.net.IpAddress = .{ .ip4 = ip4_addr }; |
| ... | ... | @@ -3672,7 +3672,7 @@ fn buildOutputType( |
| 3672 | 3672 | all_args, |
| 3673 | 3673 | runtime_args_start, |
| 3674 | 3674 | ); |
| 3675 | | return cleanExit(); |
| 3675 | return cleanExit(io); |
| 3676 | 3676 | }, |
| 3677 | 3677 | } |
| 3678 | 3678 | |
| ... | ... | @@ -3755,7 +3755,7 @@ fn buildOutputType( |
| 3755 | 3755 | } |
| 3756 | 3756 | |
| 3757 | 3757 | // Skip resource deallocation in release builds; let the OS do it. |
| 3758 | | return cleanExit(); |
| 3758 | return cleanExit(io); |
| 3759 | 3759 | } |
| 3760 | 3760 | |
| 3761 | 3761 | const CreateModule = struct { |
| ... | ... | @@ -4176,7 +4176,7 @@ fn serve( |
| 4176 | 4176 | defer if (comp.debugIncremental()) ids.mutex.unlock(io); |
| 4177 | 4177 | |
| 4178 | 4178 | switch (hdr.tag) { |
| 4179 | | .exit => return cleanExit(), |
| 4179 | .exit => return cleanExit(io), |
| 4180 | 4180 | .update => { |
| 4181 | 4181 | tracy.frameMark(); |
| 4182 | 4182 | file_system_inputs.clearRetainingCapacity(); |
| ... | ... | @@ -4462,7 +4462,7 @@ fn runOrTest( |
| 4462 | 4462 | switch (term) { |
| 4463 | 4463 | .Exited => |code| { |
| 4464 | 4464 | if (code == 0) { |
| 4465 | | return cleanExit(); |
| 4465 | return cleanExit(io); |
| 4466 | 4466 | } else { |
| 4467 | 4467 | process.exit(code); |
| 4468 | 4468 | } |
| ... | ... | @@ -4476,7 +4476,7 @@ fn runOrTest( |
| 4476 | 4476 | switch (term) { |
| 4477 | 4477 | .Exited => |code| { |
| 4478 | 4478 | if (code == 0) { |
| 4479 | | return cleanExit(); |
| 4479 | return cleanExit(io); |
| 4480 | 4480 | } else { |
| 4481 | 4481 | const cmd = try std.mem.join(arena, " ", argv.items); |
| 4482 | 4482 | fatal("the following test command failed with exit code {d}:\n{s}", .{ code, cmd }); |
| ... | ... | @@ -4688,7 +4688,7 @@ fn cmdTranslateC( |
| 4688 | 4688 | var file_reader = zig_file.reader(io, &.{}); |
| 4689 | 4689 | _ = try stdout_writer.interface.sendFileAll(&file_reader, .unlimited); |
| 4690 | 4690 | try stdout_writer.interface.flush(); |
| 4691 | | return cleanExit(); |
| 4691 | return cleanExit(io); |
| 4692 | 4692 | } |
| 4693 | 4693 | } |
| 4694 | 4694 | |
| ... | ... | @@ -4735,7 +4735,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8) ! |
| 4735 | 4735 | template = .minimal; |
| 4736 | 4736 | } else if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { |
| 4737 | 4737 | try Io.File.stdout().writeStreamingAll(io, usage_init); |
| 4738 | | return cleanExit(); |
| 4738 | return cleanExit(io); |
| 4739 | 4739 | } else { |
| 4740 | 4740 | fatal("unrecognized parameter: '{s}'", .{arg}); |
| 4741 | 4741 | } |
| ... | ... | @@ -4780,7 +4780,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8) ! |
| 4780 | 4780 | if (ok_count == template_paths.len) { |
| 4781 | 4781 | std.log.info("see `zig build --help` for a menu of options", .{}); |
| 4782 | 4782 | } |
| 4783 | | return cleanExit(); |
| 4783 | return cleanExit(io); |
| 4784 | 4784 | }, |
| 4785 | 4785 | .minimal => { |
| 4786 | 4786 | writeSimpleTemplateFile(io, Package.Manifest.basename, |
| ... | ... | @@ -4813,11 +4813,11 @@ fn cmdInit(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8) ! |
| 4813 | 4813 | // their `build.zig.zon` *after* writing their `build.zig`. So this one isn't fatal. |
| 4814 | 4814 | error.PathAlreadyExists => { |
| 4815 | 4815 | std.log.info("successfully populated '{s}', preserving existing '{s}'", .{ Package.Manifest.basename, Package.build_zig_basename }); |
| 4816 | | return cleanExit(); |
| 4816 | return cleanExit(io); |
| 4817 | 4817 | }, |
| 4818 | 4818 | }; |
| 4819 | 4819 | std.log.info("successfully populated '{s}' and '{s}'", .{ Package.Manifest.basename, Package.build_zig_basename }); |
| 4820 | | return cleanExit(); |
| 4820 | return cleanExit(io); |
| 4821 | 4821 | }, |
| 4822 | 4822 | } |
| 4823 | 4823 | } |
| ... | ... | @@ -5284,7 +5284,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8) |
| 5284 | 5284 | process.exit(1); |
| 5285 | 5285 | } |
| 5286 | 5286 | |
| 5287 | | if (fetch_only) return cleanExit(); |
| 5287 | if (fetch_only) return cleanExit(io); |
| 5288 | 5288 | |
| 5289 | 5289 | var source_buf = std.array_list.Managed(u8).init(gpa); |
| 5290 | 5290 | defer source_buf.deinit(); |
| ... | ... | @@ -5420,7 +5420,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8) |
| 5420 | 5420 | |
| 5421 | 5421 | switch (term) { |
| 5422 | 5422 | .Exited => |code| { |
| 5423 | | if (code == 0) return cleanExit(); |
| 5423 | if (code == 0) return cleanExit(io); |
| 5424 | 5424 | // Indicates that the build runner has reported compile errors |
| 5425 | 5425 | // and this parent process does not need to report any further |
| 5426 | 5426 | // diagnostics. |
| ... | ... | @@ -5691,7 +5691,7 @@ fn jitCmd( |
| 5691 | 5691 | .Exited => |code| { |
| 5692 | 5692 | if (code == 0) { |
| 5693 | 5693 | if (options.capture != null) return; |
| 5694 | | return cleanExit(); |
| 5694 | return cleanExit(io); |
| 5695 | 5695 | } |
| 5696 | 5696 | const cmd = try std.mem.join(arena, " ", child_argv.items); |
| 5697 | 5697 | fatal("the following build command failed with exit code {d}:\n{s}", .{ code, cmd }); |
| ... | ... | @@ -6151,7 +6151,7 @@ fn cmdAstCheck(arena: Allocator, io: Io, args: []const []const u8) !void { |
| 6151 | 6151 | if (mem.startsWith(u8, arg, "-")) { |
| 6152 | 6152 | if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { |
| 6153 | 6153 | try Io.File.stdout().writeStreamingAll(io, usage_ast_check); |
| 6154 | | return cleanExit(); |
| 6154 | return cleanExit(io); |
| 6155 | 6155 | } else if (mem.eql(u8, arg, "-t")) { |
| 6156 | 6156 | want_output_text = true; |
| 6157 | 6157 | } else if (mem.eql(u8, arg, "--zon")) { |
| ... | ... | @@ -6222,7 +6222,7 @@ fn cmdAstCheck(arena: Allocator, io: Io, args: []const []const u8) !void { |
| 6222 | 6222 | if (zir.hasCompileErrors()) { |
| 6223 | 6223 | process.exit(1); |
| 6224 | 6224 | } else { |
| 6225 | | return cleanExit(); |
| 6225 | return cleanExit(io); |
| 6226 | 6226 | } |
| 6227 | 6227 | } |
| 6228 | 6228 | if (!build_options.enable_debug_extensions) { |
| ... | ... | @@ -6273,7 +6273,7 @@ fn cmdAstCheck(arena: Allocator, io: Io, args: []const []const u8) !void { |
| 6273 | 6273 | if (zir.hasCompileErrors()) { |
| 6274 | 6274 | process.exit(1); |
| 6275 | 6275 | } else { |
| 6276 | | return cleanExit(); |
| 6276 | return cleanExit(io); |
| 6277 | 6277 | } |
| 6278 | 6278 | }, |
| 6279 | 6279 | .zon => { |
| ... | ... | @@ -6288,7 +6288,7 @@ fn cmdAstCheck(arena: Allocator, io: Io, args: []const []const u8) !void { |
| 6288 | 6288 | } |
| 6289 | 6289 | |
| 6290 | 6290 | if (!want_output_text) { |
| 6291 | | return cleanExit(); |
| 6291 | return cleanExit(io); |
| 6292 | 6292 | } |
| 6293 | 6293 | |
| 6294 | 6294 | if (!build_options.enable_debug_extensions) { |
| ... | ... | @@ -6297,7 +6297,7 @@ fn cmdAstCheck(arena: Allocator, io: Io, args: []const []const u8) !void { |
| 6297 | 6297 | |
| 6298 | 6298 | try @import("print_zoir.zig").renderToWriter(zoir, arena, stdout_bw); |
| 6299 | 6299 | try stdout_bw.flush(); |
| 6300 | | return cleanExit(); |
| 6300 | return cleanExit(io); |
| 6301 | 6301 | }, |
| 6302 | 6302 | } |
| 6303 | 6303 | } |
| ... | ... | @@ -6325,7 +6325,7 @@ fn cmdDetectCpu(io: Io, args: []const []const u8) !void { |
| 6325 | 6325 | if (mem.startsWith(u8, arg, "-")) { |
| 6326 | 6326 | if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { |
| 6327 | 6327 | try Io.File.stdout().writeStreamingAll(io, detect_cpu_usage); |
| 6328 | | return cleanExit(); |
| 6328 | return cleanExit(io); |
| 6329 | 6329 | } else if (mem.eql(u8, arg, "--llvm")) { |
| 6330 | 6330 | use_llvm = true; |
| 6331 | 6331 | } else { |
| ... | ... | @@ -6475,7 +6475,7 @@ fn cmdDumpLlvmInts( |
| 6475 | 6475 | } |
| 6476 | 6476 | try stdout_bw.flush(); |
| 6477 | 6477 | |
| 6478 | | return cleanExit(); |
| 6478 | return cleanExit(io); |
| 6479 | 6479 | } |
| 6480 | 6480 | |
| 6481 | 6481 | /// This is only enabled for debug builds. |
| ... | ... | @@ -6909,7 +6909,7 @@ fn cmdFetch( |
| 6909 | 6909 | if (mem.startsWith(u8, arg, "-")) { |
| 6910 | 6910 | if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { |
| 6911 | 6911 | try Io.File.stdout().writeStreamingAll(io, usage_fetch); |
| 6912 | | return cleanExit(); |
| 6912 | return cleanExit(io); |
| 6913 | 6913 | } else if (mem.eql(u8, arg, "--global-cache-dir")) { |
| 6914 | 6914 | if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg}); |
| 6915 | 6915 | i += 1; |
| ... | ... | @@ -7020,7 +7020,7 @@ fn cmdFetch( |
| 7020 | 7020 | var stdout = Io.File.stdout().writerStreaming(io, &stdout_buffer); |
| 7021 | 7021 | try stdout.interface.print("{s}\n", .{package_hash_slice}); |
| 7022 | 7022 | try stdout.interface.flush(); |
| 7023 | | return cleanExit(); |
| 7023 | return cleanExit(io); |
| 7024 | 7024 | }, |
| 7025 | 7025 | .yes, .exact => |name| name: { |
| 7026 | 7026 | if (name) |n| break :name n; |
| ... | ... | @@ -7159,7 +7159,7 @@ fn cmdFetch( |
| 7159 | 7159 | fatal("unable to write {s} file: {t}", .{ Package.Manifest.basename, err }); |
| 7160 | 7160 | }; |
| 7161 | 7161 | |
| 7162 | | return cleanExit(); |
| 7162 | return cleanExit(io); |
| 7163 | 7163 | } |
| 7164 | 7164 | |
| 7165 | 7165 | fn createEmptyDependenciesModule( |