Files
ocp/scripts/_env.sh
T
stroblme bd7bfbf1fd Move to nanobind 3.1 and release 8.0.1.3
The handle caster follows nanobind 3's renamed detail API (keep_alive_cb,
NB_CALL(nb_type_put), uint32_t caster flags). Bound surface unchanged per
sigdiff; list iteration ~4x faster.
2026-10-29 17:10:24 +01:00

34 lines
1.4 KiB
Bash
Executable File

# Shared environment for the in-container scripts. Sourced, not executed.
#
# Everything expensive or bulky (ccache, the CMake tree, pip's cache, the build
# venv) lives under $CACHE, which the Makefile bind-mounts from outside the
# repo — the root filesystem on this host has little headroom, and these
# survive between runs to keep the inner loop incremental.
CACHE="${CACHE_ROOT:-/cache}"
export CCACHE_DIR="$CACHE/ccache"
export PIP_CACHE_DIR="$CACHE/pip"
export HOME="$CACHE" # containers run as the host uid; /root is not ours
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export CMAKE_PREFIX_PATH=/opt/occt
export LD_LIBRARY_PATH=/opt/occt/lib
export SKBUILD_BUILD_DIR="$CACHE/skbuild/{wheel_tag}"
mkdir -p "$CCACHE_DIR" "$PIP_CACHE_DIR"
VENV="$CACHE/venv"
if [ ! -x "$VENV/bin/python" ]; then
echo "--- creating build venv at $VENV ---"
/opt/python/cp312-cp312/bin/python -m venv "$VENV"
"$VENV/bin/pip" install -q --upgrade pip
# numpy is a test dependency only: the n3xd_ocp bulk APIs hand back
# ndarrays, so their tests need it to check the results.
# occt_handle.h builds on nanobind's detail API, which moves between
# majors, so the next one is a deliberate bump, not something a fresh
# cache picks up.
"$VENV/bin/pip" install -q build "nanobind>=3.1,<4" scikit-build-core pytest numpy
fi
PY="$VENV/bin/python"
export PY VENV CACHE