From 3023d2845c6906fac9522d2e94a6811f7dabbe78 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 8 Jan 2024 18:20:06 -0700 Subject: [PATCH 1/2] compilation: fix bad path in error message --- src/Compilation.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index 602cd645a0..e5dde5e9e2 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2056,11 +2056,11 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void const is_hit = man.hit() catch |err| { const i = man.failed_file_index 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( .check_whole_cache, - "unable to check cache: stat file '{}{s}{s}' failed: {s}", - .{ comp.local_cache_directory, prefix, pp.sub_path, @errorName(err) }, + "unable to check cache: stat file '{}{s}' failed: {s}", + .{ prefix, pp.sub_path, @errorName(err) }, ); }; if (is_hit) { From cf5a5dc8b521a145112e9619563cc72d3c26c0e9 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 8 Jan 2024 18:24:14 -0700 Subject: [PATCH 2/2] std.Build.Step.Compile: fix link object paths They were being resolved relative to the wrong owner. closes #18460 --- lib/std/Build/Step/Compile.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index b001891b39..58e6b7e8cb 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -993,7 +993,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { switch (link_object) { .static_path => |static_path| { 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; } }, @@ -1113,7 +1113,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { try zig_args.append("--"); 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; }, @@ -1134,7 +1134,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { try zig_args.append("--"); 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; }, @@ -1185,7 +1185,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { try zig_args.append("--"); 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; }, }