swiftlang / swift-corelibs-xctest

The XCTest Project, A Swift core library for providing unit test support
swift.org
Apache License 2.0
1.15k stars 267 forks source link

Set the minimum macOS deployment target to 10.13 for the test target #476

Open kateinoigakukun opened 9 months ago

kateinoigakukun commented 9 months ago

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.

kateinoigakukun commented 9 months ago

@swift-ci test

kateinoigakukun commented 9 months ago

@swift-ci test macOS

kateinoigakukun commented 9 months ago
objc[11791]: Class _TtC10Foundation20_PropertyListDecoder is implemented in both /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (0x7ff847d9c528) and /Users/ec2-user/jenkins/workspace/swift-corelibs-xctest-PR-macos/branch-main/build/Ninja-DebugAssert/xctest-macosx-x86_64/Debug/SwiftFoundation.framework/Versions/A/SwiftFoundation (0x1071895c8). One of the two will be used. Which one is undefined.

Hmm, I guess some of the linker input uses system's Foundation instead of just built one... Not sure what brought it.

kateinoigakukun commented 9 months ago

@swift-ci test

kateinoigakukun commented 9 months ago

I found CoreFoundation.framework now transitively depends on Foundation.framework from macOS 13... See commit message on https://github.com/apple/swift-corelibs-xctest/pull/476/commits/a6fc1e22485bd36c2aba44dbb5eb84d399fdba55

kateinoigakukun commented 9 months ago

@swift-ci test

kateinoigakukun commented 9 months ago

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 TARGET_OS_MAC code paths have several subtle assumptions that work only with CoreFoundation.framework, so test suites crashed around memory management stuff. IIUC macOS support of swift-corelibs-foundation and swift-corelibs-xctest is just for compatibility checks, so I gave up repairing the build for now.

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?

parkera commented 9 months ago

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.

MaxDesiatov commented 8 months ago

@swift-ci test

MaxDesiatov commented 8 months ago

@swift-ci test windows

ikesyo commented 8 months ago

Looks like we need to check availability (or bump the deploymen target to 10.15) for these async tests: