Skip to content

Commit 92a678a

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 92a678a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.devops/nix/package.nix

Lines changed: 10 additions & 0 deletions
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,13 @@ let
8788
]
8889
);
8990

91+
darwinSymlinks = runCommand "darwin-build-symlinks" {
92+
__impureHostDeps = [ "/usr/bin/xcrun" ];
93+
} ''
94+
mkdir -p $out/bin
95+
ln -s /usr/bin/xcrun $out/bin
96+
'';
97+
9098
# apple_sdk is supposed to choose sane defaults, no need to handle isAarch64
9199
# separately
92100
darwinBuildInputs =
@@ -173,6 +181,8 @@ effectiveStdenv.mkDerivation (
173181
]
174182
++ optionals (effectiveStdenv.hostPlatform.isGnu && enableStatic) [
175183
glibc.static
184+
] ++ optionals (effectiveStdenv.isDarwin && useMetalKit) [
185+
darwinSymlinks
176186
];
177187

178188
buildInputs =

0 commit comments

Comments
 (0)