zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit f996d28666e7d562b6a18e9f80fe31a3463456d0 (tree)
parent 017228de89ef2ea4ed229c4eea62317826a909b6
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Fri, 13 Feb 2026 17:05:21 -0800

fetch: use tmp dir inside zig-pkg/

Using the tmp dir of the local .zig-cache/ could result in
error.CrossDevice if the user chose a non-default local cache path.

closes #31148

Diffstat:
Msrc/Package/Fetch.zig | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig @@ -684,15 +684,13 @@ fn runResource( const arena = f.arena.allocator(); const eb = &f.error_bundle; - const s = fs.path.sep_str; - const local_cache_root = job_queue.local_cache; const rand_int = r: { var x: u64 = undefined; io.random(@ptrCast(&x)); break :r x; }; - const tmp_dir_sub_path = "tmp" ++ s ++ std.fmt.hex(rand_int); - const tmp_directory_path = try local_cache_root.join(arena, tmp_dir_sub_path); + const tmp_dir_sub_path = ".tmp-" ++ std.fmt.hex(rand_int); + const tmp_directory_path = try job_queue.root_pkg_path.join(arena, tmp_dir_sub_path); const package_sub_path = blk: { var tmp_directory: Cache.Directory = .{