Skip to content

Commit

Permalink
[readme] Add a section to the main readme describing how to create a …
Browse files Browse the repository at this point in the history
…Swift Toolchain like we do for the swift snapshots.
  • Loading branch information
gottesmm committed Aug 20, 2018
1 parent 32eacc5 commit 11cfa2c
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,49 @@ common debug flow would involve:
Another option is to change the scheme to "Wait for executable to be launched",
then run the build product in Terminal.

### Swift Toolchains

#### Building

Swift toolchains are created using the script
[build-toolchain](https://github.com/apple/swift/blob/master/utils/build-toolchain). This
script is used by swift.org's CI to produce snapshots and can allow for one to
locally reproduce such builds for development or distribution purposes. E.x.:

```
$ ./utils/build-toolchain $TOOLCHAIN_PREFIX
```

where ``$TOOLCHAIN_PREFIX`` is a string that will be prepended to the swift
package name in the produced tar ball. For instance, if ``$TOOLCHAIN_PREFIX``
was ``macOS``, the produced archive will have the name
``swift-macOS.tar.gz``.

Beyond building the toolchain, ``build-toolchain`` also supports the following
(non-exhaustive) set of useful options::

- ``--dry-run``: Perform a dry run build. This is off by default.
- ``--test``: Test the toolchain after it has been compiled. This is off by default.
- ``--distcc``: Use distcc to speed up the build by distributing the c++ part of
the swift build. This is off by default.

More options may be added over time. Please pass ``--help`` to
``build-toolchain`` to see the full set of options.

#### Installing into Xcode

On macOS if one wants to install such a toolchain into Xcode:

1. Untar and copy the toolchain to one of `/Library/Developer/Toolchains/` or
`~/Library/Developer/Toolchains/`. E.x.:

```
$ tar -xzf swift-macOS.tar.gz -C /
$ tar -xzf swift-macOS.tar.gz -C ~/
```

2. Specify the local toolchain for Xcode's use via `Xcode->Toolchains`.

### Build Failures

Make sure you are using the [correct release](#macos) of Xcode.
Expand Down

0 comments on commit 11cfa2c

Please sign in to comment.