Commit d6c5602d46
Changed files (2)
src/Compilation.zig
@@ -899,7 +899,10 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
break :blk build_options.is_stage1;
};
- const cache_mode = if (use_stage1) CacheMode.whole else options.cache_mode;
+ const cache_mode = if (use_stage1 and !options.disable_lld_caching)
+ CacheMode.whole
+ else
+ options.cache_mode;
// Make a decision on whether to use LLVM or our own backend.
const use_llvm = build_options.have_llvm and blk: {
@@ -1951,8 +1954,6 @@ pub fn update(comp: *Compilation) !void {
};
}
- comp.emitOthers();
-
assert(comp.bin_file.lock == null);
comp.bin_file.lock = man.toOwnedLock();
return;
src/stage1.zig
@@ -458,7 +458,10 @@ export fn stage2_fetch_file(
const comp = @intToPtr(*Compilation, stage1.userdata);
const file_path = path_ptr[0..path_len];
const max_file_size = std.math.maxInt(u32);
- const contents = comp.whole_cache_manifest.?.addFilePostFetch(file_path, max_file_size) catch return null;
+ const contents = if (comp.whole_cache_manifest) |man|
+ man.addFilePostFetch(file_path, max_file_size) catch return null
+ else
+ std.fs.cwd().readFileAlloc(comp.gpa, file_path, max_file_size) catch return null;
result_len.* = contents.len;
// TODO https://github.com/ziglang/zig/issues/3328#issuecomment-716749475
if (contents.len == 0) return @intToPtr(?[*]const u8, 0x1);