Skip to content

Commit

Permalink
WIP: Create separate cleanup function
Browse files Browse the repository at this point in the history
Created a separate cleanup function in `cibuildwheel/before_build.sh` to make it more visible what's happening.
  • Loading branch information
gmloose committed Mar 11, 2024
1 parent 029ae24 commit 3d67740
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cibuildwheel/before_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
# `${BOOST_BUILD_DIR}/boost`. The libraries will be installed in the directory
# `${BOOST_INSTALL_DIR}`. Both environment variables must have been set.

# Ensure we start with a clean slate
function cleanup
{
rm -rf "${BOOST_BUILD_DIR}/boost/bin.v2"
rm -rf "${BOOST_INSTALL_DIR}"
}

# Install oldest supported numpy
function install_numpy
{
Expand All @@ -20,7 +27,6 @@ function build_boost_python
nproc=$(python -c 'import multiprocessing as mp; print(mp.cpu_count())')
inc_dir=$(python -c 'import sysconfig as sc; print(sc.get_path("include"))')
cd "${BOOST_BUILD_DIR}/boost"
rm -rf "${BOOST_INSTALL_DIR}"
./bootstrap.sh --prefix="${BOOST_INSTALL_DIR}" \
--with-libraries=python \
--with-toolset=gcc
Expand All @@ -31,5 +37,6 @@ function build_boost_python
}

set -o pipefail
cleanup
install_numpy
build_boost_python

0 comments on commit 3d67740

Please sign in to comment.