stf: do not call xcode-select or xcrun by absolute path in darwin sdk detection

This commit is contained in:
Meghan Denny 2025-01-25 15:18:40 -08:00 committed by Alex Rønne Petersen
parent 6a4986b2d6
commit 92b20e4216

View File

@ -15,7 +15,7 @@ pub const macos = @import("darwin/macos.zig");
pub fn isSdkInstalled(allocator: Allocator) bool {
const result = std.process.Child.run(.{
.allocator = allocator,
.argv = &.{ "/usr/bin/xcode-select", "--print-path" },
.argv = &.{ "xcode-select", "--print-path" },
}) catch return false;
defer {
@ -48,7 +48,7 @@ pub fn getSdk(allocator: Allocator, target: Target) ?[]const u8 {
.visionos => if (is_simulator_abi) "xrsimulator" else "xros",
else => return null,
};
const argv = &[_][]const u8{ "/usr/bin/xcrun", "--sdk", sdk, "--show-sdk-path" };
const argv = &[_][]const u8{ "xcrun", "--sdk", sdk, "--show-sdk-path" };
const result = std.process.Child.run(.{ .allocator = allocator, .argv = argv }) catch return null;
defer {
allocator.free(result.stderr);