Skip to content

Commit 7ab7229

Browse files
Update how-to-build-toolchain.md for the latest swiftwasm-build layout
1 parent ca29eac commit 7ab7229

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
11
# How to build toolchain
22

33
This document describes how to build the toolchain for WebAssembly.
4-
This is just a quick guide, so if you want to know more about the toolchain, it might be good entry point to read [continuous integration scripts](https://github.com/swiftwasm/swift/blob/swiftwasm/.github/workflows/build-toolchain.yml).
4+
This is just a quick guide, so if you want to know more about the toolchain, it might be good entry point to read [continuous integration scripts](https://github.com/swiftwasm/swiftwasm-build/blob/main/.github/workflows/build-toolchain.yml).
55
Or you can ask questions in GitHub issues or SwiftWasm Discord server (see [the official website](https://swiftwasm.org) for the link).
66

77
## 1. Checkout the project source code.
88

99
```sh
1010
$ mkdir swiftwasm-source
1111
$ cd swiftwasm-source
12-
$ git clone https://github.com/swiftwasm/swift.git
13-
$ ./swift/utils/update-checkout --clone --scheme wasm
12+
$ git clone https://github.com/swiftwasm/swiftwasm-build.git
13+
$ cd swiftwasm-build
14+
$ ./tools/build/install-build-sdk.sh main
15+
$ ./tools/git-swift-workspace --scheme main
1416
```
1517

1618
## 2. Install required dependencies
1719

1820
1. [Please follow the upstream instruction](https://github.com/apple/swift/blob/main/docs/HowToGuides/GettingStarted.md#installing-dependencies)
19-
2. Download WebAssembly specific build toolchain
20-
21-
```sh
22-
$ ./swift/utils/webassembly/install-build-sdk.sh
23-
```
24-
25-
3. (If you want to run test suite) Install [`Wasmer`](https://wasmer.io/)
21+
2. (If you want to run test suite) Install [`Wasmtime`](https://wasmtime.dev/)
2622

2723
## 3. Build the toolchain
2824

29-
`./swift/utils/webassembly/build-toolchain.sh` will build:
25+
`./tools/build/build-toolchain.sh`
26+
27+
This script will build the following components:
3028

3129
1. Swift compiler that can compile Swift code to WebAssembly support
3230
2. Swift standard library and core libraries for WebAssembly
@@ -35,16 +33,17 @@ $ ./swift/utils/webassembly/install-build-sdk.sh
3533
## Build on Docker
3634

3735
You can also build the toolchain on Docker image used in CI.
36+
Note that you have already checked out the source code in [the previous step](#1-checkout-the-project-source-code).
3837

3938
```sh
4039
$ docker volume create oss-swift-package
4140
$ docker run --name swiftwasm-ci-buildbot \
4241
-dit \
4342
-w /home/build-user/ \
44-
-v $PWD/swift:/home/build-user/swift \
43+
-v ./swiftwasm-source:/source \
4544
-v oss-swift-package:/home/build-user \
4645
ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04
47-
$ docker exec swiftwasm-ci-buildbot ./swift/utils/webassembly/ci.sh
46+
$ docker exec swiftwasm-ci-buildbot /bin/bash -lc 'env; cp -r /source/* /home/build-user/; ./swiftwasm-build/tools/build/ci.sh main'
4847
$ docker cp swiftwasm-ci-buildbot:/home/build-user/swift-wasm-DEVELOPMENT-SNAPSHOT-*-ubuntu-20.04.tar.gz .
4948
```
5049

0 commit comments

Comments
 (0)