Do not build Swift interface files into binary modules when performing a canImport query.

We should hold off actually building the binary module file until it is imported.
`canImport` queries can happen, for example, during dependency scanning, when we do not wish to have the scanner tool execute any module builds.

Resolves rdar://82603098
This commit is contained in:
Artem Chikin
2021-09-01 16:06:21 -07:00
parent 1907a820ea
commit 1b7d55582d
9 changed files with 50 additions and 22 deletions

View File

@@ -128,7 +128,8 @@ protected:
loader->findModuleFilesInDirectory({moduleName, SourceLoc()},
SerializedModuleBaseName(tempDir, SerializedModuleBaseName("Library")),
/*ModuleInterfacePath*/nullptr,
&moduleBuffer, &moduleDocBuffer, &moduleSourceInfoBuffer, /*IsFramework*/false);
&moduleBuffer, &moduleDocBuffer, &moduleSourceInfoBuffer,
/*skipBuildingInterface*/ false, /*IsFramework*/false);
ASSERT_FALSE(error);
ASSERT_FALSE(diags.hadAnyError());