From dbffd50a4edbc6664394317dc09daa1dc1c8d2f6 Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Mon, 24 Aug 2026 10:24:13 -0700 Subject: [PATCH 1/7] ci: persist ccache across builds --- .github/workflows/ci.yml | 1 + .gitignore | 1 + build.sh | 2 ++ 3 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2be33cf..a479c57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,7 @@ jobs: restore-keys: build-cache-v2-${{ matrix.platform }}- path: | .uv-cache + .ccache */*/install */*/toolchain */*/bin diff --git a/.gitignore b/.gitignore index 6d0cd60..0b980f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .git/ repo/ .venv/ +.ccache/ __pycache__/ uv.lock diff --git a/build.sh b/build.sh index fe03a50..a0c2f8f 100755 --- a/build.sh +++ b/build.sh @@ -24,6 +24,7 @@ if [[ "$USE_MANYLINUX" == "1" && -z "${BUILD_SH_IN_MANYLINUX:-}" ]]; then -e BUILD_SH_HOST_GID="$(id -g)" \ -e HOME=/tmp \ -e UV_CACHE_DIR=/work/.uv-cache \ + -e CCACHE_DIR=/work/.ccache \ -e UV_PYTHON=/opt/python/cp312-cp312/bin/python3 \ -v "$ROOT_DIR:/work" \ -v "$UV_BIN:/usr/local/bin/uv:ro" \ @@ -61,6 +62,7 @@ fi export CMAKE_C_COMPILER_LAUNCHER=ccache export CMAKE_CXX_COMPILER_LAUNCHER=ccache +export CCACHE_DIR="${CCACHE_DIR:-$ROOT_DIR/.ccache}" restore_build_versions() { python3 build_versions.py restore */pyproject.toml From 51f71502b21f3b92b587df6ee1013ea6afb26b0c Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Mon, 24 Aug 2026 10:37:00 -0700 Subject: [PATCH 2/7] ci: cache check From 7ff00ee8b7dd0492ebfed8cc17055563cd77c390 Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Mon, 24 Aug 2026 10:43:27 -0700 Subject: [PATCH 3/7] ffmpeg, cppcheck: export the ccache compiler so x264/zlib/meson/make see it --- cppcheck/build.sh | 2 +- ffmpeg/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cppcheck/build.sh b/cppcheck/build.sh index 329f476..4fbee9c 100755 --- a/cppcheck/build.sh +++ b/cppcheck/build.sh @@ -8,7 +8,7 @@ VERSION="2.21.0" INSTALL_DIR="$DIR/cppcheck/install" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" -CXX="ccache ${CXX:-c++}" +export CXX="ccache ${CXX:-c++}" # Clone/update source if [ ! -d "cppcheck-src/.git" ]; then diff --git a/ffmpeg/build.sh b/ffmpeg/build.sh index 7c3f9c2..30c76cd 100755 --- a/ffmpeg/build.sh +++ b/ffmpeg/build.sh @@ -13,7 +13,7 @@ LIBVA_VERSION="2.22.0" INSTALL_DIR="$DIR/ffmpeg/install" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" -CC="ccache ${CC:-cc}" +export CC="ccache ${CC:-cc}" PREFIX="$DIR/build/prefix" mkdir -p "$DIR/build" rm -rf "$PREFIX" From 755109e43e1db5260c4690890eeeb343823bb051 Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Mon, 24 Aug 2026 10:57:37 -0700 Subject: [PATCH 4/7] ci: cache check 2 From 6e81af5722c614e220451c824a5a2a68392eb180 Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Mon, 24 Aug 2026 11:58:55 -0700 Subject: [PATCH 5/7] ci: cache check 3 From 6048b525d064aa4977b99db5d5659e21cb211608 Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Mon, 24 Aug 2026 12:14:58 -0700 Subject: [PATCH 6/7] ci: cache ccache per run instead of build trees --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a479c57..70a483d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,16 +36,16 @@ jobs: fi - uses: actions/cache@v6 with: - key: build-cache-v2-${{ matrix.platform }}-${{ hashFiles('build.sh', 'setup.sh', '*/pyproject.toml', '*/setup.py', '*/build.sh') }} - restore-keys: build-cache-v2-${{ matrix.platform }}- + key: ccache-${{ matrix.platform }}-${{ github.run_id }} + restore-keys: ccache-${{ matrix.platform }}- + path: .ccache + - uses: actions/cache@v6 + with: + key: downloads-${{ matrix.platform }}-${{ hashFiles('gcc-arm-none-eabi/build.sh', 'git-lfs/build.sh') }} path: | .uv-cache - .ccache - */*/install */*/toolchain */*/bin - */*-src - */build - name: Build wheels env: MANYLINUX: ${{ runner.os == 'Linux' && '1' || '0' }} From 3869c983816d9bcc1ab4cb45d48d138ce1ef1fa0 Mon Sep 17 00:00:00 2001 From: Trey Moen Date: Mon, 24 Aug 2026 12:27:32 -0700 Subject: [PATCH 7/7] ci: cache check 4