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 {...@@ -557,15 +557,15 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
557 const check_object: *CheckObject = @fieldParentPtr("step", step);557 const check_object: *CheckObject = @fieldParentPtr("step", step);
558 try step.singleUnchangingWatchInput(check_object.source);558 try step.singleUnchangingWatchInput(check_object.source);
559559
560 const src_path = check_object.source.getPath2(b, step);560 const src_path = check_object.source.getPath3(b, step);
561 const contents = fs.cwd().readFileAllocOptions(561 const contents = src_path.root_dir.handle.readFileAllocOptions(
562 gpa,562 gpa,
563 src_path,563 src_path.sub_path,
564 check_object.max_bytes,564 check_object.max_bytes,
565 null,565 null,
566 @alignOf(u64),566 @alignOf(u64),
567 null,567 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
570 var vars = std.StringHashMap(u64).init(gpa);570 var vars = std.StringHashMap(u64).init(gpa);
571 for (check_object.checks.items) |chk| {571 for (check_object.checks.items) |chk| {
...@@ -640,8 +640,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {...@@ -640,8 +640,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
640 \\{s}640 \\{s}
641 \\========= but parsed file does not contain it: =======641 \\========= but parsed file does not contain it: =======
642 \\{s}642 \\{s}
643 \\======================================================643 \\========= file path: =================================
644 , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) });644 \\{}
645 , .{
646 fmtMessageString(chk.kind, act.phrase.resolve(b, step)),
647 fmtMessageString(chk.kind, output),
648 src_path,
649 });
645 }650 }
646 },651 },
647652
...@@ -655,8 +660,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {...@@ -655,8 +660,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
655 \\*{s}*660 \\*{s}*
656 \\========= but parsed file does not contain it: =======661 \\========= but parsed file does not contain it: =======
657 \\{s}662 \\{s}
658 \\======================================================663 \\========= file path: =================================
659 , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) });664 \\{}
665 , .{
666 fmtMessageString(chk.kind, act.phrase.resolve(b, step)),
667 fmtMessageString(chk.kind, output),
668 src_path,
669 });
660 }670 }
661 },671 },
662672
...@@ -669,8 +679,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {...@@ -669,8 +679,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
669 \\{s}679 \\{s}
670 \\========= but parsed file does contain it: ========680 \\========= but parsed file does contain it: ========
671 \\{s}681 \\{s}
672 \\===================================================682 \\========= file path: ==============================
673 , .{ fmtMessageString(chk.kind, act.phrase.resolve(b, step)), fmtMessageString(chk.kind, output) });683 \\{}
684 , .{
685 fmtMessageString(chk.kind, act.phrase.resolve(b, step)),
686 fmtMessageString(chk.kind, output),
687 src_path,
688 });
674 }689 }
675 },690 },
676691
...@@ -684,8 +699,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {...@@ -684,8 +699,13 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void {
684 \\{s}699 \\{s}
685 \\========= but parsed file does not contain it: =======700 \\========= but parsed file does not contain it: =======
686 \\{s}701 \\{s}
687 \\======================================================702 \\========= file path: ==============================
688 , .{ act.phrase.resolve(b, step), fmtMessageString(chk.kind, output) });703 \\{}
704 , .{
705 act.phrase.resolve(b, step),
706 fmtMessageString(chk.kind, output),
707 src_path,
708 });
689 }709 }
690 },710 },
691711