Open kaijiemu opened 2 years ago
Unfortunately, there are bugs to build TestFoundation on macOS. Not only SR-12177, but also...
also cannot be compiled with the default toolchain, since
String.swift
uses the@_spi
feature to callString(_cocoaString:)
and compiling with the default toolchain does not expose the required API.
https://forums.swift.org/t/ci-not-testing-foundation-overlay/51595.
Ah, it's worse than I expected.
The reason why kCF*
s become ambiguous is because Xcode is trying to load modulemap
s of CoreFoundation
twice: the one in Xcode's SDK and the repo's one.
It seems that this problem occurs no matter which toolchain is used.
I have successfully compiled SwiftFoundation, and then encountered the same error. I have tried the methods mentioned here https://forums.swift.org/t/cant-run-testfoundation-target-in-swift-corelibs-foundation-repository/50360/7, but still can't solve
Does this problem still exist?
This is one of the reasons we decided we couldn't really support building the swift-corelibs-foundation module for macOS -- there is just an unresolvable ambiguity with the system frameworks. XCTest, for example, winds up causing a cycle.
I am starting contributing Swift Foundation framework. I am using swift-corelibs-foundation repository by following this guide: swift-corelibs-foundation/GettingStarted.md at main · apple/swift-corelibs-foundation · GitHub 6
But it is failed when I try to run TestFoundation:
What can I do about it?Thanks