Skip to content

Add error logging when xcrun fails to find an SDK #7691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,16 @@ static std::string GetSDKPath(std::string m_description, XcodeSDK sdk) {
}

std::string sdk_path = sdk_path_or_err->str();
LOG_PRINTF(GetLog(LLDBLog::Types), "Host SDK path: `%s` (XcodeSDK: %s)",
// GetSDKRoot reports no SDK as an empty string.
if (sdk_path.empty()) {
std::string sdk_spec = sdk.GetString().str();
Debugger::ReportError("LLDB couldn't find an SDK for \"" + sdk_spec + "\".");
HEALTH_LOG_PRINTF("Could not find an SDK for \"%s\". Try to verify that "
"\"xcrun --show-sdk-path --sdk %s\" works.",
sdk_spec.c_str(), sdk_spec.c_str());
return {};
}
LOG_PRINTF(GetLog(LLDBLog::Types), "Host SDK path: \"%s\" (XcodeSDK: %s)",
sdk_path.c_str(), sdk.GetString().str().c_str());
return sdk_path;
}
Expand Down