zig

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

commit f9a670d46de3c62be16202f186eacfee6ec096d4 (tree)
parent de69d6317516af95e09ca7a48484fa175b171d11
Author: mlugg <mlugg@mlugg.co.uk>
Date:   Wed, 11 Jun 2025 22:00:41 +0100

Compilation: prevent zig1 depending on fd_readdir

This isn't really coherent to model as a `Feature`; this makes sense
because of zig1's specific environment. As such, I opted to check
`dev.env` directly.

Diffstat:
Msrc/Compilation.zig | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -2589,6 +2589,11 @@ fn cleanupAfterUpdate(comp: *Compilation, tmp_dir_rand_int: u64) void { if (none.tmp_artifact_directory) |*tmp_dir| { tmp_dir.handle.close(); none.tmp_artifact_directory = null; + if (dev.env == .bootstrap) { + // zig1 uses `CacheMode.none`, but it doesn't need to know how to delete + // temporary directories; it doesn't have a real cache directory anyway. + return; + } const tmp_dir_sub_path = "tmp" ++ std.fs.path.sep_str ++ std.fmt.hex(tmp_dir_rand_int); comp.dirs.local_cache.handle.deleteTree(tmp_dir_sub_path) catch |err| { log.warn("failed to delete temporary directory '{s}{c}{s}': {s}", .{