workaround zig tarball bug (#599)

This commit is contained in:
Lee Cannon 2022-08-22 23:01:44 +01:00 committed by GitHub
parent b4ccfeecef
commit eb60f75413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1052,9 +1052,14 @@ fn stdUriFromLibPath(allocator: std.mem.Allocator, zig_lib_path: ?[]const u8) !?
if (zig_lib_path) |zpath| {
const std_path = std.fs.path.resolve(allocator, &[_][]const u8{
zpath, "./std/std.zig",
}) catch |err| {
log.debug("Failed to resolve zig std library path, error: {}", .{err});
return null;
}) catch |first_std_err| blk: {
// workaround for https://github.com/ziglang/zig/issues/12516
break :blk std.fs.path.resolve(allocator, &[_][]const u8{
zpath, "./zig/std/std.zig",
}) catch {
log.debug("Failed to resolve zig std library path, error: {}", .{first_std_err});
return null;
};
};
defer allocator.free(std_path);