Skip to content

Commit 0af2c72

Browse files
authored
Remove remnants of sccache (#629)
Before commit 71882f2 (May 2022), we built LLVM from source. This employed sccache to make builds faster. After that commit, sccache hasn't effectively been used. But there were remnants of sccache in the code base. This commit removes all references to sccache in the repo.
1 parent c77b231 commit 0af2c72

File tree

6 files changed

+1
-119
lines changed

6 files changed

+1
-119
lines changed

cpython-unix/build-binutils.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,12 @@
55

66
set -ex
77

8-
ROOT=$(pwd)
9-
SCCACHE="${ROOT}/sccache"
10-
118
cd /build
129

1310
tar -xf binutils-${BINUTILS_VERSION}.tar.xz
1411
mkdir binutils-objdir
1512
pushd binutils-objdir
1613

17-
EXTRA_VARS=
18-
19-
if [ -x "${SCCACHE}" ]; then
20-
"${SCCACHE}" --start-server
21-
export CC="${SCCACHE} /usr/bin/gcc"
22-
export STAGE_CC_WRAPPER="${SCCACHE}"
23-
fi
24-
2514
# gprofng requires a bison newer than what we have. So just disable it.
2615
../binutils-${BINUTILS_VERSION}/configure \
2716
--build=x86_64-unknown-linux-gnu \

cpython-unix/build.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -64,34 +64,6 @@
6464
MACOS_ALLOW_FRAMEWORKS = {"CoreFoundation"}
6565

6666

67-
def install_sccache(build_env):
68-
"""Attempt to install sccache into the build environment.
69-
70-
This will attempt to locate a sccache executable and copy it
71-
into the root directory of the build environment.
72-
"""
73-
candidates = [
74-
# Prefer a binary in the project itself.
75-
ROOT / "sccache",
76-
]
77-
78-
# Look for sccache in $PATH, but only if the build environment
79-
# isn't isolated, as copying binaries into an isolated environment
80-
# may not run. And running sccache in an isolated environment won't
81-
# do anything meaningful unless an external cache is being used.
82-
if not build_env.is_isolated:
83-
for path in os.environ.get("PATH", "").split(":"):
84-
if not path:
85-
continue
86-
87-
candidates.append(pathlib.Path(path) / "sccache")
88-
89-
for candidate in candidates:
90-
if candidate.exists():
91-
build_env.copy_file(candidate)
92-
return
93-
94-
9567
def add_target_env(env, build_platform, target_triple, build_env):
9668
add_env_common(env)
9769

@@ -302,8 +274,6 @@ def build_binutils(client, image, host_platform):
302274
archive = download_entry("binutils", DOWNLOADS_PATH)
303275

304276
with build_environment(client, image) as build_env:
305-
install_sccache(build_env)
306-
307277
build_env.copy_file(archive)
308278
build_env.copy_file(SUPPORT / "build-binutils.sh")
309279

cpython-unix/sccache-wrapper.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/building.rst

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -104,38 +104,3 @@ You will need to specify the path to a ``sh.exe`` installed from cygwin. e.g.
104104

105105
To build a 32-bit x86 binary, simply use an ``x86 Native Tools
106106
Command Prompt`` instead of ``x64``.
107-
108-
Using sccache to Speed up Builds
109-
================================
110-
111-
Builds can take a long time.
112-
113-
python-build-standalone can automatically detect and use the
114-
`sccache <https://github.com/mozilla/sccache>`_ compiler cache to speed
115-
up subsequent builds on UNIX-like platforms. ``sccache`` can shave dozens
116-
of minutes from fresh builds, even on a 16 core CPU!
117-
118-
If there is an executable ``sccache`` in the source directory, it will
119-
automatically be copied into the build environment and used. For non-container
120-
builds, an ``sccache`` executable is also searched for on ``PATH``.
121-
122-
The ``~/.python-build-standalone-env`` file is read if it exists (the format is
123-
``key=value`` pairs) and variables are added to the build environment.
124-
125-
In addition, environment variables ``AWS_ACCESS_KEY_ID``,
126-
``AWS_SECRET_ACCESS_KEY``, and any variable beginning with ``SCCACHE_`` are
127-
automatically added to the build environment.
128-
129-
The environment variable support enables you to define remote build caches
130-
(such as S3 buckets) to provide a persistent, shared cache across builds and
131-
machines.
132-
133-
Keep in mind that when performing builds in containers in Linux (the default
134-
behavior), the local filesystem is local to the container and does not survive
135-
the build of a single package. So sccache is practically meaningless unless
136-
configured to use an external store (such as S3).
137-
138-
When using remote stores (such as S3), ``sccache`` can be constrained on
139-
network I/O. We recommend having at least a 100mbps network connection to
140-
a remote store and employing a network store with as little latency as possible
141-
for best results.

pythonbuild/utils.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -570,17 +570,6 @@ def add_env_common(env):
570570
except FileNotFoundError:
571571
pass
572572

573-
# Proxy sccache settings.
574-
for k, v in os.environ.items():
575-
if k.startswith("SCCACHE_"):
576-
env[k] = v
577-
578-
# Proxy cloud provider credentials variables to enable sccache to
579-
# use stores in those providers.
580-
for k in ("AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"):
581-
if k in os.environ:
582-
env[k] = os.environ[k]
583-
584573

585574
def exec_and_log(args, cwd, env):
586575
p = subprocess.Popen(

src/github.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
209209
for artifact in artifacts {
210210
if matches!(
211211
artifact.name.as_str(),
212-
"pythonbuild" | "sccache" | "toolchain"
212+
"pythonbuild" | "toolchain"
213213
) || artifact.name.contains("install-only")
214214
{
215215
continue;

0 commit comments

Comments
 (0)