mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Load indirect package dependencies from the current package
When loading a swiftmodule A, read its package information to tell if the current client should load A's dependencies imports by a package import. Only clients belonging to the same package as A should load those dependencies, clients outside of the package likely don't have access to those dependencies. This is specific to swiftmodules as swiftinterfaces never display a package-only import. Clients are unaware of package dependencies when building against a swiftinterface. rdar://106164813
This commit is contained in:
@@ -209,6 +209,10 @@ Status ModuleFile::associateWithFileContext(FileUnit *file, SourceLoc diagLoc,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dependency.isPackageOnly() &&
|
||||
ctx.LangOpts.PackageName != this->getModulePackageName())
|
||||
continue;
|
||||
|
||||
ImportPath::Builder builder(ctx, dependency.Core.RawPath,
|
||||
/*separator=*/'\0');
|
||||
for (const auto &elem : builder) {
|
||||
|
||||
Reference in New Issue
Block a user