From 537b01901fff7e60cbcbbfe6d4abe4b5c6f92694 Mon Sep 17 00:00:00 2001 From: hermes Date: Fri, 16 Oct 2026 09:53:49 +0000 Subject: [PATCH] test(npm): plant the macOS cache layout too From the Codex re-gate: the planted-binary check used only ~/.cache, so the old macOS fallback (~/Library/Caches) would have escaped it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01V3syn2fN2LNo5pvTSqc6eh --- scripts/npm-smoke.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/npm-smoke.sh b/scripts/npm-smoke.sh index 73d172f..a97a5fc 100755 --- a/scripts/npm-smoke.sh +++ b/scripts/npm-smoke.sh @@ -109,10 +109,13 @@ XDG_CACHE_HOME="${smoke_dir}/user-cache" IDX_BINARY_URL="${repo_root}/target/rel # Without an absolute cache root (empty HOME) there is no cache fallback, so a # binary planted under the current directory is never run. planted_dir="${smoke_dir}/planted" -planted="${planted_dir}/.cache/idx-mcp/$(node -p 'require("./npm/idx-mcp/package.json").version')/$(node -p 'process.platform + "-" + process.arch')/idx-mcp" -mkdir -p "$(dirname "$planted")" -printf '#!/bin/sh\necho PLANTED\n' > "$planted" -chmod +x "$planted" +planted_rel="idx-mcp/$(node -p 'require("./npm/idx-mcp/package.json").version')/$(node -p 'process.platform + "-" + process.arch')/idx-mcp" +# Both cache layouts: ~/.cache (Linux) and ~/Library/Caches (macOS). +for planted in "${planted_dir}/.cache/${planted_rel}" "${planted_dir}/Library/Caches/${planted_rel}"; do + mkdir -p "$(dirname "$planted")" + printf '#!/bin/sh\necho PLANTED\n' > "$planted" + chmod +x "$planted" +done if (cd "$planted_dir" && HOME='' XDG_CACHE_HOME='' "${read_only_dir}/node_modules/.bin/idx-mcp" --help 2>&1) | grep -q PLANTED; then echo "npm smoke: the launcher ran a binary from the current directory" >&2 exit 1