Skip to content

Commit 5bcb8b8

Browse files
committed
Fix test failure after rebasing on top of latest main
1 parent 1bd92e9 commit 5bcb8b8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Sources/Basics/Triple+Basics.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,21 @@ extension Triple {
186186

187187
/// Returns `true` if code compiled for `triple` can run on `self` value of ``Triple``.
188188
public func isRuntimeCompatible(with triple: Triple) -> Bool {
189+
guard self != triple else {
190+
return true
191+
}
192+
189193
if
190194
self.arch == triple.arch &&
191195
self.vendor == triple.vendor &&
192196
self.os == triple.os &&
193-
self.environment == triple.environment
197+
self.environment == triple.environment,
198+
// If either of the triples have no `osVersion` specified, we can't determine compatibility and will
199+
// have to return `false`.
200+
let selfOSVersion = self.osVersion,
201+
let osVersion = triple.osVersion
194202
{
195-
return self.osVersion >= triple.osVersion
203+
return selfOSVersion >= osVersion
196204
} else {
197205
return false
198206
}

0 commit comments

Comments
 (0)