-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Implicitly support Darwin SDKs on macOS #6828
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
Changes from 5 commits
9aa5ee8
b82a400
ca0822d
a202320
46b65d1
d253fab
ba32e4c
b273ba4
2f9adad
9e51703
ed1513e
c62ad42
6d89477
c7c6e4f
4633c7f
c610dc8
7e9d820
78bed58
0b09cb1
88fb22b
b6870b3
c2e9cca
5560fd3
79f582d
3fe9ac7
24cfc46
8351d14
bb4f49c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -554,4 +554,23 @@ final class DestinationTests: XCTestCase { | |
parsedDestinationV2Musl | ||
) | ||
} | ||
|
||
func testDefaultSDKs() throws { | ||
let hostSDK = try SwiftSDK.hostSwiftSDK("/prefix/bin") | ||
|
||
#if os(macOS) | ||
let iOSTriple = try Triple("arm64-apple-ios") | ||
let iOS = try XCTUnwrap(SwiftSDK.defaultSwiftSDK(for: iOSTriple, hostSDK: hostSDK)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the SwiftPM test suite have a way to mock shell invocations? This invokes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no such mocking available at the moment, unfortunately. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and of course this is precisely the test that fails on CI 😶 Looks like it can't find iPhoneOS.sdk — could that be because the iOS component isn't installed in the runner's Xcode? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's quite likely, since we're not building for iOS on Swift CI. IMO better not to rely on that to be present. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MaxDesiatov do you know if this is still the case? Worth triggering CI again to confirm? If so I could add some plumbing to inject xcrun as a mockable dependency instead. |
||
XCTAssertEqual(iOS.toolset.rootPaths, hostSDK.toolset.rootPaths) | ||
|
||
let sdkPath = try XCTUnwrap(iOS.pathsConfiguration.sdkRootPath) | ||
XCTAssertEqual(sdkPath.extension, "sdk") | ||
|
||
let sdkName = try XCTUnwrap(sdkPath.components.last) | ||
XCTAssert(sdkName.hasPrefix("iPhoneOS")) | ||
|
||
let cFlags = iOS.toolset.knownTools[.cCompiler]?.extraCLIOptions ?? [] | ||
XCTAssertFalse(cFlags.contains { $0.lowercased().contains("macos") }, "Found macOS path in \(cFlags)") | ||
#endif | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.