Merge remote-tracking branch 'origin/main' into rebranch

This commit is contained in:
swift-ci
2023-02-14 09:38:50 -08:00
8 changed files with 62 additions and 22 deletions

View File

@@ -356,7 +356,7 @@ static ValidationInfo validateControlBlock(
// Disable this restriction for compiler testing by setting this
// env var to any value.
static const char* ignoreRevision =
::getenv("SWIFT_DEBUG_IGNORE_SWIFTMODULE_REVISION");
::getenv("SWIFT_IGNORE_SWIFTMODULE_REVISION");
if (ignoreRevision)
break;
@@ -370,12 +370,20 @@ static ValidationInfo validateControlBlock(
if (forcedDebugRevision ||
(requiresRevisionMatch && version::isCurrentCompilerTagged())) {
StringRef compilerRevision = forcedDebugRevision ?
forcedDebugRevision : version::getCurrentCompilerTag();
forcedDebugRevision : version::getCurrentCompilerSerializationTag();
if (moduleRevision != compilerRevision) {
result.status = Status::RevisionIncompatible;
// The module versions are mismatching, record it and diagnose later.
result.problematicRevision = moduleRevision;
// We can't trust this module format at this point.
return result;
// Reject the module only it still mismatches without the last digit.
StringRef compilerRevisionHead = compilerRevision.rsplit('.').first;
StringRef moduleRevisionHead = moduleRevision.rsplit('.').first;
if (moduleRevisionHead != compilerRevisionHead) {
result.status = Status::RevisionIncompatible;
// We can't trust the module format at this point.
return result;
}
}
}
break;