From 8d48d7c90f51ecf1c8f6631ce12b8ad2942ca79b Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Fri, 30 Oct 2026 12:49:29 +0200 Subject: [PATCH] CI: narrow build-dir reset stamp to headers and cache options The stamp hashed the path of every non-source file and the full contents of every CMakeLists.txt and .cmake file. Runners that alternate between PRs therefore saw a different stamp on almost every run and wiped the build tree each time (k3 runs started ninja at [1/1008], about 40 min per lane). Ninja depfiles already track source and header contents, and CMake re-runs itself when a CMakeLists changes. The rebuilt-LLVM case is covered by the LLVM install listing (PR #2074 deps). So the stamp now keeps only what ninja cannot see: the LLVM install, the list of header paths (a new header can shadow an already included one), and the option()/CACHE lines of the CMake files (CMake keeps cached values across a re-run). The workflow file itself stays in the stamp. Fixes #2193. --- .github/workflows/unit-tests-amd-rusticl.yml | 4 ++-- .github/workflows/unit-tests-macos-pocl.yml | 4 ++-- .github/workflows/unit-tests-riscv-pocl.yml | 4 ++-- .github/workflows/unit-tests-x86-intel.yml | 4 ++-- .github/workflows/unit-tests-x86-pocl.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unit-tests-amd-rusticl.yml b/.github/workflows/unit-tests-amd-rusticl.yml index 63503d1ec..04a09cf02 100644 --- a/.github/workflows/unit-tests-amd-rusticl.yml +++ b/.github/workflows/unit-tests-amd-rusticl.yml @@ -70,8 +70,8 @@ jobs: run: | set -eo pipefail STAMP=$(set -eo pipefail; { find -L $LLVM_PREFIX/bin $LLVM_PREFIX/lib -maxdepth 1 -type f -printf '%P %T@\n' | sort; cat .github/workflows/unit-tests-amd-rusticl.yml - git ls-files --recurse-submodules | grep -vE '\.(c|cc|cpp|cxx|hip|cu|md|rst)$' - git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat; } | sha256sum) + git ls-files --recurse-submodules -- '*.h' '*.hh' '*.hpp' '*.inc' '*.cuh' + git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat | grep -E 'option\(|CACHE'; } | sha256sum) [ "$(cat $BUILD_ROOT/stamp 2>/dev/null)" = "$STAMP" ] || rm -rf $BUILD_ROOT mkdir -p $BUILD_ROOT && echo "$STAMP" > $BUILD_ROOT/stamp rm -f $BUILD_ROOT/build/checkpy_*.txt $BUILD_ROOT/build/Testing/Temporary/LastTest.log diff --git a/.github/workflows/unit-tests-macos-pocl.yml b/.github/workflows/unit-tests-macos-pocl.yml index a66916127..f424a1e5c 100644 --- a/.github/workflows/unit-tests-macos-pocl.yml +++ b/.github/workflows/unit-tests-macos-pocl.yml @@ -82,8 +82,8 @@ jobs: run: | set -eo pipefail STAMP=$(set -eo pipefail; { find -L $LLVM_DIR/bin $LLVM_DIR/lib -maxdepth 1 -type f -exec stat -f '%N %m' {} + | sort; echo $SDKROOT; cat .github/workflows/unit-tests-macos-pocl.yml - git ls-files --recurse-submodules | grep -vE '\.(c|cc|cpp|cxx|hip|cu|md|rst)$' - git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat; } | shasum -a 256) + git ls-files --recurse-submodules -- '*.h' '*.hh' '*.hpp' '*.inc' '*.cuh' + git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat | grep -E 'option\(|CACHE'; } | shasum -a 256) [ "$(cat $BUILD_ROOT/stamp 2>/dev/null)" = "$STAMP" ] || rm -rf $BUILD_ROOT mkdir -p $BUILD_ROOT && echo "$STAMP" > $BUILD_ROOT/stamp rm -f $BUILD_ROOT/*/checkpy_*.txt $BUILD_ROOT/*/Testing/Temporary/LastTest.log diff --git a/.github/workflows/unit-tests-riscv-pocl.yml b/.github/workflows/unit-tests-riscv-pocl.yml index d9bf0330f..5da781781 100644 --- a/.github/workflows/unit-tests-riscv-pocl.yml +++ b/.github/workflows/unit-tests-riscv-pocl.yml @@ -43,8 +43,8 @@ jobs: run: | set -eo pipefail STAMP=$(set -eo pipefail; { find -L $LLVM_DIR/bin $LLVM_DIR/lib -maxdepth 1 -type f -printf '%P %T@\n' | sort; cat .github/workflows/unit-tests-riscv-pocl.yml - git ls-files --recurse-submodules | grep -vE '\.(c|cc|cpp|cxx|hip|cu|md|rst)$' - git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat; } | sha256sum) + git ls-files --recurse-submodules -- '*.h' '*.hh' '*.hpp' '*.inc' '*.cuh' + git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat | grep -E 'option\(|CACHE'; } | sha256sum) [ "$(cat $BUILD_ROOT/stamp 2>/dev/null)" = "$STAMP" ] || rm -rf $BUILD_ROOT mkdir -p $BUILD_ROOT && echo "$STAMP" > $BUILD_ROOT/stamp diff --git a/.github/workflows/unit-tests-x86-intel.yml b/.github/workflows/unit-tests-x86-intel.yml index 2107e8d7d..f80fa3396 100644 --- a/.github/workflows/unit-tests-x86-intel.yml +++ b/.github/workflows/unit-tests-x86-intel.yml @@ -73,8 +73,8 @@ jobs: module load oneapi/2025.0.4 llvm/23.0 level-zero/dgpu LLVM_DIR=$(llvm-config --prefix) STAMP=$(set -eo pipefail; { find -L $LLVM_DIR/bin $LLVM_DIR/lib -maxdepth 1 -type f -printf '%P %T@\n' | sort; cat .github/workflows/unit-tests-x86-intel.yml - git ls-files --recurse-submodules | grep -vE '\.(c|cc|cpp|cxx|hip|cu|md|rst)$' - git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat; } | sha256sum) + git ls-files --recurse-submodules -- '*.h' '*.hh' '*.hpp' '*.inc' '*.cuh' + git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat | grep -E 'option\(|CACHE'; } | sha256sum) [ "$(cat $BUILD_ROOT/stamp 2>/dev/null)" = "$STAMP" ] || rm -rf $BUILD_ROOT mkdir -p $BUILD_ROOT && echo "$STAMP" > $BUILD_ROOT/stamp diff --git a/.github/workflows/unit-tests-x86-pocl.yml b/.github/workflows/unit-tests-x86-pocl.yml index 477322900..1462c4a0c 100644 --- a/.github/workflows/unit-tests-x86-pocl.yml +++ b/.github/workflows/unit-tests-x86-pocl.yml @@ -50,8 +50,8 @@ jobs: run: | set -eo pipefail STAMP=$(set -eo pipefail; { find -L $LLVM_DIR/bin $LLVM_DIR/lib -maxdepth 1 -type f -printf '%P %T@\n' | sort; cat .github/workflows/unit-tests-x86-pocl.yml - git ls-files --recurse-submodules | grep -vE '\.(c|cc|cpp|cxx|hip|cu|md|rst)$' - git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat; } | sha256sum) + git ls-files --recurse-submodules -- '*.h' '*.hh' '*.hpp' '*.inc' '*.cuh' + git ls-files -z --recurse-submodules -- '*CMakeLists.txt' '*.cmake' | xargs -0 cat | grep -E 'option\(|CACHE'; } | sha256sum) [ "$(cat $BUILD_ROOT/stamp 2>/dev/null)" = "$STAMP" ] || rm -rf $BUILD_ROOT mkdir -p $BUILD_ROOT && echo "$STAMP" > $BUILD_ROOT/stamp