mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
compilation: fix build artifact communication from sub-compilation
in whole cache mode, build artifacts are communicated by accessing the whole cache information, for which there is a helper method called toCrtFile
This commit is contained in:
parent
b1fc3fe1c4
commit
57afdfc8fa
@ -2336,11 +2336,6 @@ fn wholeCacheModeSetBinFilePath(
|
||||
|
||||
if (whole.bin_sub_path) |sub_path| {
|
||||
@memcpy(sub_path[digest_start..][0..digest.len], digest);
|
||||
|
||||
comp.bin_file.?.emit = .{
|
||||
.directory = comp.local_cache_directory,
|
||||
.sub_path = sub_path,
|
||||
};
|
||||
}
|
||||
|
||||
if (whole.implib_sub_path) |sub_path| {
|
||||
@ -6243,12 +6238,7 @@ fn buildOutputFromZig(
|
||||
try comp.updateSubCompilation(sub_compilation, misc_task_tag, prog_node);
|
||||
|
||||
assert(out.* == null);
|
||||
out.* = .{
|
||||
.full_object_path = try sub_compilation.bin_file.?.emit.directory.join(gpa, &.{
|
||||
sub_compilation.bin_file.?.emit.sub_path,
|
||||
}),
|
||||
.lock = sub_compilation.bin_file.?.toOwnedLock(),
|
||||
};
|
||||
out.* = try sub_compilation.toCrtFile();
|
||||
}
|
||||
|
||||
pub fn build_crt_file(
|
||||
|
||||
@ -276,12 +276,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: *std.Progr
|
||||
const basename = try comp.gpa.dupe(u8, "libc.so");
|
||||
errdefer comp.gpa.free(basename);
|
||||
|
||||
comp.crt_files.putAssumeCapacityNoClobber(basename, .{
|
||||
.full_object_path = try sub_compilation.bin_file.?.emit.directory.join(comp.gpa, &.{
|
||||
sub_compilation.bin_file.?.emit.sub_path,
|
||||
}),
|
||||
.lock = sub_compilation.bin_file.?.toOwnedLock(),
|
||||
});
|
||||
comp.crt_files.putAssumeCapacityNoClobber(basename, try sub_compilation.toCrtFile());
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user