Skip to content

Commit 2d761c6

Browse files
committed
Move OS component version comparison to isRuntimeCompatible (#6925)
Cherry-pick of #6819. When setting host triple in Swift SDKs to `arm64-apple-macosx13.0` to allow cross-compiling from an older version of macOS, this triple is not recognized as directly matching `arm64-apple-macosx14.0` on a newer version of macOS. We should support backward compatibility with Swift SDKs that were built for older version of macOS. Resolves rdar://113967401. ``` # Conflicts: # Sources/PackageModel/SwiftSDKBundle.swift ```
1 parent 7c06099 commit 2d761c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Tests/BasicsTests/TripleTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,11 @@ final class TripleTests: XCTestCase {
220220
try XCTAssertFalse(Triple("x86_64-apple-macosx").isRuntimeCompatible(with: Triple("x86_64-apple-linux")))
221221
try XCTAssertTrue(Triple("x86_64-apple-macosx14.0").isRuntimeCompatible(with: Triple("x86_64-apple-macosx13.0")))
222222
}
223+
224+
func testIsRuntimeCompatibleWith() throws {
225+
try XCTAssertTrue(Triple("x86_64-apple-macosx").isRuntimeCompatible(with: Triple("x86_64-apple-macosx")))
226+
try XCTAssertTrue(Triple("x86_64-unknown-linux").isRuntimeCompatible(with: Triple("x86_64-unknown-linux")))
227+
try XCTAssertFalse(Triple("x86_64-apple-macosx").isRuntimeCompatible(with: Triple("x86_64-apple-linux")))
228+
try XCTAssertTrue(Triple("x86_64-apple-macosx14.0").isRuntimeCompatible(with: Triple("x86_64-apple-macosx13.0")))
229+
}
223230
}

0 commit comments

Comments
 (0)