@@ -84,9 +84,10 @@ toolchain as a one-off, there are a couple of differences:
8484 cd swift
8585 utils/update-checkout --clone
8686 ` ` `
87- ** Note:** If you' ve already forked the project on GitHub at this stage,
88- **do not clone your fork** to start off. We describe
89- [how to setup your fork](#setting-up-your-fork) in a subsection below.
87+ > ** Note**
88+ > If you' ve already forked the project on GitHub at this stage, **do not
89+ > clone your fork** to start off. We describe [how to setup your fork](#setting-up-your-fork)
90+ > in a subsection below.
9091 <!-- Recommending against cloning the fork due to https://github.com/apple/swift/issues/55918 and https://github.com/apple/swift/issues/55947. -->
91923. Double-check that `swift`' s sibling directories are present.
9293 ` ` ` sh
@@ -109,10 +110,10 @@ toolchain as a one-off, there are a couple of differences:
109110 Detailed branching information, including names for release branches, can
110111 be found in [Branches.md](/docs/Branches.md).
111112
112- **Note:**
113- The commands used in the rest of this guide assumes that the absolute path
114- to your working directory is something like `/path/to/swift-project/swift`.
115- Double-check that running `pwd` prints a path ending with `swift`.
113+ > **Note**
114+ > The commands used in the rest of this guide assumes that the absolute path
115+ > to your working directory is something like `/path/to/swift-project/swift`.
116+ > Double-check that running `pwd` prints a path ending with `swift`.
116117
117118[uploaded your SSH keys to GitHub]: https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
118119
@@ -148,7 +149,6 @@ Double-check that running `pwd` prints a path ending with `swift`.
148149[Xcode]: https://developer.apple.com/xcode/resources/
149150[CMake]: https://cmake.org
150151[Ninja]: https://ninja-build.org
151- [Sccache]: https://github.com/mozilla/sccache
152152[Homebrew]: https://brew.sh/
153153[Homebrew Bundle]: https://github.com/Homebrew/homebrew-bundle
154154
@@ -160,33 +160,38 @@ Double-check that running `pwd` prints a path ending with `swift`.
160160 * [CentOS 7](https://github.com/apple/swift-docker/blob/main/swift-ci/master/centos/7/Dockerfile)
161161 * [Amazon Linux 2](https://github.com/apple/swift-docker/blob/main/swift-ci/master/amazon-linux/2/Dockerfile)
162162
163- 2. To install `sccache` (optional):
164- * If you' re not building within a Docker container:
165- ```
166- sudo snap install sccache --candidate --classic
167- ```
168- * If you're building within a Docker container, you'll have to install `sccache` manually, since [`snap`
169- is not available in environments without `systemd`](https://unix.stackexchange.com/questions/541230/do-snaps-require-systemd):
163+ 2. To install [Sccache][] (optional):
164+ * If you' re not building within a Docker container:
165+ ` ` ` sh
166+ sudo snap install sccache --candidate --classic
167+ ` ` `
168+ * If you' re building within a Docker container, you' ll have to install
169+ ` sccache` manually, since [` snap` is not available in environments
170+ without ` systemd` ](https://unix.stackexchange.com/questions/541230/do-snaps-require-systemd):
170171
171- ```
172- SCCACHE_VERSION=v0.3.0
173- curl -L "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/sccache-${SCCACHE_VERSION}-$ (uname -m)-unknown-linux-musl.tar.gz" -o sccache.tar.gz
174- tar xzpvf sccache.tar.gz
175- sudo cp "sccache-${SCCACHE_VERSION}-$(uname -m)-unknown-linux-musl/sccache" /usr/local/bin
176- sudo chmod +x /usr/local/bin/sccache
177- ```
172+ ` ` ` sh
173+ SCCACHE_VERSION=v0.3.0
174+ curl -L " https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION} /sccache-${SCCACHE_VERSION} -$( uname -m) -unknown-linux-musl.tar.gz" -o sccache.tar.gz
175+ tar xzpvf sccache.tar.gz
176+ sudo cp " sccache-${SCCACHE_VERSION} -$( uname -m) -unknown-linux-musl/sccache" /usr/local/bin
177+ sudo chmod +x /usr/local/bin/sccache
178+ ` ` `
178179
179- **Note:** LLDB currently requires at least `swig-1.3.40` but will
180- successfully build with version 2 shipped with Ubuntu.
180+ > ** Note**
181+ > LLDB currently requires at least ` swig-1.3.40` but will successfully build
182+ > with version 2 shipped with Ubuntu.
183+
184+ [Sccache]: https://github.com/mozilla/sccache
181185
182186# # Building the project for the first time
183187
184188# ## Spot check dependencies
185189
186- * Run `cmake --version`: This should be 3.19.6 or higher.
187- * Run `python3 --version`: Check that this succeeds.
188- * Run `ninja --version`: Check that this succeeds.
189- * Run `sccache --version`: Check that this succeeds.
190+ * Run ` cmake --version` ; this should be 3.19.6 or higher.
191+ * Run ` python3 --version` ; check that this succeeds.
192+ * Run ` ninja --version` ; check that this succeeds.
193+ * If you installed and want to use Sccache: Run ` sccache --version` ; check
194+ that this succeeds.
190195
191196# ## The roles of different tools
192197
@@ -209,6 +214,11 @@ to understand what the different tools do:
209214 (i.e. do a "clean build"), Sccache can accelerate the new build
210215 significantly. There are few things more satisfying than seeing Sccache
211216 cut through build times.
217+
218+ > **Note**
219+ > Sccache defaults to a cache size of 10GB, which is relatively small
220+ > compared to build artifacts. You can bump it up, say, by setting
221+ > `export SCCACHE_CACHE_SIZE="50G"` in your dotfile(s).
2122225. `utils/update-checkout` is a script to help you work with all the individual
213223 git repositories together, instead of manually cloning/updating each one.
2142246. `utils/build-script` (we will introduce this shortly)
@@ -225,15 +235,7 @@ Phew, that's a lot to digest! Now let's proceed to the actual build itself!
225235
226236### The actual build
227237
228- 1. Make sure you have Sccache running.
229- ```sh
230- sccache --start-server
231- ```
232- (Optional) Sccache defaults to a cache size of 10GB, which is relatively
233- small compared to build artifacts. You can bump it up, say by setting
234- ` export SCCACHE_CACHE_SIZE="50G" ` in your dotfile(s). For more details,
235- see the [ Sccache README] [ Sccache ] .
236- 2 . Build the toolchain with optimizations, debuginfo, and assertions, using
238+ 1. Build the toolchain with optimizations, debuginfo, and assertions, using
237239 Ninja.
238240 - macOS:
239241 ```sh
@@ -250,6 +252,8 @@ Phew, that's a lot to digest! Now let's proceed to the actual build itself!
250252 utils/build-script --release-debuginfo --skip-early-swift-driver \
251253 --skip-early-swiftsyntax
252254 ```
255+ If you installed and want to use Sccache, include the `--sccache` option in
256+ the invocation as well.
253257
254258 > **Note**
255259 > If you aren' t planning to edit the parts of the compiler that are written
@@ -259,7 +263,7 @@ Phew, that's a lot to digest! Now let's proceed to the actual build itself!
259263 containing the Swift compiler and standard library and clang/LLVM build artifacts.
260264 If the build fails, see [Troubleshooting build issues](# troubleshooting-build-issues).
261265
262- > **Note:**
266+ > ** Note**
263267 > ` --release-debuginfo` means that although debug information will be produced, all targets will
264268 > be compiled in release mode, meaning optimized code, which can affect your debugging experience.
265269 > Consider [` --debug-swift` to build a debug variant of the compiler](# debugging-issues) and have
0 commit comments