Merge pull request #18491 from ziglang/fix-mod-link-obj-path

std.Build.Step.Compile: fix link object paths
This commit is contained in:
Andrew Kelley 2024-01-09 01:11:15 -08:00 committed by GitHub
commit 60094cc3fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -999,7 +999,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
switch (link_object) { switch (link_object) {
.static_path => |static_path| { .static_path => |static_path| {
if (my_responsibility) { if (my_responsibility) {
try zig_args.append(static_path.getPath(b)); try zig_args.append(static_path.getPath2(module.owner, step));
total_linker_objects += 1; total_linker_objects += 1;
} }
}, },
@ -1119,7 +1119,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
try zig_args.append("--"); try zig_args.append("--");
prev_has_cflags = false; prev_has_cflags = false;
} }
try zig_args.append(asm_file.getPath(b)); try zig_args.append(asm_file.getPath2(module.owner, step));
total_linker_objects += 1; total_linker_objects += 1;
}, },
@ -1140,7 +1140,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
try zig_args.append("--"); try zig_args.append("--");
prev_has_cflags = true; prev_has_cflags = true;
} }
try zig_args.append(c_source_file.file.getPath(b)); try zig_args.append(c_source_file.file.getPath2(module.owner, step));
total_linker_objects += 1; total_linker_objects += 1;
}, },
@ -1191,7 +1191,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
try zig_args.append("--"); try zig_args.append("--");
prev_has_rcflags = true; prev_has_rcflags = true;
} }
try zig_args.append(rc_source_file.file.getPath(b)); try zig_args.append(rc_source_file.file.getPath2(module.owner, step));
total_linker_objects += 1; total_linker_objects += 1;
}, },
} }

View file

@ -2055,11 +2055,11 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void
const is_hit = man.hit() catch |err| { const is_hit = man.hit() catch |err| {
const i = man.failed_file_index orelse return err; const i = man.failed_file_index orelse return err;
const pp = man.files.items[i].prefixed_path orelse return err; const pp = man.files.items[i].prefixed_path orelse return err;
const prefix = man.cache.prefixes()[pp.prefix].path orelse ""; const prefix = man.cache.prefixes()[pp.prefix];
return comp.setMiscFailure( return comp.setMiscFailure(
.check_whole_cache, .check_whole_cache,
"unable to check cache: stat file '{}{s}{s}' failed: {s}", "unable to check cache: stat file '{}{s}' failed: {s}",
.{ comp.local_cache_directory, prefix, pp.sub_path, @errorName(err) }, .{ prefix, pp.sub_path, @errorName(err) },
); );
}; };
if (is_hit) { if (is_hit) {