| ... | @@ -2828,11 +2828,6 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE | ... | @@ -2828,11 +2828,6 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE |
| 2828 | }); | 2828 | }); |
| 2829 | }, | 2829 | }, |
| 2830 | }, | 2830 | }, |
| 2831 | error.InvalidFormat => return comp.setMiscFailure( | | |
| 2832 | .check_whole_cache, | | |
| 2833 | "failed to check cache: invalid manifest file format", | | |
| 2834 | .{}, | | |
| 2835 | ), | | |
| 2836 | }; | 2831 | }; |
| 2837 | if (status == .hit and !ignore_hit) { | 2832 | if (status == .hit and !ignore_hit) { |
| 2838 | // In this case the cache hit contains the full set of file system inputs. Nice! | 2833 | // In this case the cache hit contains the full set of file system inputs. Nice! |
| ... | @@ -2845,7 +2840,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE | ... | @@ -2845,7 +2840,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE |
| 2845 | | 2840 | |
| 2846 | comp.last_update_was_cache_hit = true; | 2841 | comp.last_update_was_cache_hit = true; |
| 2847 | log.debug("CacheMode.whole cache hit for {s}", .{comp.root_name}); | 2842 | log.debug("CacheMode.whole cache hit for {s}", .{comp.root_name}); |
| 2848 | const bin_digest = man.finalBin(); | 2843 | const bin_digest = man.hitDigest(); |
| 2849 | | 2844 | |
| 2850 | comp.digest = bin_digest; | 2845 | comp.digest = bin_digest; |
| 2851 | | 2846 | |
| ... | @@ -3054,7 +3049,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE | ... | @@ -3054,7 +3049,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE |
| 3054 | try man.populateOtherManifest(pwc.manifest, pwc.prefix_map); | 3049 | try man.populateOtherManifest(pwc.manifest, pwc.prefix_map); |
| 3055 | } | 3050 | } |
| 3056 | | 3051 | |
| 3057 | const bin_digest = man.finalBin(); | 3052 | const bin_digest = man.missDigest(); |
| 3058 | const hex_digest = Cache.binToHex(bin_digest); | 3053 | const hex_digest = Cache.binToHex(bin_digest); |
| 3059 | | 3054 | |
| 3060 | // Work around windows `AccessDenied` if any files within this | 3055 | // Work around windows `AccessDenied` if any files within this |
| ... | @@ -5125,9 +5120,9 @@ pub fn translateC( | ... | @@ -5125,9 +5120,9 @@ pub fn translateC( |
| 5125 | var reader: std.Io.Reader = .fixed(stdout); | 5120 | var reader: std.Io.Reader = .fixed(stdout); |
| 5126 | const MessageHeader = std.zig.Server.Message.Header; | 5121 | const MessageHeader = std.zig.Server.Message.Header; |
| 5127 | const header = reader.takeStruct(MessageHeader, .little) catch |err| | 5122 | const header = reader.takeStruct(MessageHeader, .little) catch |err| |
| 5128 | fatal("unable to read translate-c MessageHeader: {s}", .{@errorName(err)}); | 5123 | fatal("unable to read translate-c MessageHeader: {t}", .{err}); |
| 5129 | const body = reader.take(header.bytes_len) catch |err| | 5124 | const body = reader.take(header.bytes_len) catch |err| |
| 5130 | fatal("unable to read {}-byte translate-c message body: {s}", .{ header.bytes_len, @errorName(err) }); | 5125 | fatal("unable to read {d}-byte translate-c message body: {t}", .{ header.bytes_len, err }); |
| 5131 | switch (header.tag) { | 5126 | switch (header.tag) { |
| 5132 | .error_bundle => { | 5127 | .error_bundle => { |
| 5133 | const error_bundle = try std.zig.Server.allocErrorBundle(gpa, body); | 5128 | const error_bundle = try std.zig.Server.allocErrorBundle(gpa, body); |
| ... | @@ -5137,11 +5132,11 @@ pub fn translateC( | ... | @@ -5137,11 +5132,11 @@ pub fn translateC( |
| 5137 | .errors = error_bundle, | 5132 | .errors = error_bundle, |
| 5138 | }; | 5133 | }; |
| 5139 | }, | 5134 | }, |
| 5140 | else => fatal("unexpected message type received from translate-c: {s}", .{@tagName(header.tag)}), | 5135 | else => fatal("unexpected message type received from translate-c: {t}", .{header.tag}), |
| 5141 | } | 5136 | } |
| 5142 | } | 5137 | } |
| 5143 | | 5138 | |
| 5144 | const bin_digest = man.finalBin(); | 5139 | const bin_digest = man.missDigest(); |
| 5145 | const hex_digest = Cache.binToHex(bin_digest); | 5140 | const hex_digest = Cache.binToHex(bin_digest); |
| 5146 | const o_sub_path = "o" ++ fs.path.sep_str ++ hex_digest; | 5141 | const o_sub_path = "o" ++ fs.path.sep_str ++ hex_digest; |
| 5147 | | 5142 | |
| ... | @@ -5878,10 +5873,10 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 | ... | @@ -5878,10 +5873,10 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 5878 | const rc_basename = try std.fmt.allocPrint(arena, "{s}.rc", .{src_basename}); | 5873 | const rc_basename = try std.fmt.allocPrint(arena, "{s}.rc", .{src_basename}); |
| 5879 | const res_basename = try std.fmt.allocPrint(arena, "{s}.res", .{src_basename}); | 5874 | const res_basename = try std.fmt.allocPrint(arena, "{s}.res", .{src_basename}); |
| 5880 | | 5875 | |
| 5881 | const digest = if (.hit == try man.check(child_progress_node)) man.final() else blk: { | 5876 | const digest = if (.hit == try man.check(child_progress_node)) man.hitDigestHex() else blk: { |
| 5882 | // The digest only depends on the .manifest file, so we can | 5877 | // The digest only depends on the .manifest file, so we can |
| 5883 | // get the digest now and write the .res directly to the cache | 5878 | // get the digest now and write the .res directly to the cache |
| 5884 | const digest = man.final(); | 5879 | const digest = man.missDigestHex(); |
| 5885 | | 5880 | |
| 5886 | const o_sub_path = try fs.path.join(arena, &.{ "o", &digest }); | 5881 | const o_sub_path = try fs.path.join(arena, &.{ "o", &digest }); |
| 5887 | var o_dir = try comp.dirs.local_cache.handle.createDirPathOpen(io, o_sub_path, .{}); | 5882 | var o_dir = try comp.dirs.local_cache.handle.createDirPathOpen(io, o_sub_path, .{}); |
| ... | @@ -5970,7 +5965,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 | ... | @@ -5970,7 +5965,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 5970 | | 5965 | |
| 5971 | const rc_basename_noext = src_basename[0 .. src_basename.len - fs.path.extension(src_basename).len]; | 5966 | const rc_basename_noext = src_basename[0 .. src_basename.len - fs.path.extension(src_basename).len]; |
| 5972 | | 5967 | |
| 5973 | const digest = if (.hit == try man.check(child_progress_node)) man.final() else blk: { | 5968 | const digest = if (.hit == try man.check(child_progress_node)) man.hitDigestHex() else blk: { |
| 5974 | var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.createDirPathOpen(io, "tmp", .{}); | 5969 | var zig_cache_tmp_dir = try comp.dirs.local_cache.handle.createDirPathOpen(io, "tmp", .{}); |
| 5975 | defer zig_cache_tmp_dir.close(io); | 5970 | defer zig_cache_tmp_dir.close(io); |
| 5976 | | 5971 | |
| ... | @@ -6042,7 +6037,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 | ... | @@ -6042,7 +6037,7 @@ fn updateWin32Resource(comp: *Compilation, win32_resource: *Win32Resource, win32 |
| 6042 | } | 6037 | } |
| 6043 | | 6038 | |
| 6044 | // Rename into place. | 6039 | // Rename into place. |
| 6045 | const digest = man.final(); | 6040 | const digest = man.missDigestHex(); |
| 6046 | const o_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &digest }); | 6041 | const o_sub_path = try fs.path.join(arena, &[_][]const u8{ "o", &digest }); |
| 6047 | var o_dir = try comp.dirs.local_cache.handle.createDirPathOpen(io, o_sub_path, .{}); | 6042 | var o_dir = try comp.dirs.local_cache.handle.createDirPathOpen(io, o_sub_path, .{}); |
| 6048 | defer o_dir.close(io); | 6043 | defer o_dir.close(io); |