Allow recompilation of modules in the resource directory when importing non-ossa module to ossa module

This effects local swift development only and is needed now to use -enable-ossa-modules in local tests that
import Synchronization and Distributed which are non-ossa.
This commit is contained in:
Meghana Gupta
2025-01-08 17:09:17 -08:00
parent 2dbffa247b
commit 453369517a
2 changed files with 12 additions and 3 deletions

View File

@@ -936,8 +936,17 @@ class ModuleInterfaceLoaderImpl {
} else if (isInResourceDir(adjacentMod) &&
loadMode == ModuleLoadingMode::PreferSerialized &&
!version::isCurrentCompilerTagged() &&
rebuildInfo.getOrInsertCandidateModule(adjacentMod).serializationStatus !=
serialization::Status::SDKMismatch) {
rebuildInfo.getOrInsertCandidateModule(adjacentMod)
.serializationStatus !=
serialization::Status::SDKMismatch &&
// FIXME (meg-gupta): We need to support recompilation of
// modules in the resource directory if the mismatch is due
// to importing a non-ossa module to an ossa module. This is
// needed during ossa bringup, once -enable-ossa-modules is
// on by default, this can be deleted.
rebuildInfo.getOrInsertCandidateModule(adjacentMod)
.serializationStatus !=
serialization::Status::NotInOSSA) {
// Special-case here: If we're loading a .swiftmodule from the resource
// dir adjacent to the compiler, defer to the serialized loader instead
// of falling back. This is to support local development of Swift,