Skip to content

Commit 06727c3

Browse files
committed
Set in yml
1 parent b14d160 commit 06727c3

File tree

5 files changed

+18
-24
lines changed

5 files changed

+18
-24
lines changed

.ci/docker/common/install_cache.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,28 +89,10 @@ init_sccache() {
8989
as_ci_user sccache --zero-stats || true
9090
}
9191

92-
function write_android_sccache_stub() {
93-
BINARY=$1
94-
mv "/opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$1" "/opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/.$1"
95-
cat >"/opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$1" <<EOF
96-
#!/bin/sh
97-
if [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then
98-
exec sccache /opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/.$1 "\$@"
99-
else
100-
exec /opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/.$1 "\$@"
101-
fi
102-
EOF
103-
chmod a+x "/opt/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${BINARY}"
104-
}
105-
10692
write_sccache_stub cc
10793
write_sccache_stub c++
10894
write_sccache_stub gcc
10995
write_sccache_stub g++
11096
write_sccache_stub clang
11197
write_sccache_stub clang++
112-
if [ -n "${ANDROID_NDK_VERSION}" ]; then
113-
write_android_sccache_stub clang
114-
write_android_sccache_stub clang++
115-
fi
11698
init_sccache

.ci/docker/ubuntu/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ COPY ./common/install_conda.sh install_conda.sh
5454
COPY ./common/utils.sh utils.sh
5555
RUN bash ./install_conda.sh && rm install_conda.sh utils.sh /opt/conda/requirements-ci.txt /opt/conda/conda-env-ci.txt
5656

57-
ARG ANDROID_NDK_VERSION
58-
# Install Android NDK if needed
59-
COPY ./common/install_android.sh install_android.sh
60-
RUN if [ -n "${ANDROID_NDK_VERSION}" ]; then bash ./install_android.sh; fi
61-
RUN rm install_android.sh
62-
6357
# Install sccache before building torch
6458
COPY ./common/install_cache.sh install_cache.sh
6559
ENV PATH /opt/cache/bin:$PATH
@@ -82,6 +76,12 @@ COPY ./requirements-lintrunner.txt requirements-lintrunner.txt
8276
RUN if [ -n "${LINTRUNNER}" ]; then bash ./install_linter.sh; fi
8377
RUN rm install_linter.sh utils.sh requirements-lintrunner.txt
8478

79+
ARG ANDROID_NDK_VERSION
80+
# Install lintrunner if needed
81+
COPY ./common/install_android.sh install_android.sh
82+
RUN if [ -n "${ANDROID_NDK_VERSION}" ]; then bash ./install_android.sh; fi
83+
RUN rm install_android.sh
84+
8585
ARG ARM_SDK
8686

8787
ARG QNN_SDK

.github/workflows/_android.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
script: |
2323
set -eux
2424
25+
# Use sccache for NDK compiler as well
26+
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
27+
export CMAKE_C_COMPILER_LAUNCHER=sccache
28+
2529
# The generic Linux job chooses to use base env, not the one setup by the image
2630
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
2731
conda activate "${CONDA_ENV}"

.github/workflows/android-perf.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ jobs:
353353
script: |
354354
set -eux
355355
356+
# Use sccache for NDK compiler as well
357+
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
358+
export CMAKE_C_COMPILER_LAUNCHER=sccache
359+
356360
# The generic Linux job chooses to use base env, not the one setup by the image
357361
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
358362
conda activate "${CONDA_ENV}"

.github/workflows/android-release-artifacts.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
script: |
6060
set -eux
6161
62+
# Use sccache for NDK compiler as well
63+
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
64+
export CMAKE_C_COMPILER_LAUNCHER=sccache
65+
6266
# The generic Linux job chooses to use base env, not the one setup by the image
6367
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
6468
conda activate "${CONDA_ENV}"

0 commit comments

Comments
 (0)