Skip to content

Commit

Permalink
CI Actually use ccache in CircleCI (#30350)
Browse files Browse the repository at this point in the history
  • Loading branch information
lesteve authored and jeremiedbb committed Dec 6, 2024
1 parent 6f1137e commit 8df2a0e
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions build_tools/circle/build_doc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -e
set -x

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

export PATH="/usr/lib/ccache:$PATH"
ccache -M 512M
export CCACHE_COMPRESS=1

create_conda_environment_from_lock_file $CONDA_ENV_NAME $LOCK_FILE
conda activate $CONDA_ENV_NAME

# Sets up ccache when using system compiler
export PATH="/usr/lib/ccache:$PATH"
# Sets up ccache when using conda-forge compilers (needs to be after conda
# activate which sets CC and CXX)
export CC="ccache $CC"
export CXX="ccache $CXX"
ccache -M 512M
export CCACHE_COMPRESS=1
# Zeroing statistics so that ccache statistics are shown only for this build
ccache -z

show_installed_libraries

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

echo "ccache build summary:"
ccache -s
Expand Down

0 comments on commit 8df2a0e

Please sign in to comment.