Are 5.10 and 5.11 toolchain builds falling back to 5.9 when building a package from Xcode?

Has there been anything done lately that might affect how nightly toolchain builds can be used from in Xcode?

I created (from Xcode) a new Executable Package. This is basically just a very vanilla template, but I hack the header on package.swift:

// swift-tools-version: 5.10

When I install swift-5.10-DEVELOPMENT-SNAPSHOT-2024-02-14-a and swift-DEVELOPMENT-SNAPSHOT-2024-02-14-a (which should map to 5.11)… I no longer can build from Xcode:

package 'myexecutable' is using Swift tools version 5.10.0 but the installed version is 5.9.0

Is this legit? Should there be any reason why installing those toolchains and selecting them from Xcode should fail to build a package that requires 5.10?

Unfortunately Xcode embeds its own forked build of SwiftPM (Xcode.app/Contents/SharedFrameworks/SwiftPM.framework) rather than invoking the swift-package/etc. command line tools from the toolchain. To use SwiftPM from a custom toolchain you have to invoke it from the command line. AFAIK there's no way to override this but maybe someone else knows of a workaround.

2 Likes

@kabiroberai Ahh… that's good to know! I'm not blocked on anything for now. Sounds like this is a known issue. Thanks!