Merge pull request #249 from NotNite/resolve-paths

Use fs.path.resolve to find Zig binary during config
This commit is contained in:
Auguste Rame 2021-03-15 09:01:17 -04:00 committed by GitHub
commit 8c7a93fdf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,8 +28,10 @@ pub fn config(step: *std.build.Step) anyerror!void {
var it = std.mem.tokenize(env_path, &[_]u8{std.fs.path.delimiter}); var it = std.mem.tokenize(env_path, &[_]u8{std.fs.path.delimiter});
while (it.next()) |path| { while (it.next()) |path| {
const resolved_path = try std.fs.path.resolve(allocator, &[_][]const u8{path});
defer allocator.free(resolved_path);
const full_path = try std.fs.path.join(allocator, &[_][]const u8{ const full_path = try std.fs.path.join(allocator, &[_][]const u8{
path, resolved_path,
zig_exe, zig_exe,
}); });
defer allocator.free(full_path); defer allocator.free(full_path);