Skip to content

Serialization: Tagged compilers should rebuild modules from swiftinterface under the resource-dir #68382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/Frontend/ModuleInterfaceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,15 +820,21 @@ class ModuleInterfaceLoaderImpl {
return std::make_error_code(std::errc::not_supported);
} else if (isInResourceDir(adjacentMod) &&
loadMode == ModuleLoadingMode::PreferSerialized &&
!version::isCurrentCompilerTagged() &&
rebuildInfo.getOrInsertCandidateModule(adjacentMod).serializationStatus !=
serialization::Status::SDKMismatch) {
// 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 mainly to support development of Swift,
// of falling back. This is to support local development of Swift,
// where one might change the module format version but forget to
// recompile the standard library. If that happens, don't fall back
// and silently recompile the standard library -- instead, error like
// we used to.
// and silently recompile the standard library, raise an error
// instead.
//
// This logic is disabled for tagged compilers, so distributed
// compilers should ignore this restriction and rebuild all modules
// from a swiftinterface when required.
//
// Still accept modules built with a different SDK, allowing the use
// of one toolchain against a different SDK.
LLVM_DEBUG(llvm::dbgs() << "Found out-of-date module in the "
Expand Down