-
Notifications
You must be signed in to change notification settings - Fork 263
Set the minimum macOS deployment target to 10.13 for the test target #476
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?
Set the minimum macOS deployment target to 10.13 for the test target #476
Conversation
The lit test suite respects `MACOSX_DEPLOYMENT_TARGET` to determine the `-target` option passed to compilers. However, the `SwiftXCTestFunctionalTests` target and the `XCTest` project do not set `MACOSX_DEPLOYMENT_TARGET` in their build settings, so the default value (14.2 in the current Xcode installed on the CI) is used and the macOS version of the CI machine is older than it. This patch fixes the issue by setting `MACOSX_DEPLOYMENT_TARGET` to 10.13, which is currently used as the minimum macOS version requirement in ci.swift.org.
@swift-ci test |
@swift-ci test macOS |
Hmm, I guess some of the linker input uses system's Foundation instead of just built one... Not sure what brought it. |
The use of CoreFoundation while building with corelibs-foundation causes an unintentional dependency to the CoreFoundation framework due to the lack of way to distinguish corelibs-foundation's CoreFoundation from CoreFoundation.framework. From macOS 13, CoreFoundation started to depend on CoreServicesInternal, and it causes a transitive dependency from CoreFoundation.framework to Foundation.framework. ┌-> CoreFoundation --[NEW]--> CoreServicesInternal -┐ └-- Foundation <------------- CFNetwork ------------┘ Thus corelibs-xctest started to depend on Foundation.framework unintentionally from macOS 13. This unintentional dependency is problematic because it causes a duplicate loading of the Objective-C classes of Foundation from the corelibs-foundation and Foundation.framework even though we explicitly imports corelibs-foundation by `import SwiftFoundation`. This patch removes the use of CoreFoundation when building with corelibs-foundation based on the `USE_FOUNDATION_FRAMEWORK` definition.
@swift-ci test |
I found CoreFoundation.framework now transitively depends on Foundation.framework from macOS 13... See commit message on a6fc1e2 |
The Foundation.framework is usually implicitly linked by the Clang linker driver. However, we do not want to link it in XCTest because we use just built SwiftFoundation instead or we explicitly link it when USE_FOUNDATION_FRAMEWORK is on.
@swift-ci test |
* Disable autolinking of swiftCoreFoundation * Add `-nodefaultlibs` to the linker flags in tests
Hmm, I managed to get rid of CoreFoundation.framework dependency from the corelibs-foundation (In fact, we used to depend on it implicitly for a long!). However, it looks like For those who want to fix this, I pushed my WIP fixes to the following branches:
@parkera Do you think it's worth maintaining macOS build and checking on CI? |
On Darwin the "upward" dependency of CoreFoundation.framework on Foundation has been there since the release of macOS 14 and aligned releases. That is how we're achieving our promise of a single unified implementation written in Swift (e.g., all calendar calculations are now calling into the same open source implementation). In parallel with your effort here we've been considering how to migrate everyone using swift-corelibs-foundation to this new implementation. I don't have a full answer yet, but it seems reasonable in the short term to focus this project on building correctly for non-Darwin platforms. |
@swift-ci test |
@swift-ci test windows |
The lit test suite respects
MACOSX_DEPLOYMENT_TARGET
to determine the-target
option passed to compilers. However, theSwiftXCTestFunctionalTests
target and theXCTest
project do not setMACOSX_DEPLOYMENT_TARGET
in their build settings, so the default value (14.2 in the current Xcode installed on the CI) is used and the macOS version of the CI machine is older than it. This patch fixes the issue by settingMACOSX_DEPLOYMENT_TARGET
to 10.13, which is currently used as the minimum macOS version requirement in ci.swift.org.