================ @@ -569,10 +572,52 @@ static bool ResolveAndVerifyCandidateSupportDir(FileSpec &path) { cache.insert({key, {error, true}}); return llvm::createStringError(llvm::inconvertibleErrorCode(), error); } + + if (path_or_err->empty()) + return llvm::createStringError("Empty path determined for '%s'", + key.data()); + auto it_new = cache.insert({key, {*path_or_err, false}}); return it_new.first->second.str; } +static llvm::Expected<std::string> +GetCommandLineToolsSDKRoot(llvm::VersionTuple version) { + std::string clt_root_dir; + FileSystem::Instance().EnumerateDirectory( + "/Library/Developer/CommandLineTools/SDKs/", /*find_directories=*/true, + /*find_files=*/false, /*find_other=*/false, + [&](void *baton, llvm::sys::fs::file_type file_type, + llvm::StringRef name) { + assert(file_type == llvm::sys::fs::file_type::directory_file); + + if (!name.ends_with(".sdk")) + return FileSystem::eEnumerateDirectoryResultNext; + + llvm::Expected<std::optional<clang::DarwinSDKInfo>> sdk_info = ---------------- Michael137 wrote:
Alternatively we can scan the `.plist` using LLDB's `ApplePropertyList`, and extract the SDK version/name from there. That would allow us not to depend on Clang here https://github.com/llvm/llvm-project/pull/128712 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits