[Dependency Scanning] On failure to locate a module, attempt to diagnose if binary dependencies contain search paths with this module.

Unlike with implicitly-built modules (prior to Swift 6 mode), explicitly-built modules require that all search paths be specified explicitly and no longer inherit search paths serialized into discovered Swift binary modules. This behavior was never intentional and is considered a bug. This change adds a diagnostic note to a scan failure: for each binary Swift module dependency, the scanner will attempt to execute a dependency scanning query for each serialized search path inside that module. If such diagnostic query returns a result, a diagnostic will be emitted to inform the user that the dependency may be found in the search path configuration of another Swift binary module dependency, specifying which search path contains the "missing" module, and stating that such search paths are not automatically inherited by the current compilation.
This commit is contained in:
Artem Chikin
2025-06-02 17:27:03 -07:00
parent 47e5edeb3e
commit 90f2fba2ae
8 changed files with 262 additions and 85 deletions

View File

@@ -690,6 +690,7 @@ bool ModuleDependenciesCacheDeserializer::readGraph(
auto moduleDep = ModuleDependencyInfo::forSwiftBinaryModule(
*compiledModulePath, *moduleDocPath, *moduleSourceInfoPath,
importStatements, optionalImportStatements, linkLibraries,
{}, // TODO: serialized search path serialization
*headerImport, *definingInterfacePath, isFramework, isStatic,
*moduleCacheKey, *userModuleVersion);