@@ -820,15 +820,21 @@ class ModuleInterfaceLoaderImpl {
820
820
return std::make_error_code (std::errc::not_supported);
821
821
} else if (isInResourceDir (adjacentMod) &&
822
822
loadMode == ModuleLoadingMode::PreferSerialized &&
823
+ !version::isCurrentCompilerTagged () &&
823
824
rebuildInfo.getOrInsertCandidateModule (adjacentMod).serializationStatus !=
824
825
serialization::Status::SDKMismatch) {
825
826
// Special-case here: If we're loading a .swiftmodule from the resource
826
827
// 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,
828
829
// where one might change the module format version but forget to
829
830
// 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
+ //
832
838
// Still accept modules built with a different SDK, allowing the use
833
839
// of one toolchain against a different SDK.
834
840
LLVM_DEBUG (llvm::dbgs () << " Found out-of-date module in the "
0 commit comments