I wanted to compile swift-corelibs-foundation on macOS but so far hit lots of roadblocks. Is it really only supported on non-Darwin platforms? Can someone please guide me?
macOS 15.3.2, Xcode 16.2.
I've downloaded the main branch as well as the 6.0.3 release. Both fail in the same ways for me. Here's what I've tried:
Open Package.swift (as described here) in Xcode, clicked Product > Test:
Xcode: Cannot test target “TestFoundation” on “My Mac”: My Mac’s macOS 15.3.2 doesn’t match TestFoundation’s macOS 99.9 deployment target.
Open Package.swift, then Product > Build:
Xcode: Error: Import of shadowed module '_FoundationICU'
Go to the source in terminal, swift build:
Xcode: Error: Import of shadowed module '_FoundationICU'
Using CMAKE:
cmake: CFPlatform.c:2302:10: error: call to undeclared function 'posix_spawn_file_actions_addchdir'
swift-corelibs-foundation is not necessary (and not supported) for Darwin as it just provides a wrapper for the (open sourced) core foundation C library. On macOS, you have the C, the Objective-C and the Swift Foundation libraries already built into the OS, so the wrapper is not necessary.
The new cross-platform Foundation is swift-foundation which provides the "only" Foundation on non-Darwin platforms. On Darwin, it is available as Foundation.framework and nowadays provided the functionality for the C, Objective-C and Swift Foundations.
Thank you, but I know it's not necessary on macOS. What I want to do is improve some of the stuff there (in particular, Progress which currently isn't thread-safe and doesn't support KVO). I thought it would be nice if I could do the development in Xcode. I take it your answer is "do the development on a non-Mac platform instead"?
That documentation you quoted is for swift-foundation, not for swift-corelibs-foundation.
Indeed it's hard to develop swift-corelibs-foundation though:
Thanks for letting me know, that's interesting. Currently my concern is about porting existing code my first goal is improve the implementation of existing APIs.