mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ParseableInterface] Don't serialize resource directory deps and stop adding cached modules to the dependency tracker
This patch modifies ParseableInterfaceBuilder::CollectDepsForSerialization to avoid serializing dependencies from the runtime resource path into the swiftmodules generated from .swiftinterface files. This means the module cache should now be relocatable across machines. It also modifies ParseableInterfaceModuleLoader to never add any dependencies from the module cache and prebuilt cache to the dependency tracker (in addition to the existing behaviour of not serializing them in the generated swiftmodules). As a result, CollectDepsForSerialization no longer checks if the dependencies it is given come from the cache as they are provided by the dependency tracker. It now asserts that's the case instead.
This commit is contained in:
@@ -645,9 +645,13 @@ ModuleDecl *SerializedModuleLoaderBase::loadModule(SourceLoc importLoc,
|
||||
isFramework)) {
|
||||
return nullptr;
|
||||
}
|
||||
if (dependencyTracker)
|
||||
dependencyTracker->addDependency(moduleInputBuffer->getBufferIdentifier(),
|
||||
/*isSystem=*/false);
|
||||
if (dependencyTracker) {
|
||||
// Don't record cached artifacts as dependencies.
|
||||
StringRef DepPath = moduleInputBuffer->getBufferIdentifier();
|
||||
if (!isCached(DepPath)) {
|
||||
dependencyTracker->addDependency(DepPath, /*isSystem=*/false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert(moduleInputBuffer);
|
||||
|
||||
Reference in New Issue
Block a user