@@ -84,9 +84,10 @@ toolchain as a one-off, there are a couple of differences:
84
84
cd swift
85
85
utils/update-checkout --clone
86
86
` ` `
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.
90
91
<!-- Recommending against cloning the fork due to https://github.com/apple/swift/issues/55918 and https://github.com/apple/swift/issues/55947. -->
91
92
3. Double-check that `swift`' s sibling directories are present.
92
93
` ` ` sh
@@ -109,10 +110,10 @@ toolchain as a one-off, there are a couple of differences:
109
110
Detailed branching information, including names for release branches, can
110
111
be found in [Branches.md](/docs/Branches.md).
111
112
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`.
116
117
117
118
[uploaded your SSH keys to GitHub]: https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
118
119
@@ -148,7 +149,6 @@ Double-check that running `pwd` prints a path ending with `swift`.
148
149
[Xcode]: https://developer.apple.com/xcode/resources/
149
150
[CMake]: https://cmake.org
150
151
[Ninja]: https://ninja-build.org
151
- [Sccache]: https://github.com/mozilla/sccache
152
152
[Homebrew]: https://brew.sh/
153
153
[Homebrew Bundle]: https://github.com/Homebrew/homebrew-bundle
154
154
@@ -160,33 +160,38 @@ Double-check that running `pwd` prints a path ending with `swift`.
160
160
* [CentOS 7](https://github.com/apple/swift-docker/blob/main/swift-ci/master/centos/7/Dockerfile)
161
161
* [Amazon Linux 2](https://github.com/apple/swift-docker/blob/main/swift-ci/master/amazon-linux/2/Dockerfile)
162
162
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):
170
171
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
+ ` ` `
178
179
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
181
185
182
186
# # Building the project for the first time
183
187
184
188
# ## Spot check dependencies
185
189
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.
190
195
191
196
# ## The roles of different tools
192
197
@@ -209,6 +214,11 @@ to understand what the different tools do:
209
214
(i.e. do a "clean build"), Sccache can accelerate the new build
210
215
significantly. There are few things more satisfying than seeing Sccache
211
216
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).
212
222
5. `utils/update-checkout` is a script to help you work with all the individual
213
223
git repositories together, instead of manually cloning/updating each one.
214
224
6. `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!
225
235
226
236
### The actual build
227
237
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
237
239
Ninja.
238
240
- macOS:
239
241
```sh
@@ -250,6 +252,8 @@ Phew, that's a lot to digest! Now let's proceed to the actual build itself!
250
252
utils/build-script --release-debuginfo --skip-early-swift-driver \
251
253
--skip-early-swiftsyntax
252
254
```
255
+ If you installed and want to use Sccache, include the `--sccache` option in
256
+ the invocation as well.
253
257
254
258
> **Note**
255
259
> 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!
259
263
containing the Swift compiler and standard library and clang/LLVM build artifacts.
260
264
If the build fails, see [Troubleshooting build issues](# troubleshooting-build-issues).
261
265
262
- > **Note:**
266
+ > ** Note**
263
267
> ` --release-debuginfo` means that although debug information will be produced, all targets will
264
268
> be compiled in release mode, meaning optimized code, which can affect your debugging experience.
265
269
> Consider [` --debug-swift` to build a debug variant of the compiler](# debugging-issues) and have
0 commit comments