diff --git a/src/Compilation.zig b/src/Compilation.zig index 8cc930b0371823399595547127b13236a8ff41c4..a82cf46fd85ce6b1c67d00d313785f3db5b4b5e4 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3230,16 +3230,16 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE // cache manifest must not be written. if (anyErrors(comp)) return; + if (comp.bin_file) |lf| { + lf.destroy(); + comp.bin_file = null; + } + // Failure here only means an unnecessary cache miss. man.writeManifest() catch |err| { log.warn("failed to write cache manifest: {s}", .{@errorName(err)}); }; - if (comp.bin_file) |lf| { - lf.destroy(); - comp.bin_file = null; - } - assert(whole.lock == null); whole.lock = man.toOwnedLock(); },