File tree Expand file tree Collapse file tree 5 files changed +22
-18
lines changed Expand file tree Collapse file tree 5 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,26 @@ 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/toolchains/llvm/prebuilt/linux-x86_64/bin/${BINARY} "
104+ }
105+
92106write_sccache_stub cc
93107write_sccache_stub c++
94108write_sccache_stub gcc
95109write_sccache_stub g++
96110write_sccache_stub clang
97111write_sccache_stub clang++
112+ write_android_sccache_stub clang
113+ write_android_sccache_stub clang++
98114init_sccache
Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ 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+
5763# Install sccache before building torch
5864COPY ./common/install_cache.sh install_cache.sh
5965ENV PATH /opt/cache/bin:$PATH
@@ -76,12 +82,6 @@ COPY ./requirements-lintrunner.txt requirements-lintrunner.txt
7682RUN if [ -n "${LINTRUNNER}" ]; then bash ./install_linter.sh; fi
7783RUN rm install_linter.sh utils.sh requirements-lintrunner.txt
7884
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-
2925 # The generic Linux job chooses to use base env, not the one setup by the image
3026 CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
3127 conda activate "${CONDA_ENV}"
Original file line number Diff line number Diff line change @@ -353,10 +353,6 @@ 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-
360356 # The generic Linux job chooses to use base env, not the one setup by the image
361357 CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
362358 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-
6662 # The generic Linux job chooses to use base env, not the one setup by the image
6763 CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
6864 conda activate "${CONDA_ENV}"
You can’t perform that action at this time.
0 commit comments