Support Swift SDKs w/ many metadata files in same directory #8638
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
Swift SDK artifact bundle for WASI now supports both embedded and non-embedded modes. Majority of their content is overlapping, thus to avoid duplication they live in the same source tree.
Currently, SwiftPM requires that Swift SDKs are located in separate directories, with
swift-sdk.json
metadata at the root of each directory.Modification:
SwiftPM can now parse Swift SDK metadata that points directly to metadata JSON files instead of their root directories.
Result:
We can avoid changing file system layout in the artifact bundles for WASI and just place sibling
nonembedded.json
andembedded.json
Swift SDK metadata files in the same directory in their existing layout.The change is transparent to Swift SDK users and is an optional and incremental addition for Swift SDK authors.
As Swift SDKs are required to exactly match the version of the host toolchain, there are no backward compatibility concerns with this change.