aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/CheckObject.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-10-10 22:30:04 -0700
committerGitHub <noreply@github.com>2024-10-10 22:30:04 -0700
commit1340565e22e154db41e90a8d4f0b552176711ba0 (patch)
tree0fcb0dde8105082065f46d1f477c97903f69b7e5 /lib/std/Build/Step/CheckObject.zig
parent92ae5818d26925af7816fabcaec85236133b9e46 (diff)
parent2857a3bcb61ad8f119f46acf3a76fd70195f9bd5 (diff)
downloadzig-1340565e22e154db41e90a8d4f0b552176711ba0.tar.gz
zig-1340565e22e154db41e90a8d4f0b552176711ba0.zip
Merge pull request #21654 from ziglang/embrace-path-abstraction
link: fix false positive crtbegin/crtend detection
Diffstat (limited to 'lib/std/Build/Step/CheckObject.zig')
-rw-r--r--lib/std/Build/Step/CheckObject.zig44
1 files changed, 32 insertions, 12 deletions
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,
+ });
}
},