Skip to content

Commit db21bc2

Browse files
authored
Merge pull request #84399 from MaxDesiatov/docs-wasm-swift-sdk
docs/WebAssembly.md: update Swift SDK build instructions Swift SDKs require Swift SDK Generator to be built with its dependencies. Additionally, now that tests for Wasm stdlib run by default, we should include required tools. Embedded Swift build is also enabled in the documented invocation.
2 parents 12cf75d + 2987ec8 commit db21bc2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

docs/WebAssembly.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,25 @@ one wouldn't want end users to download multi-megabyte binaries.
1919
## Building Swift SDK for WebAssembly
2020

2121
The [Swift SDK](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md)
22-
for WebAssembly is built using the following command:
22+
for WebAssembly is built and tested using the following command:
2323

2424
```bash
25-
./utils/build-script --build-wasm-stdlib
25+
./utils/build-script --build-wasm-stdlib --wasmkit --install-llvm --install-swift --swiftpm --install-swiftpm \
26+
--libcxx --install-libcxx --llbuild --install-llbuild --swift-testing --install-swift-testing \
27+
--swift-testing-macros --install-swift-testing-macros --build-embedded-stdlib --build-embedded-stdlib-cross-compiling \
28+
'--llvm-install-components=llvm-ar;llvm-nm;llvm-ranlib;llvm-cov;llvm-profdata;llvm-objdump;llvm-objcopy;llvm-symbolizer;IndexStore;clang;clang-resource-headers;builtins;runtimes;clangd;libclang;dsymutil;LTO;clang-features-file;lld'
2629
```
2730

2831
This command will build the Swift compiler for the host platform and then build the Swift standard library
29-
for WebAssembly targets. The resulting Swift SDK `.artifactbundle` will be placed in the `../swift-sdk-generator/Bundles`
30-
directory.
32+
for WebAssembly targets. Toolchain `lit.py` tests will run on the freshly built stdlib, both for embedded and non-embedded
33+
builds.
34+
35+
The resulting Swift SDK `.artifactbundle` will be placed in the `../swift-sdk-generator/Bundles`
36+
directory. Install it using the following command (assuming you're in the `swift` directory of `update-checkout` clones):
37+
38+
```
39+
swift sdk install ../swift-sdk-generator/Bundles/swift-DEVELOPMENT-SNAPSHOT_wasm.artifactbundle
40+
```
3141

3242
## Building Swift SDK for WebAssembly without building the compiler
3343

0 commit comments

Comments
 (0)