| 24 Oct 2025 |
EsperLily [she/her] | /usr/bin/xcrun produces the same warning | 20:19:24 |
EsperLily [she/her] | oh wow what, /usr/bin/xcrun actually invokes xcbuild.xcrun? | 20:20:19 |
emily | everything in /usr/bin is just a stub that looks up the current developer directory | 20:20:33 |
EsperLily [she/her] | but xcrun -find xcrun doesn't find anything | 20:20:33 |
EsperLily [she/her] | yeah it's a stub that looks it up with the xcrun machinery. xcrun should be the one thing that isn't a stub | 20:20:46 |
emily | shion:/v/f/1/j/T/tmp.KkX7NHuPxH
❭ mkdir -p usr/bin
shion:/v/f/1/j/T/tmp.KkX7NHuPxH
❭ cat >usr/bin/xcrun
#!/usr/bin/env bash
echo oops
shion:/v/f/1/j/T/tmp.KkX7NHuPxH
❭ chmod +x usr/bin/xcrun
shion:/v/f/1/j/T/tmp.KkX7NHuPxH
❭ DEVELOPER_DIR=(pwd) /usr/bin/xcrun
oops
| 20:21:50 |
emily | I think it recurses if there's another xcrun. | 20:22:08 |
emily | not even --help etc. do anything. | 20:22:16 |
EsperLily [she/her] | wow | 20:22:41 |
emily | I think /usr/bin/xcrun is exactly like /usr/bin/clang | 20:22:48 |
emily | they call the thing from libselect or whatever it's called to find the xcrun path relative to the developer dir and then run it | 20:22:59 |
emily | and then the rest of the library calls are in that binary | 20:23:13 |
emily | shion:/v/f/1/j/T/tmp.KkX7NHuPxH
❭ DEVELOPER_DIR=(pwd) /usr/bin/clang
oops
| 20:23:16 |
emily | so my guess is there's an infinite recursion where it's trying to get xcrun to run something but then xcrun can't find the thing and it falls back to /usr/bin which then etc… | 20:24:11 |
EsperLily [she/her] | but there is no xcrun in the normal Xcode developer dir (there is a usr/lib/libxcrun.dylib though) | 20:24:19 |
emily | hmm maybe it's a compatibility thing for old Xcodes | 20:24:33 |
emily | if there's an xcrun binary, run it, otherwise use the library | 20:24:40 |
EsperLily [she/her] | maybe so | 20:24:44 |
EsperLily [she/her] | huh, if i modify the nixpkgs SDK to remove xcrun, /usr/bin/xcrun actually complains about the missing xcrun | 20:25:53 |
EsperLily [she/her] | if i symlink in the libxcrun.dylib then it prints a different error about how it can't find the Xcode installation, that's interesting. now I'm wondering what's in the version of the SDK installed by CommandLineTools (but i'm not willing to install that to find out) | 20:27:45 |
EsperLily [she/her] | FWIW in https://github.com/NixOS/nixpkgs/issues/376958 at least one person now gets that warning printed in their shell (which would suggest they now have their DEVELOPER_DIR set to the nixpkgs SDK for some reason), so it probably is worth patching it out. https://github.com/facebookarchive/xcbuild/blob/dbaee552d2f13640773eb1ad3c79c0d2aca7229c/Libraries/xcsdk/Sources/SDK/Platform.cpp#L176 looks like the spot where those keys are read, so it just needs an entry added for FamilyDisplayName | 20:31:08 |
emily | the CLT SDKs are identical to the Xcode ones I'm pretty sure | 20:39:49 |
emily | it's normal to have DEVELOPER_DIR set in a Nix development shell | 20:40:22 |
emily | (or no build tools would work) | 20:40:32 |
EsperLily [she/her] | they didn't say "Nix development shell" they just said "in my shell" | 20:40:51 |
EsperLily [she/her] | so i assume this is coming from commands being run in a custom prompt | 20:41:17 |
EsperLily [she/her] | like starship testing tool versions or something | 20:41:25 |
EsperLily [she/her] | * like starship testing tool versions or something (edit: actually /usr/bin/git would invoke this machinery too) | 20:43:23 |
emily | I thought you meant the comment with
xsdc-translator on dev [$] via v20.18.1 via ❄️ impure (devenv-shell-env)
but I'd still predict the other person is in a dev shell based on the lack of anything weird-looking in their dotfiles
| 20:47:14 |
emily | you'd have to try quite hard to have something in the Nix store as your global DEVELOPER_DIR | 20:47:46 |