Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8df2a0e

Browse files
lestevejeremiedbb
authored andcommitted
CI Actually use ccache in CircleCI (#30350)
1 parent 6f1137e commit 8df2a0e

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

build_tools/circle/build_doc.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22
set -e
3+
set -x
34

45
# Decide what kind of documentation build to run, and run it.
56
#
@@ -174,16 +175,27 @@ bash ./miniconda.sh -b -p $MINIFORGE_PATH
174175
source $MINIFORGE_PATH/etc/profile.d/conda.sh
175176
conda activate
176177

177-
export PATH="/usr/lib/ccache:$PATH"
178-
ccache -M 512M
179-
export CCACHE_COMPRESS=1
180178

181179
create_conda_environment_from_lock_file $CONDA_ENV_NAME $LOCK_FILE
182180
conda activate $CONDA_ENV_NAME
183181

182+
# Sets up ccache when using system compiler
183+
export PATH="/usr/lib/ccache:$PATH"
184+
# Sets up ccache when using conda-forge compilers (needs to be after conda
185+
# activate which sets CC and CXX)
186+
export CC="ccache $CC"
187+
export CXX="ccache $CXX"
188+
ccache -M 512M
189+
export CCACHE_COMPRESS=1
190+
# Zeroing statistics so that ccache statistics are shown only for this build
191+
ccache -z
192+
184193
show_installed_libraries
185194

186-
pip install -e . --no-build-isolation --config-settings=compile-args="-j4"
195+
# Specify explictly ninja -j argument because ninja does not handle cgroups v2 and
196+
# use the same default rule as ninja (-j3 since we have 2 cores on CircleCI), see
197+
# https://github.com/scikit-learn/scikit-learn/pull/30333
198+
pip install -e . --no-build-isolation --config-settings=compile-args="-j 3"
187199

188200
echo "ccache build summary:"
189201
ccache -s

0 commit comments

Comments
 (0)