authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-06-11 22:00:41+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-06-12 17:51:31+01:00
logf9a670d46de3c62be16202f186eacfee6ec096d4
tree8f91214fd4ca521fcd7d882aa30da1a970359fe2
parentde69d6317516af95e09ca7a48484fa175b171d11
signaturelock-open Commit is signed but in an unrecognized format.

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.

1 files changed, 5 insertions(+), 0 deletions(-)

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