swift-foundation
swift-foundation copied to clipboard
Get Swift-Foundation building for Musl/Static SDK
This adds the missing imports to get Swift-Foundation building against Musl so we can get the static SDK going again.
We can do that, but since they aren't used in the build, we don't need to build them at all.
We can do that, but since they aren't used in the build, we don't need to build them at all.
*yet - eventually the macro will be needed to build Foundation itself, so this isn't an option that we can expect to be long-lived if we did add it
The install/deployment story for macros is still very hazy and will likely need to change, but this is for 6.0. Without changing SPM and the compiler, the only way to get them to work for 6.0 is for the compiler to pull the macro from the toolchain side of things rather than in the SDK itself. This is safe enough because the static SDK only works with an aligned toolchain, so the macro content in the toolchain and the SDK content in the static SDK can't be out-of-sync and still be a viable configuration.
Unless you're planning on making them required to build Swift-Foundation in the 6.0 release? In which case, yes, we should take the bits of https://github.com/apple/swift-foundation/pull/714 for ensuring that the macros are compiled for the machine doing the build rather than the machine that we're building for. At the same time, in that case, we should build the macro independently as a separate project and expose it through some SwiftFoundationMacroConfig.cmake file so that we can find_package it and re-use the same one across builds instead of rebuilding it for each architecture.
but this is for 6.0.
Ah I missed that this is for 6.0 - normally for 6.0 work we merge to main and then cherry-pick back to 6.0 filling out the nomination template, could we follow that pattern here to be consistent? That will help us on the Foundation team out a lot with the tooling that we use to manage the repo. But yes we don't plan to require the macro to build Foundation itself in the swift 6 timeframe, so if we need to exclude the macro build from the static SDK due the the incompatibilities at the moment, that seems reasonable. Is that what the stdlib macros do today?
https://github.com/apple/swift-corelibs-foundation/pull/5060 @swift-ci please test
This change will need to be cherry-picked to release/6.0. Please tag @itingliu for review since she's the release manager for 6.0
@swift-ci please test