diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-12-21 17:17:11 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-12-23 22:15:11 -0800 |
| commit | 70e19ea3533528b90b4548e162e334f5a8392e64 (patch) | |
| tree | 88b0cad9fedc6d5af367ace24aaa41c502640d65 /lib/std/Build.zig | |
| parent | 51a6f3a5251096f346eb28b22e1c20ed2ceb7d9e (diff) | |
| download | zig-70e19ea3533528b90b4548e162e334f5a8392e64.tar.gz zig-70e19ea3533528b90b4548e162e334f5a8392e64.zip | |
update more "realpath" callsites
Diffstat (limited to 'lib/std/Build.zig')
| -rw-r--r-- | lib/std/Build.zig | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/std/Build.zig b/lib/std/Build.zig index 29499d8767..317e4600a4 100644 --- a/lib/std/Build.zig +++ b/lib/std/Build.zig @@ -1762,7 +1762,10 @@ fn supportedWindowsProgramExtension(ext: []const u8) bool { } fn tryFindProgram(b: *Build, full_path: []const u8) ?[]const u8 { - if (fs.realpathAlloc(b.allocator, full_path)) |p| { + const io = b.graph.io; + const arena = b.allocator; + + if (Io.Dir.realPathFileAbsoluteAlloc(io, full_path, arena)) |p| { return p; } else |err| switch (err) { error.OutOfMemory => @panic("OOM"), @@ -1776,7 +1779,11 @@ fn tryFindProgram(b: *Build, full_path: []const u8) ?[]const u8 { while (it.next()) |ext| { if (!supportedWindowsProgramExtension(ext)) continue; - return fs.realPathFileAlloc(b.graph.io, b.fmt("{s}{s}", .{ full_path, ext }), b.allocator) catch |err| switch (err) { + return Io.Dir.realPathFileAbsoluteAlloc( + io, + b.fmt("{s}{s}", .{ full_path, ext }), + arena, + ) catch |err| switch (err) { error.OutOfMemory => @panic("OOM"), else => continue, }; |
