diff options
| author | mlarouche <michael.larouche@gmail.com> | 2020-10-09 16:50:43 -0400 |
|---|---|---|
| committer | mlarouche <michael.larouche@gmail.com> | 2020-10-09 16:50:43 -0400 |
| commit | 57912964af0247a7aa940f76d09a8994d8fe1ec8 (patch) | |
| tree | 89d818f19130c03b55926d4b6beb927be9bc85c2 /src/link/Coff.zig | |
| parent | 04b0ffdd13e32be0ef5cc84983f8bb830db7520f (diff) | |
| download | zig-57912964af0247a7aa940f76d09a8994d8fe1ec8.tar.gz zig-57912964af0247a7aa940f76d09a8994d8fe1ec8.zip | |
Use regular file for caching stage 1 hash digest instead of symlink, fix zig build caching on Windows
Fix #6500
Diffstat (limited to 'src/link/Coff.zig')
| -rw-r--r-- | src/link/Coff.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/link/Coff.zig b/src/link/Coff.zig index 24c3833e0a..5c7975743f 100644 --- a/src/link/Coff.zig +++ b/src/link/Coff.zig @@ -854,8 +854,8 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void { _ = try man.hit(); digest = man.final(); var prev_digest_buf: [digest.len]u8 = undefined; - const prev_digest: []u8 = directory.handle.readLink(id_symlink_basename, &prev_digest_buf) catch |err| blk: { - log.debug("COFF LLD new_digest={} readlink error: {}", .{ digest, @errorName(err) }); + const prev_digest: []u8 = directory.handle.readFile(id_symlink_basename, &prev_digest_buf) catch |err| blk: { + log.debug("COFF LLD new_digest={} readFile error: {}", .{ digest, @errorName(err) }); // Handle this as a cache miss. break :blk prev_digest_buf[0..0]; }; @@ -1180,10 +1180,10 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void { } if (!self.base.options.disable_lld_caching) { - // Update the dangling symlink with the digest. If it fails we can continue; it only + // Update the dangling file with the digest. If it fails we can continue; it only // means that the next invocation will have an unnecessary cache miss. - directory.handle.symLink(&digest, id_symlink_basename, .{}) catch |err| { - std.log.warn("failed to save linking hash digest symlink: {}", .{@errorName(err)}); + directory.handle.writeFile(id_symlink_basename, &digest) catch |err| { + std.log.warn("failed to save linking hash digest file: {}", .{@errorName(err)}); }; // Again failure here only means an unnecessary cache miss. man.writeManifest() catch |err| { |
