authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-10 14:19:04-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-10 14:21:52-07:00
log01aab9f6b38d13c37719cba1fdd0b4109ac0f6d2
treefd093331532f507e1585b1abbb0ab8bdee2e60fe
parent101d21a6dcfe8fbc707744c941413ddd32e14035

std.Build.Step.CheckObject: display source file path

and upgrade to getPath3

1 files changed, 32 insertions(+), 12 deletions(-)

lib/std/Build/Step/CheckObject.zig+32-12
......@@ -557,15 +557,15 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
557557 const check_object: *CheckObject = @fieldParentPtr("step", step);
558558 try step.singleUnchangingWatchInput(check_object.source);
559559
560 const src_path = check_object.source.getPath2(b, step);
561 const contents = fs.cwd().readFileAllocOptions(
560 const src_path = check_object.source.getPath3(b, step);
561 const contents = src_path.root_dir.handle.readFileAllocOptions(
562562 gpa,
563 src_path,
563 src_path.sub_path,
564564 check_object.max_bytes,
565565 null,
566566 @alignOf(u64),
567567 null,
568 ) catch |err| return step.fail("unable to read '{s}': {s}", .{ src_path, @errorName(err) });
568 ) catch |err| return step.fail("unable to read '{'}': {s}", .{ src_path, @errorName(err) });
569569
570570 var vars = std.StringHashMap(u64).init(gpa);
571571 for (check_object.checks.items) |chk| {
......@@ -640,8 +640,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
640640 \\{s}
641641 \\========= but parsed file does not contain it: =======
642642 \\{s}
643 \\======================================================
644 , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) });
643 \\========= file path: =================================
644 \\{}
645 , .{
646 fmtMessageString(chk.kind, act.phrase.resolve(b, step)),
647 fmtMessageString(chk.kind, output),
648 src_path,
649 });
645650 }
646651 },
647652
......@@ -655,8 +660,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
655660 \\*{s}*
656661 \\========= but parsed file does not contain it: =======
657662 \\{s}
658 \\======================================================
659 , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) });
663 \\========= file path: =================================
664 \\{}
665 , .{
666 fmtMessageString(chk.kind, act.phrase.resolve(b, step)),
667 fmtMessageString(chk.kind, output),
668 src_path,
669 });
660670 }
661671 },
662672
......@@ -669,8 +679,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
669679 \\{s}
670680 \\========= but parsed file does contain it: ========
671681 \\{s}
672 \\===================================================
673 , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) });
682 \\========= file path: ==============================
683 \\{}
684 , .{
685 fmtMessageString(chk.kind, act.phrase.resolve(b, step)),
686 fmtMessageString(chk.kind, output),
687 src_path,
688 });
674689 }
675690 },
676691
......@@ -684,8 +699,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
684699 \\{s}
685700 \\========= but parsed file does not contain it: =======
686701 \\{s}
687 \\======================================================
688 , .{ act.phrase.resolve(b, step), fmtMessageString(chk.kind, output) });
702 \\========= file path: ==============================
703 \\{}
704 , .{
705 act.phrase.resolve(b, step),
706 fmtMessageString(chk.kind, output),
707 src_path,
708 });
689709 }
690710 },
691711