Closed madsmtm closed 3 weeks ago
I have since making this become aware that /usr/share/xcode-select
is protected by SIP, so it’s likely only used internally for development - I'll do the work to remove it from the PR if there is desire to land this?
The user can set the current developer directory globally by using
xcode-select --switch PATH
.This creates a symlink at
/var/db/xcode_select_link
, which we can read to get the path of the current globally configured developer directory. In the past, other files were created instead, so we also attempt to read those (we could probably omit this logic, but might as well include it for completeness).I'm fairly confident that this is the last thing needed for
SdkSearch::default()
to perform exactly the same lookup asxcode-select --print-path
itself.See also https://github.com/rust-lang/rust/pull/131433 where I implemented similar logic in
rustc
.