File tree Expand file tree Collapse file tree 5 files changed +18
-24
lines changed Expand file tree Collapse file tree 5 files changed +18
-24
lines changed Original file line number Diff line number Diff 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-
10692write_sccache_stub cc
10793write_sccache_stub c++
10894write_sccache_stub gcc
10995write_sccache_stub g++
11096write_sccache_stub clang
11197write_sccache_stub clang++
112- if [ -n " ${ANDROID_NDK_VERSION} " ]; then
113- write_android_sccache_stub clang
114- write_android_sccache_stub clang++
115- fi
11698init_sccache
Original file line number Diff line number Diff line change @@ -54,12 +54,6 @@ COPY ./common/install_conda.sh install_conda.sh
5454COPY ./common/utils.sh utils.sh
5555RUN 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
6458COPY ./common/install_cache.sh install_cache.sh
6559ENV PATH /opt/cache/bin:$PATH
@@ -82,6 +76,12 @@ COPY ./requirements-lintrunner.txt requirements-lintrunner.txt
8276RUN if [ -n "${LINTRUNNER}" ]; then bash ./install_linter.sh; fi
8377RUN 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+
8585ARG ARM_SDK
8686
8787ARG QNN_SDK
Original file line number Diff line number Diff line change 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}"
Original file line number Diff line number Diff 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}"
Original file line number Diff line number Diff line change 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}"
You can’t perform that action at this time.
0 commit comments