Skip to content

Commit 04d077d

Browse files
authored
docs: clarify sccache installation in Docker containers (#61446)
1 parent 64b19f7 commit 04d077d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/HowToGuides/GettingStarted.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,22 @@ Double-check that running `pwd` prints a path ending with `swift`.
158158
* [CentOS 7](https://github.com/apple/swift-docker/blob/main/swift-ci/master/centos/7/Dockerfile)
159159
* [Amazon Linux 2](https://github.com/apple/swift-docker/blob/main/swift-ci/master/amazon-linux/2/Dockerfile)
160160
161-
2. To install sccache (optional):
161+
2. To install `sccache` (optional):
162+
* If you're not building within a Docker container:
162163
```
163164
sudo snap install sccache --candidate --classic
164165
```
166+
* If you're building within a Docker container, you'll have to install `sccache` manually, since [`snap`
167+
is not available in environments without `systemd`](https://unix.stackexchange.com/questions/541230/do-snaps-require-systemd):
168+
169+
```
170+
SCCACHE_VERSION=v0.3.0
171+
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
172+
tar xzpvf sccache.tar.gz
173+
sudo cp "sccache-${SCCACHE_VERSION}-$(uname -m)-unknown-linux-musl/sccache" /usr/local/bin
174+
sudo chmod +x /usr/local/bin/sccache
175+
```
176+
165177
**Note:** LLDB currently requires at least `swig-1.3.40` but will
166178
successfully build with version 2 shipped with Ubuntu.
167179

0 commit comments

Comments
 (0)