mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ModuleInterface] Ignore adjacent swiftmodules from the Frameworks folder
Always use the swiftinterfaces of modules under the public Frameworks folder in the SDK. Distributed swiftmodules are unreliable, they should only be used as a local cache. Let's avoid them when possible. rdar://92037292
This commit is contained in:
@@ -651,10 +651,20 @@ class ModuleInterfaceLoaderImpl {
|
||||
|
||||
std::pair<std::string, std::string> getCompiledModuleCandidates() {
|
||||
std::pair<std::string, std::string> result;
|
||||
// Keep track of whether we should attempt to load a .swiftmodule adjacent
|
||||
// to the .swiftinterface.
|
||||
// Should we attempt to load a swiftmodule adjacent to the swiftinterface?
|
||||
bool shouldLoadAdjacentModule = true;
|
||||
|
||||
// Don't use the adjacent swiftmodule for frameworks from the public
|
||||
// Frameworks folder of the SDK.
|
||||
SmallString<128> publicFrameworksPath;
|
||||
llvm::sys::path::append(publicFrameworksPath,
|
||||
ctx.SearchPathOpts.getSDKPath(),
|
||||
"System", "Library", "Frameworks");
|
||||
if (!ctx.SearchPathOpts.getSDKPath().empty() &&
|
||||
modulePath.startswith(publicFrameworksPath)) {
|
||||
shouldLoadAdjacentModule = false;
|
||||
}
|
||||
|
||||
switch (loadMode) {
|
||||
case ModuleLoadingMode::OnlyInterface:
|
||||
// Always skip both the caches and adjacent modules, and always build the
|
||||
|
||||
Reference in New Issue
Block a user