How to build toolchain

This document describes how to build the toolchain for WebAssembly. 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. Or you can ask questions in GitHub issues or SwiftWasm Discord server (see the official website for the link).

1. Checkout the project source code.

$ mkdir swiftwasm-source
$ cd swiftwasm-source
$ git clone
$ ./swift/utils/update-checkout --clone --scheme wasm

2. Install required dependencies

  1. Please follow the upstream instruction
  2. Download WebAssembly specific build toolchain
$ ./swift/utils/webassembly/
  1. (If you want to run test suite) Install Wasmer

3. Build the toolchain

./swift/utils/webassembly/ will build:

  1. Swift compiler that can compile Swift code to WebAssembly support
  2. Swift standard library and core libraries for WebAssembly

Build on Docker

You can also build the toolchain on Docker image used in CI.

$ docker volume create oss-swift-package
$ docker run --name swiftwasm-ci-buildbot \
    -dit \
    -w /home/build-user/ \
    -v $PWD/swift:/home/build-user/swift \
    -v oss-swift-package:/home/build-user \
$ docker exec swiftwasm-ci-buildbot ./swift/utils/webassembly/
$ docker cp swiftwasm-ci-buildbot:/home/build-user/swift-wasm-DEVELOPMENT-SNAPSHOT-*-ubuntu-20.04.tar.gz .