aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-07-18 18:45:07 +0100
committermlugg <mlugg@mlugg.co.uk>2024-07-18 18:45:07 +0100
commitf5a941b3d6238222f43da568c96cfa5b3e56ce5d (patch)
tree37197f5121034108d880cff4c31c36e7608f09b6 /src/Sema.zig
parent3bdbf81a3f574c0cf538b443825558e45bceecee (diff)
downloadzig-f5a941b3d6238222f43da568c96cfa5b3e56ce5d.tar.gz
zig-f5a941b3d6238222f43da568c96cfa5b3e56ce5d.zip
Sema: return module-relative path for `@src()`
This is one possible approach to fixing an issue with reproducible builds where the compiler's cwd changes the paths returned by `@src()`.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 2b43b75132..b2603a98a8 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -17787,8 +17787,7 @@ fn zirBuiltinSrc(
};
const file_name_val = v: {
- // The compiler must not call realpath anywhere.
- const file_name = try fn_owner_decl.getFileScope(mod).fullPath(sema.arena);
+ const file_name = fn_owner_decl.getFileScope(mod).sub_file_path;
const array_ty = try pt.intern(.{ .array_type = .{
.len = file_name.len,
.sentinel = .zero_u8,