Skip to content

Conversation

@owenv
Copy link
Collaborator

@owenv owenv commented Dec 10, 2025

When zippering we need to include -platform_version for both macOS and Mac Catalyst, instead of only one or the other.

@owenv
Copy link
Collaborator Author

owenv commented Dec 10, 2025

@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]
Copy link
Collaborator

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() ?? [] {
Copy link
Collaborator

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.

@owenv owenv force-pushed the owenv/zipperplatformversion branch from 7403262 to 428855d Compare December 10, 2025 21:15
@owenv
Copy link
Collaborator Author

owenv commented Dec 10, 2025

@swift-ci test

@owenv owenv requested a review from jakepetroules December 10, 2025 21:16
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)'")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: s/us/is/

Suggested change
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)'")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants