| author | |
| committer | |
| log | 1264469a41e89e72635c3b60b4cd3dca17876964 |
| tree | faf1a8ae1dc20b72abd562d101684c1151732662 |
| parent | 54865e0483bf02bc1ace9f06c00071fce32534cc |
4 files changed, 14 insertions(+), 14 deletions(-)
lib/std/zig/LibCInstallation.zig+2-2| ... | ... | @@ -177,9 +177,9 @@ pub fn findNative(gpa: Allocator, io: Io, args: FindNativeOptions) FindError!Lib |
| 177 | 177 | var self: LibCInstallation = .{}; |
| 178 | 178 | |
| 179 | 179 | if (is_darwin and args.target.os.tag.isDarwin()) { |
| 180 | if (!std.zig.system.darwin.isSdkInstalled(gpa)) | |
| 180 | if (!std.zig.system.darwin.isSdkInstalled(gpa, io)) | |
| 181 | 181 | return error.DarwinSdkNotFound; |
| 182 | const sdk = std.zig.system.darwin.getSdk(gpa, args.target) orelse | |
| 182 | const sdk = std.zig.system.darwin.getSdk(gpa, io, args.target) orelse | |
| 183 | 183 | return error.DarwinSdkNotFound; |
| 184 | 184 | defer gpa.free(sdk); |
| 185 | 185 |
lib/std/zig/system/NativePaths.zig+7-6| ... | ... | @@ -1,11 +1,12 @@ |
| 1 | const std = @import("../../std.zig"); | |
| 1 | const NativePaths = @This(); | |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | ||
| 4 | const std = @import("../../std.zig"); | |
| 5 | const Io = std.Io; | |
| 3 | 6 | const Allocator = std.mem.Allocator; |
| 4 | 7 | const process = std.process; |
| 5 | 8 | const mem = std.mem; |
| 6 | 9 | |
| 7 | const NativePaths = @This(); | |
| 8 | ||
| 9 | 10 | arena: Allocator, |
| 10 | 11 | include_dirs: std.ArrayList([]const u8) = .empty, |
| 11 | 12 | lib_dirs: std.ArrayList([]const u8) = .empty, |
| ... | ... | @@ -13,7 +14,7 @@ framework_dirs: std.ArrayList([]const u8) = .empty, |
| 13 | 14 | rpaths: std.ArrayList([]const u8) = .empty, |
| 14 | 15 | warnings: std.ArrayList([]const u8) = .empty, |
| 15 | 16 | |
| 16 | pub fn detect(arena: Allocator, native_target: *const std.Target) !NativePaths { | |
| 17 | pub fn detect(arena: Allocator, io: Io, native_target: *const std.Target) !NativePaths { | |
| 17 | 18 | var self: NativePaths = .{ .arena = arena }; |
| 18 | 19 | var is_nix = false; |
| 19 | 20 | if (process.getEnvVarOwned(arena, "NIX_CFLAGS_COMPILE")) |nix_cflags_compile| { |
| ... | ... | @@ -115,8 +116,8 @@ pub fn detect(arena: Allocator, native_target: *const std.Target) !NativePaths { |
| 115 | 116 | |
| 116 | 117 | // TODO: consider also adding macports paths |
| 117 | 118 | if (builtin.target.os.tag.isDarwin()) { |
| 118 | if (std.zig.system.darwin.isSdkInstalled(arena)) sdk: { | |
| 119 | const sdk = std.zig.system.darwin.getSdk(arena, native_target) orelse break :sdk; | |
| 119 | if (std.zig.system.darwin.isSdkInstalled(arena, io)) sdk: { | |
| 120 | const sdk = std.zig.system.darwin.getSdk(arena, io, native_target) orelse break :sdk; | |
| 120 | 121 | try self.addLibDir(try std.fs.path.join(arena, &.{ sdk, "usr/lib" })); |
| 121 | 122 | try self.addFrameworkDir(try std.fs.path.join(arena, &.{ sdk, "System/Library/Frameworks" })); |
| 122 | 123 | try self.addIncludeDir(try std.fs.path.join(arena, &.{ sdk, "usr/include" })); |
src/link/MachO.zig+3-3| ... | ... | @@ -617,7 +617,7 @@ pub fn flush( |
| 617 | 617 | else => |e| return diags.fail("failed to write code signature: {s}", .{@errorName(e)}), |
| 618 | 618 | }; |
| 619 | 619 | const emit = self.base.emit; |
| 620 | invalidateKernelCache(emit.root_dir.handle, emit.sub_path) catch |err| switch (err) { | |
| 620 | invalidateKernelCache(io, emit.root_dir.handle, emit.sub_path) catch |err| switch (err) { | |
| 621 | 621 | else => |e| return diags.fail("failed to invalidate kernel cache: {t}", .{e}), |
| 622 | 622 | }; |
| 623 | 623 | } |
| ... | ... | @@ -3621,11 +3621,11 @@ pub fn getTarget(self: *const MachO) *const std.Target { |
| 3621 | 3621 | /// into a new inode, remove the original file, and rename the copy to match |
| 3622 | 3622 | /// the original file. This is super messy, but there doesn't seem any other |
| 3623 | 3623 | /// way to please the XNU. |
| 3624 | pub fn invalidateKernelCache(dir: Io.Dir, sub_path: []const u8) !void { | |
| 3624 | pub fn invalidateKernelCache(io: Io, dir: Io.Dir, sub_path: []const u8) !void { | |
| 3625 | 3625 | const tracy = trace(@src()); |
| 3626 | 3626 | defer tracy.end(); |
| 3627 | 3627 | if (builtin.target.os.tag.isDarwin() and builtin.target.cpu.arch == .aarch64) { |
| 3628 | try dir.copyFile(sub_path, dir, sub_path, .{}); | |
| 3628 | try dir.copyFile(sub_path, dir, sub_path, io, .{}); | |
| 3629 | 3629 | } |
| 3630 | 3630 | } |
| 3631 | 3631 |
src/main.zig+2-3| ... | ... | @@ -3985,9 +3985,8 @@ fn createModule( |
| 3985 | 3985 | resolved_target.is_native_os and resolved_target.is_native_abi and |
| 3986 | 3986 | create_module.want_native_include_dirs) |
| 3987 | 3987 | { |
| 3988 | var paths = std.zig.system.NativePaths.detect(arena, target) catch |err| { | |
| 3989 | fatal("unable to detect native system paths: {s}", .{@errorName(err)}); | |
| 3990 | }; | |
| 3988 | var paths = std.zig.system.NativePaths.detect(arena, io, target) catch |err| | |
| 3989 | fatal("unable to detect native system paths: {t}", .{err}); | |
| 3991 | 3990 | for (paths.warnings.items) |warning| { |
| 3992 | 3991 | warn("{s}", .{warning}); |
| 3993 | 3992 | } |