From b12a8e0f752db2a8cd46a473dffffdb4717e45fe Mon Sep 17 00:00:00 2001 From: Jacob Lambert Date: Sun, 10 May 2026 14:36:00 -0700 Subject: [PATCH] [CI debug - DO NOT MERGE] Diagnose ninja cascade-rebuild on test side MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codegen and Comgr test jobs cascade-rebuild even with tar -xmf. Add diagnostic steps after untar in both jobs to capture: - mtime + size of build/.ninja_deps, .ninja_log, build.ninja (corruption or absence would explain "ninja thinks everything is dirty") - mtime of source CMakeLists.txt (for comparison vs build.ninja mtime — settles the "is mtime the trigger" question) - ninja -d explain -n output, which prints why ninja decides to rebuild each target without actually building (this is the gold signal — tells us if it's mtime, command-hash, depfile-missing, or something else) One-shot debug PR. Once we see the explain output we'll know what to fix and revert this. Do not merge. --- .github/workflows/spirv-ci-linux.yml | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/spirv-ci-linux.yml b/.github/workflows/spirv-ci-linux.yml index d0ffa55b6..1570f7526 100644 --- a/.github/workflows/spirv-ci-linux.yml +++ b/.github/workflows/spirv-ci-linux.yml @@ -322,6 +322,23 @@ jobs: - name: Untar build trees run: tar -xmf linux-build-tree.tar + # DEBUG: diagnose why test-job ninja invocations cascade-rebuild. + # Compare mtimes of build.ninja / .ninja_deps / .ninja_log against + # source CMakeLists.txt, and ask ninja to explain (-d explain -n) + # what it would rebuild and why, without actually building. + - name: Debug - inspect build tree state and ninja's reasoning + run: | + echo "::group::build/ ninja state files" + ls -la build/.ninja_deps build/.ninja_log build/build.ninja 2>&1 || true + wc -c build/.ninja_deps build/.ninja_log 2>&1 || true + echo "::endgroup::" + echo "::group::source CMakeLists.txt mtimes (for comparison)" + ls -la llvm-project/llvm/CMakeLists.txt llvm-project/llvm/projects/SPIRV-LLVM-Translator/CMakeLists.txt 2>&1 || true + echo "::endgroup::" + echo "::group::ninja explain (dry run)" + ninja -C build -d explain -n check-llvm-codegen-spirv 2>&1 | head -100 || true + echo "::endgroup::" + - name: Test - LLVM SPIRV backend (check-llvm-codegen-spirv) run: ninja -C build check-llvm-codegen-spirv @@ -363,6 +380,20 @@ jobs: - name: Untar build trees run: tar -xmf linux-build-tree.tar + # DEBUG: same diagnostic as the codegen job, but for build-comgr/. + - name: Debug - inspect build-comgr tree state and ninja's reasoning + run: | + echo "::group::build-comgr/ ninja state files" + ls -la build-comgr/.ninja_deps build-comgr/.ninja_log build-comgr/build.ninja 2>&1 || true + wc -c build-comgr/.ninja_deps build-comgr/.ninja_log 2>&1 || true + echo "::endgroup::" + echo "::group::source mtimes (for comparison)" + ls -la llvm-project/amd/comgr/CMakeLists.txt 2>&1 || true + echo "::endgroup::" + echo "::group::ninja explain (dry run)" + ninja -C build-comgr -d explain -n check-comgr 2>&1 | head -100 || true + echo "::endgroup::" + - name: Test - Comgr (check-comgr) # check-comgr depends on test-lit (runs lit suite) and test-unit # (runs gtest binaries via its COMMAND block), then runs ctest for