Use the toolset paths from sdk configure to override an SDK bundle's toolset paths#10016
Use the toolset paths from sdk configure to override an SDK bundle's toolset paths#10016finagolfin wants to merge 1 commit into
sdk configure to override an SDK bundle's toolset paths#10016Conversation
| ) | ||
| let originalToolsetPaths = swiftSDK.pathsConfiguration.toolsetPaths ?? [] | ||
| try configurationStore.readConfiguration(sdkID: ID, sdk: &swiftSDK) | ||
| loadedToolsetPaths = !originalToolsetPaths.elementsEqual(swiftSDK.pathsConfiguration.toolsetPaths ?? []) |
There was a problem hiding this comment.
This makes sure the user-configured toolset path is different from the one in the bundle, otherwise do nothing below.
|
@swift-ci test linux |
|
Personally I think the toolsets should stack, but maybe others will disagree. I would like us to clearly document this to set expectations going forward. Initially maybe just in the command help but I'd like to also add an article to the DocC catalog when I have a moment |
|
Of course some of them will stack, but the question is which ones? There are currently three ways to set the toolsets for an SDK bundle:
Since only 1. and 3. are currently enabled in SwiftPM, any toolsets set by 3. are simply merged into those from 1. I think the right move for 2., once we enable it in this pull, is to override 1., ie 1. is no longer respected once 2. is set. 3. will still merge into 2. or 1., whichever is being used. This will give users a way to completely override 1., which they currently cannot do with 3. and is how Since @owenv and @jakepetroules, let me know what you think. |
sdk configure with the other toolset pathssdk configure to override an SDK bundle's toolset paths
|
This implements the above override logic, will add some tests next, if this override approach is agreed to. |
#9229 finally got
swift sdk configureworking to apply local config overrides to target triples in SDK bundles when compiling with the native build system, but I noticed when working on that that the configured toolset paths are not applied. This is a better version of the commit I had added there, but more deliberation is still needed.Right now, this will do the same as when the
--toolsetflag is added on the command-line, ie merge any newly configured toolset flags into the toolset from the original SDK bundle. However, unlike the--toolsetflag, those usingsdk configureprobably expect to override the original toolset in the SDK bundle altogether, as they do with the other paths.That will require more changes wiping the original toolset that is probably decoded from the SDK bundle and separately initialized.
Since this
swift sdk configurefeature never affected compilation until now, we have a free hand here to decide how it should work for toolsets for the first time.@owenv, you will have to decide this for your similar swift-build pull, #10013, let me know what you're doing there.
@MaxDesiatov and @jakepetroules, let me know what you think this should do for user-configured toolset paths.