File tree 5 files changed +18
-24
lines changed 5 files changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -89,28 +89,10 @@ init_sccache() {
89
89
as_ci_user sccache --zero-stats || true
90
90
}
91
91
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
-
106
92
write_sccache_stub cc
107
93
write_sccache_stub c++
108
94
write_sccache_stub gcc
109
95
write_sccache_stub g++
110
96
write_sccache_stub clang
111
97
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
116
98
init_sccache
Original file line number Diff line number Diff line change @@ -54,12 +54,6 @@ COPY ./common/install_conda.sh install_conda.sh
54
54
COPY ./common/utils.sh utils.sh
55
55
RUN bash ./install_conda.sh && rm install_conda.sh utils.sh /opt/conda/requirements-ci.txt /opt/conda/conda-env-ci.txt
56
56
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
-
63
57
# Install sccache before building torch
64
58
COPY ./common/install_cache.sh install_cache.sh
65
59
ENV PATH /opt/cache/bin:$PATH
@@ -82,6 +76,12 @@ COPY ./requirements-lintrunner.txt requirements-lintrunner.txt
82
76
RUN if [ -n "${LINTRUNNER}" ]; then bash ./install_linter.sh; fi
83
77
RUN rm install_linter.sh utils.sh requirements-lintrunner.txt
84
78
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
+
85
85
ARG ARM_SDK
86
86
87
87
ARG QNN_SDK
Original file line number Diff line number Diff line change 22
22
script : |
23
23
set -eux
24
24
25
+ # Use sccache for NDK compiler as well
26
+ export CMAKE_CXX_COMPILER_LAUNCHER=sccache
27
+ export CMAKE_C_COMPILER_LAUNCHER=sccache
28
+
25
29
# The generic Linux job chooses to use base env, not the one setup by the image
26
30
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
27
31
conda activate "${CONDA_ENV}"
Original file line number Diff line number Diff line change @@ -353,6 +353,10 @@ jobs:
353
353
script : |
354
354
set -eux
355
355
356
+ # Use sccache for NDK compiler as well
357
+ export CMAKE_CXX_COMPILER_LAUNCHER=sccache
358
+ export CMAKE_C_COMPILER_LAUNCHER=sccache
359
+
356
360
# The generic Linux job chooses to use base env, not the one setup by the image
357
361
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
358
362
conda activate "${CONDA_ENV}"
Original file line number Diff line number Diff line change 59
59
script : |
60
60
set -eux
61
61
62
+ # Use sccache for NDK compiler as well
63
+ export CMAKE_CXX_COMPILER_LAUNCHER=sccache
64
+ export CMAKE_C_COMPILER_LAUNCHER=sccache
65
+
62
66
# The generic Linux job chooses to use base env, not the one setup by the image
63
67
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
64
68
conda activate "${CONDA_ENV}"
You can’t perform that action at this time.
0 commit comments