diff options
| author | Robin Voetter <robin@voetter.nl> | 2024-08-18 14:35:03 +0200 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2024-08-19 19:09:12 +0200 |
| commit | b4343074d2d6ee81f8e589395a9c045031b86b83 (patch) | |
| tree | 514fad342ae16a032e1556dec827955334aee2ff /src/main.zig | |
| parent | 43f73af3595c3174b8e67e9f2792c3774f2192e9 (diff) | |
| download | zig-b4343074d2d6ee81f8e589395a9c045031b86b83.tar.gz zig-b4343074d2d6ee81f8e589395a9c045031b86b83.zip | |
replace Compilation.Emit with std.Build.Cache.Path
This type is exactly the same as std.Build.Cache.Path, except for
one function which is not used anymore. Therefore we can replace
it without consequences.
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.zig b/src/main.zig index 1a080224ee..1267baf9a9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -3519,7 +3519,7 @@ fn buildOutputType( if (test_exec_args.items.len == 0 and target.ofmt == .c) default_exec_args: { // Default to using `zig run` to execute the produced .c code from `zig test`. const c_code_loc = emit_bin_loc orelse break :default_exec_args; - const c_code_directory = c_code_loc.directory orelse comp.bin_file.?.emit.directory; + const c_code_directory = c_code_loc.directory orelse comp.bin_file.?.emit.root_dir; const c_code_path = try fs.path.join(arena, &[_][]const u8{ c_code_directory.path orelse ".", c_code_loc.basename, }); @@ -4256,7 +4256,7 @@ fn runOrTest( // A naive `directory.join` here will indeed get the correct path to the binary, // however, in the case of cwd, we actually want `./foo` so that the path can be executed. const exe_path = try fs.path.join(arena, &[_][]const u8{ - lf.emit.directory.path orelse ".", lf.emit.sub_path, + lf.emit.root_dir.path orelse ".", lf.emit.sub_path, }); var argv = std.ArrayList([]const u8).init(gpa); @@ -4368,7 +4368,7 @@ fn runOrTestHotSwap( // tmp zig-cache and use it to spawn the child process. This way we are free to update // the binary with each requested hot update. .windows => blk: { - try lf.emit.directory.handle.copyFile(lf.emit.sub_path, comp.local_cache_directory.handle, lf.emit.sub_path, .{}); + try lf.emit.root_dir.handle.copyFile(lf.emit.sub_path, comp.local_cache_directory.handle, lf.emit.sub_path, .{}); break :blk try fs.path.join(gpa, &[_][]const u8{ comp.local_cache_directory.path orelse ".", lf.emit.sub_path, }); @@ -4377,7 +4377,7 @@ fn runOrTestHotSwap( // A naive `directory.join` here will indeed get the correct path to the binary, // however, in the case of cwd, we actually want `./foo` so that the path can be executed. else => try fs.path.join(gpa, &[_][]const u8{ - lf.emit.directory.path orelse ".", lf.emit.sub_path, + lf.emit.root_dir.path orelse ".", lf.emit.sub_path, }), }; defer gpa.free(exe_path); |
