mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge remote-tracking branch 'origin/main' into rebranch
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user