With three official SDKs now listed on swift.org with the 6.3 release, we'd like to start tightening up and improving the SDK development experience.
So far, swift build --swift-sdk aarch64-swift-linux-musl assumed you knew what you were doing and hadn't installed a bunch of SDKs that listed the same triple you searched for, but as the SDK feature is being used by more new users with more SDKs and testing snapshots now, we think it's better to start erroring if multiple SDKs match. Right now, SwiftPM will warn you and pick a random SDK that matches, before proceeding with that one.
In addition, the --triple flag has never worked with Swift SDK bundles, as it was added for the older destination JSON format that preceded bundles, so I'll be adding better support for that flag, including listing out the triples in an SDK bundle. If users prefer that, maybe we can deprecate the --swift-sdk <triple> option for the dedicated --triple flag one day. I'm also fixing the swift sdk configure command.
Finally, while these changes will make it easier to check which SDKs provide the same triples and choose the one you want, we still don't do anything to check Swift versions, ie SwiftPM will go ahead and try to build a Swift 6.2 SDK with the Swift 6.3 compiler if you ask it to, then error only after the build starts. SwiftPM doesn't know to just choose the right SDK that matches the compiler, if you have both 6.2 and 6.3 SDKs installed. @dschaefer2 has suggested adding that checking, as swift -print-target-info | grep swiftCompilerTag will tell you which compiler you have, so we'll need to check that against the SDK version.
If you have any feedback on the CLI experience for the swift sdk command or would like to review the two draft pulls I linked above, please let us know what you think.