From ead913606d4ced950dd2d001ed8c0a8c9c799114 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 17 Dec 2025 02:40:51 +0300 Subject: [PATCH 1/8] feat: integrate ctcache for clang-tidy result caching in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds ctcache to cache clang-tidy analysis results, significantly reducing CI time for subsequent runs. Unchanged files serve results from cache while only modified files get re-analyzed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/build-src.yml | 21 +++++++++++++++++ ci/dash/lint-tidy.sh | 36 ++++++++++++++++++++++++++++- contrib/containers/ci/ci.Dockerfile | 16 +++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-src.yml b/.github/workflows/build-src.yml index 74ee7f2f3de8..c7678079356d 100644 --- a/.github/workflows/build-src.yml +++ b/.github/workflows/build-src.yml @@ -113,6 +113,16 @@ jobs: /cache/ccache key: ccache-${{ hashFiles('contrib/containers/ci/ci.Dockerfile', 'depends/packages/*') }}-${{ inputs.build-target }}-${{ github.sha }} + - name: Restore ctcache cache + if: inputs.build-target == 'linux64_multiprocess' + uses: actions/cache/restore@v4 + with: + path: | + /cache/ctcache + key: ctcache-${{ hashFiles('contrib/containers/ci/ci.Dockerfile', 'depends/packages/*') }}-${{ inputs.build-target }}-${{ github.sha }} + restore-keys: | + ctcache-${{ hashFiles('contrib/containers/ci/ci.Dockerfile', 'depends/packages/*') }}-${{ inputs.build-target }}- + - name: Run linters if: inputs.build-target == 'linux64_multiprocess' run: | @@ -121,6 +131,17 @@ jobs: ./ci/dash/lint-tidy.sh shell: bash + - name: Save ctcache cache + if: | + inputs.build-target == 'linux64_multiprocess' && + github.event_name == 'push' && + github.ref_name == github.event.repository.default_branch + uses: actions/cache/save@v4 + with: + path: | + /cache/ctcache + key: ctcache-${{ hashFiles('contrib/containers/ci/ci.Dockerfile', 'depends/packages/*') }}-${{ inputs.build-target }}-${{ github.sha }} + - name: Run unit tests run: | BUILD_TARGET="${{ inputs.build-target }}" diff --git a/ci/dash/lint-tidy.sh b/ci/dash/lint-tidy.sh index bd78e85ef22b..e805ea22b1ee 100755 --- a/ci/dash/lint-tidy.sh +++ b/ci/dash/lint-tidy.sh @@ -11,13 +11,47 @@ set -eo pipefail # only on nor do they set the requisite build parameters. Make sure you do # that *before* running this script. +# Setup ctcache for clang-tidy result caching +export CTCACHE_DIR="/cache/ctcache" +export CTCACHE_SAVE_OUTPUT=1 +CTCACHE_CLANG_TIDY=$(which clang-tidy) +export CTCACHE_CLANG_TIDY +mkdir -p "${CTCACHE_DIR}" + +# Zero stats before run to get accurate statistics for this run only +python3 /usr/local/bin/src/ctcache/clang_tidy_cache.py --zero-stats 2>&1 || true + cd "${BASE_ROOT_DIR}/build-ci/dashcore-${BUILD_TARGET}/src" -if ! ( run-clang-tidy -quiet "${MAKEJOBS}" | tee tmp.tidy-out.txt ); then + +if ! ( run-clang-tidy -clang-tidy-binary=/usr/local/bin/clang-tidy-cache -quiet "${MAKEJOBS}" | tee tmp.tidy-out.txt ); then grep -C5 "error: " tmp.tidy-out.txt echo "^^^ ⚠️ Failure generated from clang-tidy" false fi +# Show ctcache statistics and manage cache size +echo "=== ctcache statistics ===" +du -sh "${CTCACHE_DIR}" 2>/dev/null || echo "Cache directory not found" +python3 /usr/local/bin/src/ctcache/clang_tidy_cache.py --show-stats 2>&1 || true + +# Limit cache size (ctcache has no built-in size management) +CTCACHE_MAXSIZE_MB=50 +CACHE_SIZE_MB=$(du -sm "${CTCACHE_DIR}" 2>/dev/null | cut -f1) +if [ "${CACHE_SIZE_MB}" -gt "${CTCACHE_MAXSIZE_MB}" ]; then + echo "Cache size ${CACHE_SIZE_MB}MB exceeds limit ${CTCACHE_MAXSIZE_MB}MB, cleaning old entries..." + # Remove files older than 7 days, or if still too large, oldest 20% of files + find "${CTCACHE_DIR}" -type f -mtime +7 -delete 2>/dev/null || true + CACHE_SIZE_MB=$(du -sm "${CTCACHE_DIR}" 2>/dev/null | cut -f1) + if [ "${CACHE_SIZE_MB}" -gt "${CTCACHE_MAXSIZE_MB}" ]; then + FILE_COUNT=$(find "${CTCACHE_DIR}" -type f | wc -l) + REMOVE_COUNT=$((FILE_COUNT / 5)) + find "${CTCACHE_DIR}" -type f -printf '%T+ %p\n' | sort | head -n "${REMOVE_COUNT}" | cut -d' ' -f2- | xargs rm -f 2>/dev/null || true + echo "Removed ${REMOVE_COUNT} oldest cache entries" + fi + echo "Cache size after cleanup: $(du -sh "${CTCACHE_DIR}" 2>/dev/null | cut -f1)" +fi +echo "==========================" + cd "${BASE_ROOT_DIR}/build-ci/dashcore-${BUILD_TARGET}" iwyu_tool.py \ "src/compat" \ diff --git a/contrib/containers/ci/ci.Dockerfile b/contrib/containers/ci/ci.Dockerfile index 4265a0bc83c1..6c8e2ba3919c 100644 --- a/contrib/containers/ci/ci.Dockerfile +++ b/contrib/containers/ci/ci.Dockerfile @@ -65,8 +65,24 @@ RUN set -ex; \ make install -j "$(( $(nproc) - 1 ))"; \ cd /opt && rm -rf /opt/iwyu; +# Install ctcache for clang-tidy result caching +# Pin to specific commit to ensure patch applies correctly +RUN set -ex; \ + CTCACHE_COMMIT="e33c063ca6e52b48bcefbc45d46d8c150ffa81ca"; \ + mkdir -p /usr/local/bin/src/ctcache; \ + curl -fsSL "https://raw.githubusercontent.com/matus-chochlik/ctcache/${CTCACHE_COMMIT}/src/ctcache/clang_tidy_cache.py" \ + -o /usr/local/bin/src/ctcache/clang_tidy_cache.py; \ + curl -fsSL "https://raw.githubusercontent.com/matus-chochlik/ctcache/${CTCACHE_COMMIT}/clang-tidy" \ + -o /usr/local/bin/clang-tidy-cache; \ + sed -i 's/return shlex\.split(command\["arguments"\]\[0\])/return command["arguments"]/' \ + /usr/local/bin/src/ctcache/clang_tidy_cache.py; \ + sed -i "s/digest = f'{i:x}'/digest = f'{i:02x}'/" \ + /usr/local/bin/src/ctcache/clang_tidy_cache.py; \ + chmod +x /usr/local/bin/clang-tidy-cache; + RUN \ mkdir -p /cache/ccache && \ + mkdir /cache/ctcache && \ mkdir /cache/depends && \ mkdir /cache/sdk-sources && \ chown ${USER_ID}:${GROUP_ID} /cache && \ From a1b98b1e0d4813aa3a5c359e3d7c3b750712f514 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 17 Dec 2025 17:01:58 +0300 Subject: [PATCH 2/8] chore: make paths more maintainable --- ci/dash/lint-tidy.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ci/dash/lint-tidy.sh b/ci/dash/lint-tidy.sh index e805ea22b1ee..bc800a96fcee 100755 --- a/ci/dash/lint-tidy.sh +++ b/ci/dash/lint-tidy.sh @@ -18,12 +18,15 @@ CTCACHE_CLANG_TIDY=$(which clang-tidy) export CTCACHE_CLANG_TIDY mkdir -p "${CTCACHE_DIR}" +CLANG_TIDY_CACHE="/usr/local/bin/clang-tidy-cache" +CLANG_TIDY_CACHE_PY="/usr/local/bin/src/ctcache/clang_tidy_cache.py" + # Zero stats before run to get accurate statistics for this run only -python3 /usr/local/bin/src/ctcache/clang_tidy_cache.py --zero-stats 2>&1 || true +python3 "${CLANG_TIDY_CACHE_PY}" --zero-stats 2>&1 || true cd "${BASE_ROOT_DIR}/build-ci/dashcore-${BUILD_TARGET}/src" -if ! ( run-clang-tidy -clang-tidy-binary=/usr/local/bin/clang-tidy-cache -quiet "${MAKEJOBS}" | tee tmp.tidy-out.txt ); then +if ! ( run-clang-tidy -clang-tidy-binary="${CLANG_TIDY_CACHE}" -quiet "${MAKEJOBS}" | tee tmp.tidy-out.txt ); then grep -C5 "error: " tmp.tidy-out.txt echo "^^^ ⚠️ Failure generated from clang-tidy" false @@ -32,7 +35,7 @@ fi # Show ctcache statistics and manage cache size echo "=== ctcache statistics ===" du -sh "${CTCACHE_DIR}" 2>/dev/null || echo "Cache directory not found" -python3 /usr/local/bin/src/ctcache/clang_tidy_cache.py --show-stats 2>&1 || true +python3 "${CLANG_TIDY_CACHE_PY}" --show-stats 2>&1 || true # Limit cache size (ctcache has no built-in size management) CTCACHE_MAXSIZE_MB=50 From 29445629e1b9df2c4c13dc6e286a6944f05a9618 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 17 Dec 2025 17:21:46 +0300 Subject: [PATCH 3/8] feat: verify clang and ctcache are installed correctly --- ci/dash/lint-tidy.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ci/dash/lint-tidy.sh b/ci/dash/lint-tidy.sh index bc800a96fcee..0761f53358bd 100755 --- a/ci/dash/lint-tidy.sh +++ b/ci/dash/lint-tidy.sh @@ -11,6 +11,12 @@ set -eo pipefail # only on nor do they set the requisite build parameters. Make sure you do # that *before* running this script. +# Verify clang-tidy is available +if ! command -v clang-tidy >/dev/null 2>&1; then + echo "Error: clang-tidy not found in PATH" + exit 1 +fi + # Setup ctcache for clang-tidy result caching export CTCACHE_DIR="/cache/ctcache" export CTCACHE_SAVE_OUTPUT=1 @@ -21,6 +27,16 @@ mkdir -p "${CTCACHE_DIR}" CLANG_TIDY_CACHE="/usr/local/bin/clang-tidy-cache" CLANG_TIDY_CACHE_PY="/usr/local/bin/src/ctcache/clang_tidy_cache.py" +# Verify ctcache is installed +if [ ! -x "${CLANG_TIDY_CACHE}" ]; then + echo "Error: ctcache binary not found at ${CLANG_TIDY_CACHE}" + exit 1 +fi +if [ ! -f "${CLANG_TIDY_CACHE_PY}" ]; then + echo "Error: ctcache Python script not found at ${CLANG_TIDY_CACHE_PY}" + exit 1 +fi + # Zero stats before run to get accurate statistics for this run only python3 "${CLANG_TIDY_CACHE_PY}" --zero-stats 2>&1 || true From 64ff6574631941b51fff91ef3b83f9e479db2629 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 17 Dec 2025 17:29:29 +0300 Subject: [PATCH 4/8] fix: improve file removal pipeline robustness --- ci/dash/lint-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dash/lint-tidy.sh b/ci/dash/lint-tidy.sh index 0761f53358bd..a7b598fdcf4d 100755 --- a/ci/dash/lint-tidy.sh +++ b/ci/dash/lint-tidy.sh @@ -64,7 +64,7 @@ if [ "${CACHE_SIZE_MB}" -gt "${CTCACHE_MAXSIZE_MB}" ]; then if [ "${CACHE_SIZE_MB}" -gt "${CTCACHE_MAXSIZE_MB}" ]; then FILE_COUNT=$(find "${CTCACHE_DIR}" -type f | wc -l) REMOVE_COUNT=$((FILE_COUNT / 5)) - find "${CTCACHE_DIR}" -type f -printf '%T+ %p\n' | sort | head -n "${REMOVE_COUNT}" | cut -d' ' -f2- | xargs rm -f 2>/dev/null || true + find "${CTCACHE_DIR}" -type f -printf '%T+ %p\0' | sort -z | head -z -n "${REMOVE_COUNT}" | cut -z -d' ' -f2- | xargs -0 rm -f 2>/dev/null || true echo "Removed ${REMOVE_COUNT} oldest cache entries" fi echo "Cache size after cleanup: $(du -sh "${CTCACHE_DIR}" 2>/dev/null | cut -f1)" From 7ef44b66167ce8d4a0b28eea4a4a051107bc29f4 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 17 Dec 2025 20:00:43 +0300 Subject: [PATCH 5/8] chore: adjust removal count message --- ci/dash/lint-tidy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dash/lint-tidy.sh b/ci/dash/lint-tidy.sh index a7b598fdcf4d..c278686265ec 100755 --- a/ci/dash/lint-tidy.sh +++ b/ci/dash/lint-tidy.sh @@ -65,7 +65,7 @@ if [ "${CACHE_SIZE_MB}" -gt "${CTCACHE_MAXSIZE_MB}" ]; then FILE_COUNT=$(find "${CTCACHE_DIR}" -type f | wc -l) REMOVE_COUNT=$((FILE_COUNT / 5)) find "${CTCACHE_DIR}" -type f -printf '%T+ %p\0' | sort -z | head -z -n "${REMOVE_COUNT}" | cut -z -d' ' -f2- | xargs -0 rm -f 2>/dev/null || true - echo "Removed ${REMOVE_COUNT} oldest cache entries" + echo "Attempted to remove ${REMOVE_COUNT} oldest cache entries" fi echo "Cache size after cleanup: $(du -sh "${CTCACHE_DIR}" 2>/dev/null | cut -f1)" fi From 28577db67cbebf2bb0c22a45c80dcce015f485c8 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Fri, 19 Dec 2025 22:59:52 +0300 Subject: [PATCH 6/8] refactor: improve ctcache configuration maintainability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move CTCACHE_DIR and CTCACHE_MAXSIZE_MB to ci/test/00_setup_env.sh - Use command -v instead of hardcoded paths for clang-tidy and clang-tidy-cache - Store clang-tidy location in CLANG_TIDY_BIN variable for reuse - Extract cache cleanup logic into cleanup_ctcache() function - Convert CTCACHE_COMMIT to ARG variable in Dockerfile 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/build-src.yml | 1 + ci/dash/lint-tidy.sh | 52 +++++++++++++++++------------ ci/test/00_setup_env.sh | 3 ++ contrib/containers/ci/ci.Dockerfile | 2 +- 4 files changed, 35 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-src.yml b/.github/workflows/build-src.yml index c7678079356d..acd6fe17e56b 100644 --- a/.github/workflows/build-src.yml +++ b/.github/workflows/build-src.yml @@ -126,6 +126,7 @@ jobs: - name: Run linters if: inputs.build-target == 'linux64_multiprocess' run: | + CACHE_DIR="/cache" export BUILD_TARGET="${{ inputs.build-target }}" source ./ci/dash/matrix.sh ./ci/dash/lint-tidy.sh diff --git a/ci/dash/lint-tidy.sh b/ci/dash/lint-tidy.sh index c278686265ec..359128c30ae9 100755 --- a/ci/dash/lint-tidy.sh +++ b/ci/dash/lint-tidy.sh @@ -11,25 +11,47 @@ set -eo pipefail # only on nor do they set the requisite build parameters. Make sure you do # that *before* running this script. +# Cleanup old ctcache entries to keep cache size under limit +cleanup_ctcache() { + local cache_dir=$1 + local max_size_mb=$2 + local cache_size_mb + + cache_size_mb=$(du -sm "${cache_dir}" 2>/dev/null | cut -f1) + if [ "${cache_size_mb}" -gt "${max_size_mb}" ]; then + echo "Cache size ${cache_size_mb}MB exceeds limit ${max_size_mb}MB, cleaning old entries..." + # Remove files older than 7 days, or if still too large, oldest 20% of files + find "${cache_dir}" -type f -mtime +7 -delete 2>/dev/null || true + cache_size_mb=$(du -sm "${cache_dir}" 2>/dev/null | cut -f1) + if [ "${cache_size_mb}" -gt "${max_size_mb}" ]; then + local file_count remove_count + file_count=$(find "${cache_dir}" -type f | wc -l) + remove_count=$((file_count / 5)) + find "${cache_dir}" -type f -printf '%T+ %p\0' | sort -z | head -z -n "${remove_count}" | cut -z -d' ' -f2- | xargs -0 rm -f 2>/dev/null || true + echo "Attempted to remove ${remove_count} oldest cache entries" + fi + echo "Cache size after cleanup: $(du -sh "${cache_dir}" 2>/dev/null | cut -f1)" + fi +} + # Verify clang-tidy is available -if ! command -v clang-tidy >/dev/null 2>&1; then +CLANG_TIDY_BIN=$(command -v clang-tidy) +if [ -z "${CLANG_TIDY_BIN}" ]; then echo "Error: clang-tidy not found in PATH" exit 1 fi # Setup ctcache for clang-tidy result caching -export CTCACHE_DIR="/cache/ctcache" export CTCACHE_SAVE_OUTPUT=1 -CTCACHE_CLANG_TIDY=$(which clang-tidy) -export CTCACHE_CLANG_TIDY +export CTCACHE_CLANG_TIDY="${CLANG_TIDY_BIN}" mkdir -p "${CTCACHE_DIR}" -CLANG_TIDY_CACHE="/usr/local/bin/clang-tidy-cache" +CLANG_TIDY_CACHE=$(command -v clang-tidy-cache) CLANG_TIDY_CACHE_PY="/usr/local/bin/src/ctcache/clang_tidy_cache.py" # Verify ctcache is installed -if [ ! -x "${CLANG_TIDY_CACHE}" ]; then - echo "Error: ctcache binary not found at ${CLANG_TIDY_CACHE}" +if [ -z "${CLANG_TIDY_CACHE}" ]; then + echo "Error: clang-tidy-cache not found in PATH" exit 1 fi if [ ! -f "${CLANG_TIDY_CACHE_PY}" ]; then @@ -54,21 +76,7 @@ du -sh "${CTCACHE_DIR}" 2>/dev/null || echo "Cache directory not found" python3 "${CLANG_TIDY_CACHE_PY}" --show-stats 2>&1 || true # Limit cache size (ctcache has no built-in size management) -CTCACHE_MAXSIZE_MB=50 -CACHE_SIZE_MB=$(du -sm "${CTCACHE_DIR}" 2>/dev/null | cut -f1) -if [ "${CACHE_SIZE_MB}" -gt "${CTCACHE_MAXSIZE_MB}" ]; then - echo "Cache size ${CACHE_SIZE_MB}MB exceeds limit ${CTCACHE_MAXSIZE_MB}MB, cleaning old entries..." - # Remove files older than 7 days, or if still too large, oldest 20% of files - find "${CTCACHE_DIR}" -type f -mtime +7 -delete 2>/dev/null || true - CACHE_SIZE_MB=$(du -sm "${CTCACHE_DIR}" 2>/dev/null | cut -f1) - if [ "${CACHE_SIZE_MB}" -gt "${CTCACHE_MAXSIZE_MB}" ]; then - FILE_COUNT=$(find "${CTCACHE_DIR}" -type f | wc -l) - REMOVE_COUNT=$((FILE_COUNT / 5)) - find "${CTCACHE_DIR}" -type f -printf '%T+ %p\0' | sort -z | head -z -n "${REMOVE_COUNT}" | cut -z -d' ' -f2- | xargs -0 rm -f 2>/dev/null || true - echo "Attempted to remove ${REMOVE_COUNT} oldest cache entries" - fi - echo "Cache size after cleanup: $(du -sh "${CTCACHE_DIR}" 2>/dev/null | cut -f1)" -fi +cleanup_ctcache "${CTCACHE_DIR}" "${CTCACHE_MAXSIZE_MB}" echo "==========================" cd "${BASE_ROOT_DIR}/build-ci/dashcore-${BUILD_TARGET}" diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh index 9ff3c333754e..fc4944ae1d35 100755 --- a/ci/test/00_setup_env.sh +++ b/ci/test/00_setup_env.sh @@ -61,6 +61,9 @@ export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1} # The cache dir. # This folder exists on the ci host and ci guest. Changes are propagated back and forth. export CCACHE_DIR=${CCACHE_DIR:-$CACHE_DIR/ccache} +# ctcache (clang-tidy cache) configuration +export CTCACHE_DIR=${CTCACHE_DIR:-$CACHE_DIR/ctcache} +export CTCACHE_MAXSIZE_MB=${CTCACHE_MAXSIZE_MB:-50} # The depends dir. # This folder exists on the ci host and ci guest. Changes are propagated back and forth. export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends} diff --git a/contrib/containers/ci/ci.Dockerfile b/contrib/containers/ci/ci.Dockerfile index 6c8e2ba3919c..1198aa396d3b 100644 --- a/contrib/containers/ci/ci.Dockerfile +++ b/contrib/containers/ci/ci.Dockerfile @@ -67,8 +67,8 @@ RUN set -ex; \ # Install ctcache for clang-tidy result caching # Pin to specific commit to ensure patch applies correctly +ARG CTCACHE_COMMIT=e33c063ca6e52b48bcefbc45d46d8c150ffa81ca RUN set -ex; \ - CTCACHE_COMMIT="e33c063ca6e52b48bcefbc45d46d8c150ffa81ca"; \ mkdir -p /usr/local/bin/src/ctcache; \ curl -fsSL "https://raw.githubusercontent.com/matus-chochlik/ctcache/${CTCACHE_COMMIT}/src/ctcache/clang_tidy_cache.py" \ -o /usr/local/bin/src/ctcache/clang_tidy_cache.py; \ From 7c310c7ef2de76d41ee4b6205bffe26a4db260d2 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Fri, 19 Dec 2025 23:35:54 +0300 Subject: [PATCH 7/8] refactor: derive ctcache Python script path from wrapper location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of hardcoding the Python script path, derive it from the clang-tidy-cache wrapper location using the same logic the wrapper itself uses. This improves portability if ctcache is installed in a different location. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- ci/dash/lint-tidy.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/dash/lint-tidy.sh b/ci/dash/lint-tidy.sh index 359128c30ae9..e8153a62d844 100755 --- a/ci/dash/lint-tidy.sh +++ b/ci/dash/lint-tidy.sh @@ -47,13 +47,15 @@ export CTCACHE_CLANG_TIDY="${CLANG_TIDY_BIN}" mkdir -p "${CTCACHE_DIR}" CLANG_TIDY_CACHE=$(command -v clang-tidy-cache) -CLANG_TIDY_CACHE_PY="/usr/local/bin/src/ctcache/clang_tidy_cache.py" # Verify ctcache is installed if [ -z "${CLANG_TIDY_CACHE}" ]; then echo "Error: clang-tidy-cache not found in PATH" exit 1 fi + +# Derive Python script path from wrapper location (matches wrapper's own logic) +CLANG_TIDY_CACHE_PY="$(dirname "${CLANG_TIDY_CACHE}")/src/ctcache/clang_tidy_cache.py" if [ ! -f "${CLANG_TIDY_CACHE_PY}" ]; then echo "Error: ctcache Python script not found at ${CLANG_TIDY_CACHE_PY}" exit 1 From 040ac27166b4bc1fc3c6423328a77d97fdd953ad Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sun, 21 Dec 2025 13:46:04 +0300 Subject: [PATCH 8/8] ci: bump CTCACHE_COMMIT to e393144d5c49b060a1dbc7ae15b9c6973efb967d --- contrib/containers/ci/ci.Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/contrib/containers/ci/ci.Dockerfile b/contrib/containers/ci/ci.Dockerfile index 1198aa396d3b..2f0659cbf01f 100644 --- a/contrib/containers/ci/ci.Dockerfile +++ b/contrib/containers/ci/ci.Dockerfile @@ -67,17 +67,13 @@ RUN set -ex; \ # Install ctcache for clang-tidy result caching # Pin to specific commit to ensure patch applies correctly -ARG CTCACHE_COMMIT=e33c063ca6e52b48bcefbc45d46d8c150ffa81ca +ARG CTCACHE_COMMIT=e393144d5c49b060a1dbc7ae15b9c6973efb967d RUN set -ex; \ mkdir -p /usr/local/bin/src/ctcache; \ curl -fsSL "https://raw.githubusercontent.com/matus-chochlik/ctcache/${CTCACHE_COMMIT}/src/ctcache/clang_tidy_cache.py" \ -o /usr/local/bin/src/ctcache/clang_tidy_cache.py; \ curl -fsSL "https://raw.githubusercontent.com/matus-chochlik/ctcache/${CTCACHE_COMMIT}/clang-tidy" \ -o /usr/local/bin/clang-tidy-cache; \ - sed -i 's/return shlex\.split(command\["arguments"\]\[0\])/return command["arguments"]/' \ - /usr/local/bin/src/ctcache/clang_tidy_cache.py; \ - sed -i "s/digest = f'{i:x}'/digest = f'{i:02x}'/" \ - /usr/local/bin/src/ctcache/clang_tidy_cache.py; \ chmod +x /usr/local/bin/clang-tidy-cache; RUN \