Merge pull request #80098 from xymus/upstream-swiftmodule-blocklist

Frontend: Upstream blocklist check when ignoring adjacent swiftmodule files
This commit is contained in:
Alexis Laferrière
2025-03-26 10:28:30 -07:00
committed by GitHub
2 changed files with 12 additions and 5 deletions

View File

@@ -836,12 +836,20 @@ class ModuleInterfaceLoaderImpl {
// Don't use the adjacent swiftmodule for frameworks from the public
// Frameworks folder of the SDK.
if (isInSystemFrameworks(modulePath, /*publicFramework*/true) ||
isInSystemSubFrameworks(modulePath)) {
bool blocklistSwiftmodule =
ctx.blockListConfig.hasBlockListAction(moduleName,
BlockListKeyKind::ModuleName,
BlockListAction::ShouldUseBinaryModule);
if ((isInSystemFrameworks(modulePath, /*publicFramework*/true) ||
isInSystemSubFrameworks(modulePath)) &&
!blocklistSwiftmodule) {
shouldLoadAdjacentModule = false;
rebuildInfo.addIgnoredModule(modulePath,
ReasonIgnored::PublicFramework);
} else if (isInSystemLibraries(modulePath) && moduleName != STDLIB_NAME) {
} else if (isInSystemLibraries(modulePath) &&
moduleName != STDLIB_NAME &&
!blocklistSwiftmodule) {
shouldLoadAdjacentModule = false;
rebuildInfo.addIgnoredModule(modulePath,
ReasonIgnored::PublicLibrary);