Skip to content

[5.5] Respect SWIFT_TOOLCHAIN_MACOS_DEPLOYMENT_TARGET when set (such as during Swift toolchain build) #224

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

Merged

Conversation

abertelrud
Copy link
Contributor

This is the Swift 5.5 nomination of fixes for @available() annotations merged to mainline in #220.

(cherry picked from commit 21a7918)

…h as during Swift toolchain build) (#220)

If it is not set in the environment, stay with the default minimum deployment target of 10.10 on macOS.

This aligns with both swift-package-manager and with swift-driver, and is important now that ToolSupportCore has started containing some code that is annotated with availability for Darwin platforms.  It uses the more project-neutral name `SWIFT_TOOLCHAIN_MACOS_DEPLOYMENT_TARGET` and the expectation is that both SwiftPM and SwiftDriver will switch to using it as well.

(cherry picked from commit 21a7918)
@abertelrud abertelrud changed the base branch from main to release/5.5 June 12, 2021 23:14
@abertelrud abertelrud self-assigned this Jun 12, 2021
@abertelrud abertelrud added the swift 5.5 This PR targets the 5.5 branch label Jun 12, 2021
@abertelrud
Copy link
Contributor Author

@swift-ci please test

import class Foundation.ProcessInfo

let macOSPlatform: SupportedPlatform
if let deploymentTarget = ProcessInfo.processInfo.environment["SWIFT_TOOLCHAIN_MACOS_DEPLOYMENT_TARGET"] {
Copy link
Contributor

Choose a reason for hiding this comment

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

@abertelrud are we also changing SwiftPM to use this instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's the plan, although this needs to be coordinated with @shahmishal. But I can put up a SwiftPM and SwiftDriver change to favour SWIFT_TOOLCHAIN_MACOS_DEPLOYMENT_TARGET and for now falling back on SWIFTPM_MACOS_DEPLOYMENT_TARGET until the new one is set in toolchain builds.

@abertelrud abertelrud merged commit 0f21a8f into release/5.5 Jun 14, 2021
@abertelrud abertelrud deleted the eng/anders/allow-newer-min-deployment-target-5.5 branch August 5, 2021 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift 5.5 This PR targets the 5.5 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants