diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-12-08 16:13:51 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-12-23 22:15:08 -0800 |
| commit | 9ccd68de0b79c3723bd11071fd836bc24ff25b33 (patch) | |
| tree | 3441f2a7030f40a6b625f4ff9fc7d719a60a32d3 /lib/std/Build.zig | |
| parent | 7f5bb118d4d90e2b883ee66e17592ac8d7808ac8 (diff) | |
| download | zig-9ccd68de0b79c3723bd11071fd836bc24ff25b33.tar.gz zig-9ccd68de0b79c3723bd11071fd836bc24ff25b33.zip | |
std: move abort and exit from posix into process
and delete the unit tests that called fork()
no forking allowed in the std lib, including unit tests, except to implement child process spawning.
Diffstat (limited to 'lib/std/Build.zig')
| -rw-r--r-- | lib/std/Build.zig | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/std/Build.zig b/lib/std/Build.zig index 3d0e8b8dbc..1eff8813e5 100644 --- a/lib/std/Build.zig +++ b/lib/std/Build.zig @@ -1706,7 +1706,7 @@ pub fn truncateFile(b: *Build, dest_path: []const u8) (Io.Dir.MakeError || Io.Di var src_file = cwd.createFile(io, dest_path, .{}) catch |err| switch (err) { error.FileNotFound => blk: { if (fs.path.dirname(dest_path)) |dirname| { - try cwd.makePath(dirname); + try cwd.makePath(io, dirname); } break :blk try cwd.createFile(io, dest_path, .{}); }, @@ -2634,13 +2634,12 @@ pub const InstallDir = union(enum) { /// source of API breakage in the future, so keep that in mind when using this /// function. pub fn makeTempPath(b: *Build) []const u8 { + const io = b.graph.io; const rand_int = std.crypto.random.int(u64); const tmp_dir_sub_path = "tmp" ++ fs.path.sep_str ++ std.fmt.hex(rand_int); const result_path = b.cache_root.join(b.allocator, &.{tmp_dir_sub_path}) catch @panic("OOM"); - b.cache_root.handle.makePath(tmp_dir_sub_path) catch |err| { - std.debug.print("unable to make tmp path '{s}': {s}\n", .{ - result_path, @errorName(err), - }); + b.cache_root.handle.makePath(io, tmp_dir_sub_path) catch |err| { + std.debug.print("unable to make tmp path '{s}': {t}\n", .{ result_path, err }); }; return result_path; } |
