| ... | ... | @@ -29,8 +29,10 @@ fn logImpl( |
| 29 | 29 | |
| 30 | 30 | pub fn main(init: std.process.Init) !void { |
| 31 | 31 | const fatal = std.process.fatal; |
| 32 | | const arena = init.arena; |
| 32 | const arena = init.arena.allocator(); |
| 33 | 33 | const io = init.io; |
| 34 | const env_map = init.env_map; |
| 35 | const cwd_path = try std.process.getCwdAlloc(arena); |
| 34 | 36 | |
| 35 | 37 | var opt_zig_exe: ?[]const u8 = null; |
| 36 | 38 | var opt_input_file_name: ?[]const u8 = null; |
| ... | ... | @@ -44,7 +46,7 @@ pub fn main(init: std.process.Init) !void { |
| 44 | 46 | |
| 45 | 47 | var debug_log_args: std.ArrayList([]const u8) = .empty; |
| 46 | 48 | |
| 47 | | var arg_it = try init.minimal.argsIterator(arena); |
| 49 | var arg_it = try init.minimal.args.iterateAllocator(arena); |
| 48 | 50 | _ = arg_it.skip(); |
| 49 | 51 | while (arg_it.next()) |arg| { |
| 50 | 52 | if (arg.len > 0 and arg[0] == '-') { |
| ... | ... | @@ -111,9 +113,9 @@ pub fn main(init: std.process.Init) !void { |
| 111 | 113 | } |
| 112 | 114 | |
| 113 | 115 | // Convert paths to be relative to the cwd of the subprocess. |
| 114 | | const resolved_zig_exe = try Dir.path.relative(arena, tmp_dir_path, zig_exe); |
| 116 | const resolved_zig_exe = try Dir.path.relative(arena, cwd_path, env_map, tmp_dir_path, zig_exe); |
| 115 | 117 | const opt_resolved_lib_dir = if (opt_lib_dir) |lib_dir| |
| 116 | | try Dir.path.relative(arena, tmp_dir_path, lib_dir) |
| 118 | try Dir.path.relative(arena, cwd_path, env_map, tmp_dir_path, lib_dir) |
| 117 | 119 | else |
| 118 | 120 | null; |
| 119 | 121 | |
| ... | ... | @@ -174,7 +176,7 @@ pub fn main(init: std.process.Init) !void { |
| 174 | 176 | var cc_child_args: std.ArrayList([]const u8) = .empty; |
| 175 | 177 | if (target.backend == .cbe) { |
| 176 | 178 | const resolved_cc_zig_exe = if (opt_cc_zig) |cc_zig_exe| |
| 177 | | try Dir.path.relative(arena, tmp_dir_path, cc_zig_exe) |
| 179 | try Dir.path.relative(arena, cwd_path, env_map, tmp_dir_path, cc_zig_exe) |
| 178 | 180 | else |
| 179 | 181 | resolved_zig_exe; |
| 180 | 182 | |
| ... | ... | @@ -193,7 +195,7 @@ pub fn main(init: std.process.Init) !void { |
| 193 | 195 | try cc_child_args.append(arena, "-o"); |
| 194 | 196 | } |
| 195 | 197 | |
| 196 | | var child = std.process.spawn(io, .{ |
| 198 | var child = try std.process.spawn(io, .{ |
| 197 | 199 | .argv = child_args.items, |
| 198 | 200 | .stdin = .pipe, |
| 199 | 201 | .stdout = .pipe, |
| ... | ... | @@ -644,7 +646,7 @@ const Eval = struct { |
| 644 | 646 | eval.tmp_dir.close(io); |
| 645 | 647 | if (!eval.preserve_tmp_on_fatal) { |
| 646 | 648 | // Kill the child since it holds an open handle to its CWD which is the tmp dir path |
| 647 | | _ = eval.child.kill(io) catch {}; |
| 649 | eval.child.kill(io); |
| 648 | 650 | Dir.cwd().deleteTree(io, eval.tmp_dir_path) catch |err| { |
| 649 | 651 | std.log.warn("failed to delete tree '{s}': {t}", .{ eval.tmp_dir_path, err }); |
| 650 | 652 | }; |