mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't serialize relative resource dir module paths
This commit is contained in:
@@ -105,6 +105,12 @@ bool ExplicitModuleInterfaceBuilder::collectDepsForSerialization(
|
||||
path::native(SDKPath);
|
||||
SmallString<128> ResourcePath(Opts.RuntimeResourcePath);
|
||||
path::native(ResourcePath);
|
||||
// When compiling with a relative resource dir, the clang
|
||||
// importer will track inputs with absolute paths. To avoid
|
||||
// serializing resource dir inputs we need to check for
|
||||
// relative _and_ absolute prefixes.
|
||||
SmallString<128> AbsResourcePath(ResourcePath);
|
||||
llvm::sys::fs::make_absolute(AbsResourcePath);
|
||||
|
||||
auto DTDeps = Instance.getDependencyTracker()->getDependencies();
|
||||
SmallVector<std::string, 16> InitialDepNames(DTDeps.begin(), DTDeps.end());
|
||||
@@ -146,7 +152,7 @@ bool ExplicitModuleInterfaceBuilder::collectDepsForSerialization(
|
||||
}
|
||||
|
||||
// Don't serialize compiler-relative deps so the cache is relocatable.
|
||||
if (DepName.starts_with(ResourcePath))
|
||||
if (DepName.starts_with(ResourcePath) || DepName.starts_with(AbsResourcePath))
|
||||
continue;
|
||||
|
||||
auto Status = fs.status(DepName);
|
||||
|
||||
Reference in New Issue
Block a user