From 01aab9f6b38d13c37719cba1fdd0b4109ac0f6d2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 10 Oct 2024 14:19:04 -0700 Subject: std.Build.Step.CheckObject: display source file path and upgrade to getPath3 --- lib/std/Build/Step/CheckObject.zig | 44 +++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'lib/std/Build/Step/CheckObject.zig') diff --git a/lib/std/Build/Step/CheckObject.zig b/lib/std/Build/Step/CheckObject.zig index 54f7bc7412..00ea5013de 100644 --- a/lib/std/Build/Step/CheckObject.zig +++ b/lib/std/Build/Step/CheckObject.zig @@ -557,15 +557,15 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void { const check_object: *CheckObject = @fieldParentPtr("step", step); try step.singleUnchangingWatchInput(check_object.source); - const src_path = check_object.source.getPath2(b, step); - const contents = fs.cwd().readFileAllocOptions( + const src_path = check_object.source.getPath3(b, step); + const contents = src_path.root_dir.handle.readFileAllocOptions( gpa, - src_path, + src_path.sub_path, check_object.max_bytes, null, @alignOf(u64), null, - ) catch |err| return step.fail("unable to read '{s}': {s}", .{ src_path, @errorName(err) }); + ) catch |err| return step.fail("unable to read '{'}': {s}", .{ src_path, @errorName(err) }); var vars = std.StringHashMap(u64).init(gpa); for (check_object.checks.items) |chk| { @@ -640,8 +640,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void { \\{s} \\========= but parsed file does not contain it: ======= \\{s} - \\====================================================== - , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) }); + \\========= file path: ================================= + \\{} + , .{ + fmtMessageString(chk.kind, act.phrase.resolve(b, step)), + fmtMessageString(chk.kind, output), + src_path, + }); } }, @@ -655,8 +660,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void { \\*{s}* \\========= but parsed file does not contain it: ======= \\{s} - \\====================================================== - , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) }); + \\========= file path: ================================= + \\{} + , .{ + fmtMessageString(chk.kind, act.phrase.resolve(b, step)), + fmtMessageString(chk.kind, output), + src_path, + }); } }, @@ -669,8 +679,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void { \\{s} \\========= but parsed file does contain it: ======== \\{s} - \\=================================================== - , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) }); + \\========= file path: ============================== + \\{} + , .{ + fmtMessageString(chk.kind, act.phrase.resolve(b, step)), + fmtMessageString(chk.kind, output), + src_path, + }); } }, @@ -684,8 +699,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void { \\{s} \\========= but parsed file does not contain it: ======= \\{s} - \\====================================================== - , .{ act.phrase.resolve(b, step), fmtMessageString(chk.kind, output) }); + \\========= file path: ============================== + \\{} + , .{ + act.phrase.resolve(b, step), + fmtMessageString(chk.kind, output), + src_path, + }); } }, -- cgit v1.2.3