| ... | @@ -2744,11 +2744,14 @@ fn buildOutputType( | ... | @@ -2744,11 +2744,14 @@ fn buildOutputType( |
| 2744 | } | 2744 | } |
| 2745 | | 2745 | |
| 2746 | const self_exe_path = try introspect.findZigExePath(arena); | 2746 | const self_exe_path = try introspect.findZigExePath(arena); |
| 2747 | var zig_lib_directory: Compilation.Directory = if (override_lib_dir) |lib_dir| .{ | 2747 | var zig_lib_directory: Compilation.Directory = if (override_lib_dir) |unresolved_lib_dir| l: { |
| 2748 | .path = lib_dir, | 2748 | const lib_dir = try fs.path.resolve(arena, &.{unresolved_lib_dir}); |
| 2749 | .handle = fs.cwd().openDir(lib_dir, .{}) catch |err| { | 2749 | break :l .{ |
| 2750 | fatal("unable to open zig lib directory '{s}': {s}", .{ lib_dir, @errorName(err) }); | 2750 | .path = lib_dir, |
| 2751 | }, | 2751 | .handle = fs.cwd().openDir(lib_dir, .{}) catch |err| { |
| | 2752 | fatal("unable to open zig lib directory '{s}': {s}", .{ lib_dir, @errorName(err) }); |
| | 2753 | }, |
| | 2754 | }; |
| 2752 | } else introspect.findZigLibDirFromSelfExe(arena, self_exe_path) catch |err| { | 2755 | } else introspect.findZigLibDirFromSelfExe(arena, self_exe_path) catch |err| { |
| 2753 | fatal("unable to find zig installation directory: {s}\n", .{@errorName(err)}); | 2756 | fatal("unable to find zig installation directory: {s}\n", .{@errorName(err)}); |
| 2754 | }; | 2757 | }; |