From b573f067d12716db0c4e59d4748f272f8732c1e1 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 28 Jul 2026 20:18:12 +0000 Subject: [PATCH] Prove the trace wrapper records before trusting an empty trace The `notools` check reads an absence: it passes when the trace file contains no compiler, git or brew invocation. A shim directory that never reached PATH produces exactly the same empty file as an installer that touched nothing, so the single leg carrying that assertion would stay green no matter what the installer did. "Verify the simulation actually took effect" only ran for mask mode, which left the trace leg with nothing checking its own instrumentation. Call git explicitly after sourcing the environment and require it to appear in the trace, then truncate the file so the self-test entry does not count against the install. The call has to be explicit because macOS reaches _has_working_git only under STUDIO_LOCAL_INSTALL (install.sh:2026), so no consumer leg on that platform probes git on its own. --- .../workflows/clean-machine-install-ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/clean-machine-install-ci.yml b/.github/workflows/clean-machine-install-ci.yml index bd37f9b1ce..6ed02a7144 100644 --- a/.github/workflows/clean-machine-install-ci.yml +++ b/.github/workflows/clean-machine-install-ci.yml @@ -123,6 +123,25 @@ jobs: UNSLOTH_CLEAN_ALLOW_WORKING='${{ matrix.allow_working }}' \ bash .github/scripts/clean-machine-assert.sh absent + - name: Verify the trace actually records + if: matrix.mode == 'trace' + run: | + # `notools` reads an absence, so a shim dir that never reached PATH is + # indistinguishable from an installer that touched nothing, and the one leg + # carrying that assertion would pass no matter what the installer did. + # Prove the wrapper records before trusting an empty file. macOS never + # probes git off the --local path, so this must be an explicit call. + set -a; . ./clean-machine.env; set +a + [ -n "$UNSLOTH_TOOL_TRACE" ] || { echo "::error::trace mode set no UNSLOTH_TOOL_TRACE"; exit 1; } + git --version >/dev/null 2>&1 || true + if ! grep -q "^git[[:space:]]" "$UNSLOTH_TOOL_TRACE"; then + echo "::error::the trace wrapper did not record a git call, so notools proves nothing" + echo "PATH=$PATH"; command -v git; cat "$UNSLOTH_TOOL_TRACE" || true + exit 1 + fi + echo "trace wrapper records; clearing the self-test entry" + : > "$UNSLOTH_TOOL_TRACE" + - name: Install id: install env: