Merge pull request #84942 from artemcm/DowngradeIncompatBinModDepToWarning

[Dependency Scanning] Warn, instead of fail, when a Swift dependency query only finds modules built for incompatible target
This commit is contained in:
Artem Chikin
2025-10-16 01:26:09 -04:00
committed by GitHub
5 changed files with 48 additions and 4 deletions

View File

@@ -2102,6 +2102,19 @@ void ModuleDependencyIssueReporter::diagnoseFailureOnOnlyIncompatibleCandidates(
if (candidates.empty())
return;
// FIXME: There are known cases where clients are relying on
// loading the underlying Clang module in the presence of a Swift
// module which is lacking the required target-specific variant,
// such as MacCatalyst. Eventually, we should pursue making this
// an error as well.
if (llvm::all_of(candidates, [](auto &incompatibleCandidate) {
return incompatibleCandidate.incompatibilityReason ==
SwiftModuleScannerQueryResult::BUILT_FOR_INCOMPATIBLE_TARGET;
})) {
warnOnIncompatibleCandidates(moduleImport.importIdentifier, candidates);
return;
}
diagnoseModuleNotFoundFailure(moduleImport, cache, dependencyOf,
/* resolvingSerializedSearchPath */ std::nullopt,
candidates);