authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-11-13 20:54:05+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-01 16:52:52-07:00
log0858d7b0df97abc409370df5094cc93f1f3532ff
tree6374273c9b6afc551fe962171ca53f4488fcb139
parenta4c8bd8fd46585800c74b78c50a5073ccf877d21

stage2: Create cache manifest before calling final

If we enter the `if` because `comp.disable_c_depfile` is false the `man` object has no manifest and calling .final on it will trip an assertion. Closes #7096

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

src/Compilation.zig+3
...@@ -1798,6 +1798,9 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_comp_progress_node: *...@@ -1798,6 +1798,9 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_comp_progress_node: *
1798 };1798 };
1799 }1799 }
18001800
1801 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
1802 if (comp.disable_c_depfile) _ = try man.hit();
1803
1801 // Rename into place.1804 // Rename into place.
1802 const digest = man.final();1805 const digest = man.final();
1803 const o_sub_path = try std.fs.path.join(arena, &[_][]const u8{ "o", &digest });1806 const o_sub_path = try std.fs.path.join(arena, &[_][]const u8{ "o", &digest });