-
Notifications
You must be signed in to change notification settings - Fork 133
Correctly specify platform_version when prelinking zippered binaries #971
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
base: main
Are you sure you want to change the base?
Conversation
|
@swift-ci test |
| let sdkVersion: Version? | ||
| if cbc.scope.evaluate(BuiltinMacros.IS_ZIPPERED) && buildPlatform == .macCatalyst { | ||
| if let baseSDKVersion = cbc.producer.sdk?.version { | ||
| sdkVersion = cbc.producer.sdk?.versionMap["macOS_iOSMac"]?[baseSDKVersion] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be an error if we fail to find the mapped value, if Apple has released an SDK with a missing Mac Catalyst mapping value, something is extremely wrong.
| let minDeploymentTarget = cbc.scope.evaluate(deploymentTargetMacro).nilIfEmpty, | ||
| let sdkVersion = cbc.producer.sdk?.version { | ||
| commandLine += ["-platform_version", "\(buildPlatform.rawValue)", minDeploymentTarget, sdkVersion.canonicalDeploymentTargetForm.description] | ||
| for buildPlatform in cbc.producer.targetBuildVersionPlatforms(in: cbc.scope)?.sorted() ?? [] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add an if let sdk = cbc.producer.sdk outside the for loop, since there's no point descending into this loop if we don't have one. Then there's no awkward nullability with the SDK version down lower.
7403262 to
428855d
Compare
|
@swift-ci test |
| let version: Version | ||
| if cbc.scope.evaluate(BuiltinMacros.IS_ZIPPERED) && buildPlatform == .macCatalyst { | ||
| guard let correspondingVersion = sdk.versionMap["macOS_iOSMac"]?[sdkVersion] else { | ||
| delegate.error("'\(sdk.canonicalName)' us missing a Mac Catalyst version mapping for '\(sdkVersion)'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/us/is/
| delegate.error("'\(sdk.canonicalName)' us missing a Mac Catalyst version mapping for '\(sdkVersion)'") | |
| delegate.error("'\(sdk.canonicalName)' is missing a Mac Catalyst version mapping for '\(sdkVersion)'") |
When zippering we need to include -platform_version for both macOS and Mac Catalyst, instead of only one or the other.