Merge pull request #81919 from artemcm/DiagnoseMissingModulesSeenInSerializedSearchPaths

[Dependency Scanning] On failure to locate a module, attempt to diagnose if binary dependencies contain search paths with this module.
This commit is contained in:
Artem Chikin
2025-06-11 18:00:01 -07:00
committed by GitHub
12 changed files with 463 additions and 91 deletions

View File

@@ -638,11 +638,15 @@ SerializedModuleLoaderBase::scanModuleFile(Twine modulePath, bool isFramework,
loadedModuleFile->resolveModuleDefiningFilePath(Ctx.SearchPathOpts.getSDKPath());
std::string userModuleVer = loadedModuleFile->getUserModuleVersion().getAsString();
std::vector<serialization::SearchPath> serializedSearchPaths;
llvm::copy(loadedModuleFile->getSearchPaths(), std::back_inserter(serializedSearchPaths));
// Map the set of dependencies over to the "module dependencies".
auto dependencies = ModuleDependencyInfo::forSwiftBinaryModule(
modulePath.str(), moduleDocPath, sourceInfoPath, moduleImports,
optionalModuleImports, linkLibraries, importedHeader,
definingModulePath, isFramework, loadedModuleFile->isStaticLibrary(),
optionalModuleImports, linkLibraries, serializedSearchPaths,
importedHeader, definingModulePath, isFramework,
loadedModuleFile->isStaticLibrary(),
/*module-cache-key*/ "", userModuleVer);
for (auto &macro : loadedModuleFile->getExternalMacros()) {