@@ -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