Do not fail the build on only finding incompatible-architecture modules on 'canImport'

This change refactors the module loaders to explicitly take a parameter indicating whether or not the loader is handling a 'canImport' query, in order to avoid emitting an error when finding a dependency Swift binary module with only imcompatible architecture variants present.

Resolves rdar://161175498
This commit is contained in:
Artem Chikin
2025-09-23 14:45:57 -07:00
parent 8e96210c47
commit c73869e479
9 changed files with 56 additions and 51 deletions

View File

@@ -131,7 +131,7 @@ protected:
SerializedModuleBaseName(tempDir, SerializedModuleBaseName("Library")),
/*ModuleInterfacePath=*/nullptr, /*ModuleInterfaceSourcePath=*/nullptr,
&moduleBuffer, &moduleDocBuffer, &moduleSourceInfoBuffer,
/*skipBuildingInterface*/ false, /*IsFramework*/false);
/*isCanImportLookup*/ false, /*IsFramework*/false);
ASSERT_FALSE(error);
ASSERT_FALSE(diags.hadAnyError());