[Lldb-commits] [lldb] [lldb]HostInfoMacOSX] Search CommandLineTools directory when looking up SDK paths (PR #128712)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 25 08:53:43 PST 2025
================
@@ -581,6 +626,21 @@ static bool ResolveAndVerifyCandidateSupportDir(FileSpec &path) {
"XcodeSDK not specified");
XcodeSDK sdk = *options.XcodeSDKSelection;
auto key = sdk.GetString();
+
+ // xcrun doesn't search SDKs in the CommandLineTools (CLT) directory. So if
+ // a program was compiled against a CLT SDK, but that SDK wasn't present in
+ // any of the Xcode installations, then xcrun would fail to find the SDK
+ // (which is expensive). To avoid this we first try to find the specified SDK
+ // in the CLT directory.
+ auto clt_root_dir = find_cached_path(g_sdk_path, g_sdk_path_mutex, key, [&] {
+ return GetCommandLineToolsSDKRoot(sdk.GetVersion());
----------------
adrian-prantl wrote:
That's my only concern with this, but if we wanted to avoid this behavior, then we would need to reimplement all of xcrun's logic to find SDKs in Xcode. That's also not something I'm excited about.
https://github.com/llvm/llvm-project/pull/128712
More information about the lldb-commits
mailing list