Skip to content

Commit 84eb40d

Browse files
committed
Symlink to /usr/bin/xcrun so that xcrun binary
is usable during build (used for compiling Metal shaders) Fixes #6117
1 parent c47cf41 commit 84eb40d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.devops/nix/package.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
config,
55
stdenv,
66
mkShell,
7+
runCommand,
78
cmake,
89
ninja,
910
pkg-config,
@@ -87,6 +88,11 @@ let
8788
]
8889
);
8990

91+
darwinSymlinks = runCommand "darwin-build-symlinks" {} ''
92+
mkdir -p $out/bin
93+
ln -s /usr/bin/xcrun $out/bin
94+
'';
95+
9096
# apple_sdk is supposed to choose sane defaults, no need to handle isAarch64
9197
# separately
9298
darwinBuildInputs =
@@ -96,7 +102,7 @@ let
96102
CoreVideo
97103
CoreGraphics
98104
]
99-
++ optionals useMetalKit [ MetalKit ];
105+
++ optionals useMetalKit [ MetalKit darwinSymlinks ];
100106

101107
cudaBuildInputs = with cudaPackages; [
102108
cuda_cccl.dev # <nv/target>
@@ -157,6 +163,8 @@ effectiveStdenv.mkDerivation (
157163
substituteInPlace ./*.py --replace "/usr/bin/env python" "${llama-python}/bin/python"
158164
'';
159165

166+
__noChroot = useMetalKit && effectiveStdenv.isDarwin;
167+
160168
nativeBuildInputs =
161169
[
162170
cmake

0 commit comments

Comments
 (0)