Xcode doesn't use selected toolchain to resolve swift packages

Number:rdar://FB7691693 Date Originated:2020-05-07
Status:Open Resolved:
Product:Xcode Product Version:Xcode 11.4.1
Classification:Incorrect/Unexpected Behavior Reproducible:Yes
Please provide a descriptive title for your feedback:
Xcode doesn't use selected toolchain to resolve swift packages

Which area are you seeing an issue with?

What type of feedback are you reporting?
Incorrect/Unexpected Behavior

What version of Xcode are you using?
Xcode 11.4.1


Please describe the issue:
When using the Swift 5.3 development snapshot dated May 4, 2020.

I am attempting to try out the new Swift Package Manager resources from SE-0271, which is included in the latest toolchains for Swift 5.3. However Xcode fails to resolve the swift packages with the following error:

/Users/danielctull/Developer/Advent of Code/Package.swift: package at '/Users/danielctull/Developer/Advent of Code' is using Swift tools version 5.3.0 but the installed version is 5.2.0

The project can be found at https://github.com/danielctull/advent-of-code, I have attached a zip of the directory of the package and you can see it runs successfully using the Swift 5.3 nightly docker image here: https://github.com/danielctull/Advent-of-Code/runs/648828041

Please list the steps you took to reproduce the issue:
1. Download and install the Swift 5.3 toolchain
2. Select this toolchain in Xcode
3. Open the supplied Advent of Code package
4. See the error about the Package.swift using 5.3 but the installed version being 5.2.

What did you expect to happen?
I expected Xcode to be able to build packages which require features found in the Swift 5.3 development toolchain I had downloaded by using that toolchain to resolve the swift package.

What actually happened?
Failure to resolve package manifest and thus a failure to build anything.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!