Skip to content

Commit 0a3ca91

Browse files
authored
Merge pull request #68382 from xymus/serial-special-case-here
Serialization: Tagged compilers should rebuild modules from swiftinterface under the resource-dir
2 parents e778356 + 52f2cc3 commit 0a3ca91

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,15 +820,21 @@ class ModuleInterfaceLoaderImpl {
820820
return std::make_error_code(std::errc::not_supported);
821821
} else if (isInResourceDir(adjacentMod) &&
822822
loadMode == ModuleLoadingMode::PreferSerialized &&
823+
!version::isCurrentCompilerTagged() &&
823824
rebuildInfo.getOrInsertCandidateModule(adjacentMod).serializationStatus !=
824825
serialization::Status::SDKMismatch) {
825826
// Special-case here: If we're loading a .swiftmodule from the resource
826827
// dir adjacent to the compiler, defer to the serialized loader instead
827-
// of falling back. This is mainly to support development of Swift,
828+
// of falling back. This is to support local development of Swift,
828829
// where one might change the module format version but forget to
829830
// recompile the standard library. If that happens, don't fall back
830-
// and silently recompile the standard library -- instead, error like
831-
// we used to.
831+
// and silently recompile the standard library, raise an error
832+
// instead.
833+
//
834+
// This logic is disabled for tagged compilers, so distributed
835+
// compilers should ignore this restriction and rebuild all modules
836+
// from a swiftinterface when required.
837+
//
832838
// Still accept modules built with a different SDK, allowing the use
833839
// of one toolchain against a different SDK.
834840
LLVM_DEBUG(llvm::dbgs() << "Found out-of-date module in the "

0 commit comments

Comments
 (0)