[6.3] Error if multiple Swift SDKs match --swift-sdk <selector> and fix searching for SDKs when a --triple is specified alongside#9998
Conversation
|
@swift-ci test |
|
Thanks - Given Mishal's announcement in https://forums.swift.org/t/development-open-for-swift-6-3-1-for-linux-and-windows/85715/8 about the very short timeframe for the 6.3.2 release, in my opinion this is a little too risky to include despite the benefits of getting the improved behavior out to users faster, as preferably we'd have more time to live on the change before it shipped to ensure there's no unexpected emergent behavior. |
|
These bugfix pulls are small and pretty easy to examine to see what they do, plus they only affect SDK search. I think the risk is pretty low, and the fact that all CI just passed suggests there is no unexpected change. |
|
Updated to pull in the one-line library search path fix from #10008 also. This code has been carefully reviewed and is locally contained to only SDK search. Given how bad the devex is with choosing between multiple SDK bundles installed right now, I think we should get these bugfixes in for 6.3.2. If it's a matter of accountability, I will fix any issues that come up from this change, which is easy for me to say, as I expect none. 😉 |
|
@swift-ci test |
|
@swift-ci test windows |
|
This change won’t be included in the Swift 6.3.2 release. If it’s important, please contact the release-mangers on forums.swift.org as soon as possible. |
|
@shahmishal, not important, the SwiftPM managers don't want this in 6.3.2, so I will wait. |
|
@swift-ci test windows |
|
@swift-ci test self hosted windows |
|
@swift-ci test self hosted windows |
…SDK name Extend `selectBundle()` to use the existing `selectSwiftSDK(id:hostTriple:targetTriple)` overload, plus fix the latter to check the full triple string, which affects `swift sdk configure` also. Fixes swiftlang#7973 and swiftlang#9220
### Motivation:
SDK search assumed you knew what you're doing and would pick any SDK that matched, time to make that more strict.
### Modifications:
Collect all matches instead, then spit out different errors if there were multiple matches.
### Result:
Emphasize to SDK users that they need to have their installed SDKs not contain the same target triples, when selecting with a triple alone.
|
I had to rebase to get the CI to apply others' merged testing fixes from the 6.3 branch. @swift-ci test |
|
@swift-ci smoke test |
1 similar comment
|
@swift-ci smoke test |
|
@swift-ci test |
|
@swift-ci test windows |
|
Passed all CI, just waiting on review. |
Explanation: The
--tripleflag has never worked with SDK bundles, in part because--swift-sdkwould just return the first SDK that matched, ie the results were indeterminate if there were multiple matches. Start erroring instead for the latter and make sure the former works. Also, fix a bug in reading library search paths from SDK bundles.Scope: Only affects SDK selection from bundles, plus the small library search bugfix
Issues:
--swift-sdkoption cannot uniquely select a Swift SDK #7973 and SwiftPM selects wrong architecture from multi-arch Swift SDK when using --swift-sdk and --triple #9220Original PRs: Error if multiple Swift SDKs match
--swift-sdk <selector>#9937, Fix searching for SDKs when a--tripleis specified along with the SDK name #9955, Fix initializinglibrarySearchPathsin UserToolchain #10008Risk: Low, works well in trunk
Testing: Passed all trunk CI and my local usage
Reviewers: @jakepetroules and @owenv