Commit 84ba06c
committed
Elide SwiftNIO on WASI
Motivation:
SwiftNIO cannot be built for `wasm32-unknown-wasip1`, so SQLKit currently fails
to configure for that platform at all — the failure is in dependency resolution,
before any of the conditional sources in the previous commit get a chance to
matter.
Modifications:
Gate the NIOCore product on `.when(platforms: nonWASIPlatforms)`. Target
dependency conditions are evaluated per platform, so on WASI the product is
simply not linked and the `canImport(NIOCore)` gates select the `async` API.
`.when(platforms:)` can only include, never exclude, so excluding one platform
means enumerating the others; the list is the set SPM 6.1 knows about, noted as
such so it is not extended without also raising the manifest's tools version.
The test target's NIOCore and NIOEmbedded dependencies are gated the same way;
the suite exercises the `EventLoopFuture` API and is not run on WASI.
Result:
On every other platform the resolved dependency set is byte-identical to before.
On WASI the build graph contains no SwiftNIO module — not NIOPosix, not NIOCore,
not NIOConcurrencyHelpers.1 parent fa5722b commit 84ba06c
1 file changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
38 | 47 | | |
39 | 48 | | |
40 | 49 | | |
41 | | - | |
42 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
| |||
0 commit comments