diff --git a/.github/workflows/build-new.yml b/.github/workflows/build-new.yml index 9ce278c..2440a19 100644 --- a/.github/workflows/build-new.yml +++ b/.github/workflows/build-new.yml @@ -103,6 +103,7 @@ jobs: CONTAINER_COMPILER_CACHE_DIR="/compiler-cache" CIBW_CONTAINER_ENGINE="docker; create_args: -v ${COMPILER_CACHE_DIR}:${CONTAINER_COMPILER_CACHE_DIR}" echo "CIBW_CONTAINER_ENGINE=${CIBW_CONTAINER_ENGINE}" >> "$GITHUB_ENV" + echo "COMPILER_CACHE_DIR=${CONTAINER_COMPILER_CACHE_DIR}" >> "$GITHUB_ENV" echo "CCACHE_DIR=${CONTAINER_COMPILER_CACHE_DIR}/ccache" >> "$GITHUB_ENV" echo "CCACHE_BASEDIR=/project" >> "$GITHUB_ENV" @@ -111,7 +112,7 @@ jobs: VCPKG_BINARY_SOURCES="clear;files,${VCPKG_CACHE_DIR},readwrite" echo "VCPKG_BINARY_SOURCES=${VCPKG_BINARY_SOURCES}" >> "$GITHUB_ENV" - CIBW_ENVIRONMENT_PASS_LINUX="VCPKG_TARGET_TRIPLET VCPKG_INSTALLATION_ROOT CMAKE_TOOLCHAIN_FILE VCPKG_BINARY_SOURCES CCACHE_DIR CCACHE_BASEDIR" + CIBW_ENVIRONMENT_PASS_LINUX="VCPKG_TARGET_TRIPLET VCPKG_INSTALLATION_ROOT CMAKE_TOOLCHAIN_FILE VCPKG_BINARY_SOURCES COMPILER_CACHE_DIR CCACHE_DIR CCACHE_BASEDIR" echo "CIBW_ENVIRONMENT_PASS_LINUX=${CIBW_ENVIRONMENT_PASS_LINUX}" >> "$GITHUB_ENV" - name: Build wheels uses: pypa/cibuildwheel@v2.16.2 diff --git a/package/install-colmap-centos.sh b/package/install-colmap-centos.sh index 3177f40..deb4f11 100755 --- a/package/install-colmap-centos.sh +++ b/package/install-colmap-centos.sh @@ -5,10 +5,16 @@ CURRDIR=$(pwd) yum install -y gcc gcc-c++ ninja-build curl zip unzip tar -FILE="ccache-4.9-linux-x86_64" -curl -sSLO https://github.com/ccache/ccache/releases/download/v4.9/${FILE}.tar.xz -tar -xf ${FILE}.tar.xz -export PATH="$(pwd)/${FILE}:${PATH}" +# ccache shipped by CentOS is too old so we download and cache it. +COMPILER_TOOLS_DIR="${COMPILER_CACHE_DIR}/bin" +mkdir -p ${COMPILER_TOOLS_DIR} +if [ ! -f "${COMPILER_TOOLS_DIR}/ccache" ]; then + FILE="ccache-4.9-linux-x86_64" + curl -sSLO https://github.com/ccache/ccache/releases/download/v4.9/${FILE}.tar.xz + tar -xf ${FILE}.tar.xz + cp ${FILE}/ccache ${COMPILER_TOOLS_DIR} +fi +export PATH="${COMPILER_TOOLS_DIR}:${PATH}" ccache --version ccache --help