Skip to content

Commit 623baeb

Browse files
committed
Revert "update sccache to latest version (#6837)"
This reverts commit 7278519. Nightly macos wheel builds are failing to link; seeing if this fixes it after inspecting commits between last good build (https://github.com/pytorch/executorch/actions/runs/11891594679) and first bad build (https://github.com/pytorch/executorch/actions/runs/11912200383)
1 parent 0070680 commit 623baeb

File tree

3 files changed

+7
-49
lines changed

3 files changed

+7
-49
lines changed

.ci/docker/common/install_cache.sh

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,6 @@ set -ex
1212
# shellcheck source=/dev/null
1313
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1414

15-
install_ubuntu() {
16-
echo "Preparing to build sccache from source"
17-
apt-get update
18-
# libssl-dev will not work as it is upgraded to libssl3 in Ubuntu-22.04.
19-
# Instead use lib and headers from OpenSSL1.1 installed in `install_openssl.sh``
20-
apt-get install -y cargo
21-
echo "Checking out sccache repo"
22-
git clone https://github.com/mozilla/sccache -b v0.8.2
23-
24-
cd sccache
25-
echo "Building sccache"
26-
cargo build --release
27-
cp target/release/sccache /opt/cache/bin
28-
echo "Cleaning up"
29-
cd ..
30-
rm -rf sccache
31-
apt-get remove -y cargo rustc
32-
apt-get autoclean && apt-get clean
33-
}
34-
3515
install_binary() {
3616
echo "Downloading sccache binary from S3 repo"
3717
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache
@@ -42,33 +22,15 @@ mkdir -p /opt/cache/bin
4222
sed -e 's|PATH="\(.*\)"|PATH="/opt/cache/bin:\1"|g' -i /etc/environment
4323
export PATH="/opt/cache/bin:$PATH"
4424

45-
install_ubuntu
25+
# NB: Install the pre-built binary from S3 as building from source
26+
# https://github.com/pytorch/sccache has started failing mysteriously
27+
# in which sccache server couldn't start with the following error:
28+
# sccache: error: Invalid argument (os error 22)
29+
install_binary
4630

4731
function write_sccache_stub() {
4832
BINARY=$1
49-
if [ $1 == "gcc" ]; then
50-
# Do not call sccache recursively when dumping preprocessor argument
51-
# For some reason it's very important for the first cached nvcc invocation
52-
cat >"/opt/cache/bin/$1" <<EOF
53-
#!/bin/sh
54-
if [ "\$1" = "-E" ] || [ "\$2" = "-E" ]; then
55-
exec $(which $1) "\$@"
56-
elif [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then
57-
exec sccache $(which $1) "\$@"
58-
else
59-
exec $(which $1) "\$@"
60-
fi
61-
EOF
62-
else
63-
cat >"/opt/cache/bin/$1" <<EOF
64-
#!/bin/sh
65-
if [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then
66-
exec sccache $(which $1) "\$@"
67-
else
68-
exec $(which $1) "\$@"
69-
fi
70-
EOF
71-
fi
33+
printf "#!/bin/sh\nif [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then\n exec sccache %s \"\$@\"\nelse\n exec %s \"\$@\"\nfi" "$(which "${BINARY}")" "$(which "${BINARY}")" > "/opt/cache/bin/${BINARY}"
7234
chmod a+x "/opt/cache/bin/${BINARY}"
7335
}
7436

@@ -82,7 +44,7 @@ init_sccache() {
8244

8345
# NB: This function is adopted from PyTorch core at
8446
# https://github.com/pytorch/pytorch/blob/main/.ci/pytorch/common-build.sh
85-
as_ci_user sccache --stop-server >/dev/null 2>&1 || true
47+
as_ci_user sccache --stop-server > /dev/null 2>&1 || true
8648
rm -f "${SCCACHE_ERROR_LOG}" || true
8749

8850
# Clear sccache stats before using it

.ci/docker/ubuntu/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ COPY ./common/utils.sh utils.sh
5757
RUN bash ./install_cache.sh && rm install_cache.sh utils.sh
5858
ENV SCCACHE_BUCKET ossci-compiler-cache-circleci-v2
5959
ENV SCCACHE_S3_KEY_PREFIX executorch
60-
ENV SCCACHE_REGION us-east-1
6160

6261
ARG TORCH_VERSION
6362
COPY ./common/install_pytorch.sh install_pytorch.sh

.github/workflows/docker-builds.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ concurrency:
2626
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
2727
cancel-in-progress: true
2828

29-
env:
30-
AWS_DEFAULT_REGION: us-east-1
31-
3229
jobs:
3330
docker-build:
3431
runs-on: [self-hosted, linux.2xlarge]

0 commit comments

Comments
 (0)