| ... | ... | @@ -805,7 +805,7 @@ pub const Builder = struct { |
| 805 | 805 | return name; |
| 806 | 806 | } |
| 807 | 807 | const full_path = try fs.path.join(self.allocator, [_][]const u8{ search_prefix, "bin", self.fmt("{}{}", name, exe_extension) }); |
| 808 | | if (fs.path.real(self.allocator, full_path)) |real_path| { |
| 808 | if (fs.realpathAlloc(self.allocator, full_path)) |real_path| { |
| 809 | 809 | return real_path; |
| 810 | 810 | } else |_| { |
| 811 | 811 | continue; |
| ... | ... | @@ -817,10 +817,10 @@ pub const Builder = struct { |
| 817 | 817 | if (fs.path.isAbsolute(name)) { |
| 818 | 818 | return name; |
| 819 | 819 | } |
| 820 | | var it = mem.tokenize(PATH, []u8{fs.path.delimiter}); |
| 820 | var it = mem.tokenize(PATH, [_]u8{fs.path.delimiter}); |
| 821 | 821 | while (it.next()) |path| { |
| 822 | 822 | const full_path = try fs.path.join(self.allocator, [_][]const u8{ path, self.fmt("{}{}", name, exe_extension) }); |
| 823 | | if (fs.path.real(self.allocator, full_path)) |real_path| { |
| 823 | if (fs.realpathAlloc(self.allocator, full_path)) |real_path| { |
| 824 | 824 | return real_path; |
| 825 | 825 | } else |_| { |
| 826 | 826 | continue; |
| ... | ... | @@ -834,7 +834,7 @@ pub const Builder = struct { |
| 834 | 834 | } |
| 835 | 835 | for (paths) |path| { |
| 836 | 836 | const full_path = try fs.path.join(self.allocator, [_][]const u8{ path, self.fmt("{}{}", name, exe_extension) }); |
| 837 | | if (fs.path.real(self.allocator, full_path)) |real_path| { |
| 837 | if (fs.realpathAlloc(self.allocator, full_path)) |real_path| { |
| 838 | 838 | return real_path; |
| 839 | 839 | } else |_| { |
| 840 | 840 | continue; |
| ... | ... | @@ -904,6 +904,15 @@ pub const Builder = struct { |
| 904 | 904 | } |
| 905 | 905 | }; |
| 906 | 906 | |
| 907 | test "builder.findProgram compiles" { |
| 908 | //allocator: *Allocator, |
| 909 | //zig_exe: []const u8, |
| 910 | //build_root: []const u8, |
| 911 | //cache_root: []const u8, |
| 912 | const builder = try Builder.create(std.heap.direct_allocator, "zig", "zig-cache", "zig-cache"); |
| 913 | _ = builder.findProgram([_][]const u8{}, [_][]const u8{}) catch null; |
| 914 | } |
| 915 | |
| 907 | 916 | pub const Version = struct { |
| 908 | 917 | major: u32, |
| 909 | 918 | minor: u32, |