mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
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()`.
This commit is contained in:
parent
3bdbf81a3f
commit
f5a941b3d6
1 changed files with 1 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue