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 | |
| 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')
| -rw-r--r-- | src/link/Coff.zig | 10 | ||||
| -rw-r--r-- | src/link/Elf.zig | 10 | ||||
| -rw-r--r-- | src/link/MachO.zig | 10 | ||||
| -rw-r--r-- | src/link/Wasm.zig | 8 |
4 files changed, 19 insertions, 19 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| { diff --git a/src/link/Elf.zig b/src/link/Elf.zig index a316a9c19e..4fcfe78901 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -1326,8 +1326,8 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { 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("ELF 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("ELF LLD new_digest={} readFile error: {}", .{ digest, @errorName(err) }); // Handle this as a cache miss. break :blk prev_digest_buf[0..0]; }; @@ -1647,10 +1647,10 @@ fn linkWithLLD(self: *Elf, 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| { diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 697e4f0be3..20fda846f5 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -419,8 +419,8 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void { 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("MachO 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("MachO LLD new_digest={} readFile error: {}", .{ digest, @errorName(err) }); // Handle this as a cache miss. break :blk prev_digest_buf[0..0]; }; @@ -674,10 +674,10 @@ fn linkWithLLD(self: *MachO, 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| { diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig index e4fd409a4d..320f90de19 100644 --- a/src/link/Wasm.zig +++ b/src/link/Wasm.zig @@ -310,8 +310,8 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void { 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("WASM 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("WASM LLD new_digest={} readFile error: {}", .{ digest, @errorName(err) }); // Handle this as a cache miss. break :blk prev_digest_buf[0..0]; }; @@ -424,9 +424,9 @@ fn linkWithLLD(self: *Wasm, 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| { + directory.handle.writeFile(id_symlink_basename, &digest) catch |err| { std.log.warn("failed to save linking hash digest symlink: {}", .{@errorName(err)}); }; // Again failure here only means an unnecessary cache miss. |
