Hi all,
Over the past couple of days I've been struggling with some toolchain... confusion? chicanery? mazurkas? ... in my local environment, and I think it's highlighting a disconnect between my understanding of how the toolchains and SDKs and environment "managers" (swiftly vs XCode, quotes for the latter) relate to are isolated from one another, and the consistency of this relationship across different platforms.
For context, my desktop environment is a mac running macos 26.6. It has the following toolchains installed:
- XCode17 beta last updated on 22 July
- The most recent XCode16
swiftly 1.1.3and the open-source toolchains:6.3.36.3.06.2.4
I'm also cross compiling, targeting a raspi, so I have a 6.3.3-RELEASE_debian_bookworm_aarch64 SDK installed for that purpose. The overall matrix of combos I'm trying is something like:
| Host OS | Target | SDK | Toolchain | Manager | Result | Notes |
|---|---|---|---|---|---|---|
| MacOS | MacOS | default for tools | 6.4.X |
XCode | ||
| MacOS | Rasp (Debian 12) | 6.3.3-RELEASE_debian_bookworm_aarch64 |
6.3.3 |
swiftly |
||
| Linux (Docker) | Linux(Docker) | default for tools | 6.3.3 |
Provided in image (swift:6.3-noble) |
||
| MacOS | MacOS | ? | 6.3.3 |
swiftly |
See Below |
So, what I'm seeing is success across all of those combinations, except for when I attempt to use the swiftly-provided open-source 6.3.3 MacOS toolchain. The specific failure that I see is in swift-crypto, which was originally filed as #449: CryptoExtras: SHA512256Digest fails ContiguousBytes conformance on the macOS 27 SDK (MemberImportVisibility + missing import Foundation) (which I missed when I duped it in #451.
I understand the differences between the toolchains and SDKs. I also understand the legacy of XCode bundling toolchains, and xcode-select managing the blessing of bundled toolchains to be used as the system toolchain. What surprised me was that the failure I saw in the swift-crypto build related to a missing protocol conformance requirement (the withBytes(…) method of ContiguousBytes. That declaration is marked "beta" in the docs, so I assume it's new for 6.4. For the build that failed, I was trying to take special care that the toolchain is not contaminated with any 6.4 bits, and that I was using clean, open-source 6.3.3 soup-to-nuts:
- I was using the
6.3.3toolchain installed viaswiftly, with6.3.3configured in my.swift-versionin the associated project.6.3.3was also the global default. - My
Package.swiftis configured forswift-tools-version 6.3. - While I had compiled the tree using the xcode-supplied toolchain, I've never opened the project with Xcode. It's only ever been opened or edited with
vior Zed. - I completely blew away my
.build/andPackage.resolvedbefore building. - I compiled using
swiftly run swift build.
My expectation, was that aside from the tools running on macos, I'd be using a consistent 6.3.3 toolchain/sdk combo analgous to what's used in the Docker build. Based upon what I saw, the only explanation that came to mind was that somehow the 6.4 sdk was leaking into the build environment.
My confusion is probably mine alone, so if you've read this far and come to that conclusion, then we're on the same page, and I just want to understand this better to manage my own expectations. I haven't found anything so far that spells this out, but I suspect that's just because I haven't dug deeply enough. I also haven't found any tools beyond what's mentioned above to help diagnose these configurations.
As I mentioned in #449, I'd hoped that by writing this and making myself actually think, I'd answer my own question, but doesn't seem I have. So, clicking the button. I'd appreciate any tips or resources that come to mind.
Thanks!
And thanks especially to the folks who have been fielding my questions/reports elsewhere. Your exemplary bedside manner is noted.