Once upon a time, we were able to develop SwiftFoundation only with Xcode, latest toolchain, swift-corelibs-xctest repo, and swift-corelibs-foundation repo.
Nowadays, we can't do so because:
SR-12177 hinders our using latest toolchain to run TestFoundation.
Xcode's default toolchain lacks some(all?) SPIs and can't compile SwiftFoundation. (For example, "Cannot find '_forEachField' in scope" errors occur because @_spi(Reflection) import Swift imports no SPI symbols.)
TestFoundation can't be compiled with any toolchain using Xcode which tries to load duplicately modulemaps of CoreFoundation. [Forum topic #50360] [GitHub issue #4608]
Thus we must checkout swift repo and related repos and run 'swift/utils/build-script' to test SwiftFoundation.
How do we regain the past condition?
I have no idea.
I haven't had the chance to try it myself yet, but do you think the improvements in Swift 5.7 for module aliasing could help with the CoreFoundation import issue?
For the _forEachField thing, I think the ultimate resolution is to find a way to get reflection to be a first class Swift feature. AttributedString needs to use it to get the API surface we wanted, unfortunately.
I've been trying to debug SwiftFoundation recently and have run into the same problem.
I'm trying other ways to debug SwiftFoundation,actually not ideal.
Can you tell me more about "Thus we must checkout swift repo and related repos and run 'swift/utils/build-script' to test SwiftFoundation."?
Thanks
I'm disappointed that it looks like the problem of not being able to compile with Xcode has been around for a long time,And I don't see any official Apple developers providing us with answers or working on solutions.