Skip to content

Commit c63ca42

Browse files
committed
std.zig.system.darwin: fix redundant names
1 parent 7ea3f47 commit c63ca42

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

lib/std/zig/system/darwin.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub const macos = @import("darwin/macos.zig");
1111
/// Therefore, we resort to the same tool used by Homebrew, namely, invoking `xcode-select --print-path`
1212
/// and checking if the status is nonzero or the returned string in nonempty.
1313
/// https://github.com/Homebrew/brew/blob/e119bdc571dcb000305411bc1e26678b132afb98/Library/Homebrew/brew.sh#L630
14-
pub fn isDarwinSDKInstalled(allocator: Allocator) bool {
14+
pub fn isSdkInstalled(allocator: Allocator) bool {
1515
const argv = &[_][]const u8{ "/usr/bin/xcode-select", "--print-path" };
1616
const result = std.ChildProcess.exec(.{ .allocator = allocator, .argv = argv }) catch return false;
1717
defer {
@@ -29,7 +29,7 @@ pub fn isDarwinSDKInstalled(allocator: Allocator) bool {
2929
/// Calls `xcrun --sdk <target_sdk> --show-sdk-path` which fetches the path to the SDK sysroot (if any).
3030
/// Subsequently calls `xcrun --sdk <target_sdk> --show-sdk-version` which fetches version of the SDK.
3131
/// The caller needs to deinit the resulting struct.
32-
pub fn getDarwinSDK(allocator: Allocator, target: Target) ?DarwinSDK {
32+
pub fn getSdk(allocator: Allocator, target: Target) ?Sdk {
3333
const is_simulator_abi = target.abi == .simulator;
3434
const sdk = switch (target.os.tag) {
3535
.macos => "macosx",
@@ -73,7 +73,7 @@ pub fn getDarwinSDK(allocator: Allocator, target: Target) ?DarwinSDK {
7373
};
7474
break :version version;
7575
};
76-
return DarwinSDK{
76+
return Sdk{
7777
.path = path,
7878
.version = version,
7979
};
@@ -96,11 +96,11 @@ fn parseSdkVersion(raw: []const u8) ?Version {
9696
return Version.parse(buffer[0..len]) catch null;
9797
}
9898

99-
pub const DarwinSDK = struct {
99+
pub const Sdk = struct {
100100
path: []const u8,
101101
version: Version,
102102

103-
pub fn deinit(self: DarwinSDK, allocator: Allocator) void {
103+
pub fn deinit(self: Sdk, allocator: Allocator) void {
104104
allocator.free(self.path);
105105
}
106106
};

src/main.zig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2857,9 +2857,6 @@ fn buildOutputType(
28572857
std.log.err("unable to find {s} system library '{s}' using strategy '{s}'. searched paths:{s}", .{
28582858
@tagName(f.preferred_mode), f.name, @tagName(f.strategy), searched_paths,
28592859
});
2860-
if (f.preferred_mode == .Dynamic and f.strategy == .no_fallback) {
2861-
std.log.info("to link statically, pass the library as a positional argument", .{});
2862-
}
28632860
}
28642861
process.exit(1);
28652862
}

test/link/macho/bugs/13056/build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void {
1616
fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void {
1717
const target: std.zig.CrossTarget = .{ .os_tag = .macos };
1818
const target_info = std.zig.system.NativeTargetInfo.detect(target) catch unreachable;
19-
const sdk = std.zig.system.darwin.getDarwinSDK(b.allocator, target_info.target) orelse
19+
const sdk = std.zig.system.darwin.getSdk(b.allocator, target_info.target) orelse
2020
@panic("macOS SDK is required to run the test");
2121

2222
const exe = b.addExecutable(.{

0 commit comments

Comments
 (0)