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:28-07:00
logc91c4dc25696224fd1d15d5b5fbf9698c8a77272
treecf0d23d432c7b73d21ac08c8cfa524fb98741f1a
parent5b5097a22a380a93a0f205ba218e8290a42ad051

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
...@@ -1818,6 +1818,9 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_comp_progress_node: *...@@ -1818,6 +1818,9 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_comp_progress_node: *
1818 };1818 };
1819 }1819 }
18201820
1821 // We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
1822 if (comp.disable_c_depfile) _ = try man.hit();
1823
1821 // Rename into place.1824 // Rename into place.
1822 const digest = man.final();1825 const digest = man.final();
1823 const o_sub_path = try std.fs.path.join(arena, &[_][]const u8{ "o", &digest });1826 const o_sub_path = try std.fs.path.join(arena, &[_][]const u8{ "o", &digest });