From 20d2dde213f057fe7cf113443ddcc0c97e90b2dd Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Mon, 29 Jun 2026 13:04:40 +0800 Subject: [PATCH] fix(smoke): reseed mcpplibs cleanly, excluding the repo's read-only .git packs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit smoke-full-linux failed in 'smoke tests' with hundreds of: cp: cannot create regular file '.../mcpplibs/./.git/objects/pack/pack-*.pack': Permission denied Root cause: the smoke jobs run several scripts under one shared MCPP_HOME. By the time smoke_imgui_module.sh runs, an earlier smoke has already populated $MCPP_HOME/registry/data/mcpplibs/.git with read-only git pack objects (git makes packs mode 0444). smoke_imgui_module.sh then did, with no guard: cp -a "$ROOT/." "$default_index/" which copies the repo's OWN .git (same-named, read-only packs) over the existing read-only packs — and cp cannot overwrite a read-only target -> Permission denied -> the whole job fails (exit 1). Pre-existing since #51; not a mcpp/xlings bug (mcpp shells no such cp; xlings uses std::filesystem::copy). Fix: remove the destination first (rm -rf tolerates read-only files — it needs write on the parent dir, not the file), and seed from the working tree EXCLUDING the repo's .git. The package index only needs pkgs/; the repo's read-only pack objects are both irrelevant and the sole cause of the conflict. Reproduced locally: old path -> 821 'Permission denied'; new path -> 0, pkgs/ present. --- tests/smoke_imgui_module.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/smoke_imgui_module.sh b/tests/smoke_imgui_module.sh index 2a06b2f..4f691ff 100644 --- a/tests/smoke_imgui_module.sh +++ b/tests/smoke_imgui_module.sh @@ -51,8 +51,15 @@ if [[ -f "$USER_MCPP/config.toml" ]]; then fi default_index="$MCPP_HOME/registry/data/mcpplibs" +# Reseed cleanly. The smoke jobs share one MCPP_HOME across several scripts, so +# an earlier smoke may already have populated mcpplibs/.git with read-only pack +# objects; `cp -a "$ROOT/."` over those then fails with "Permission denied". +# Remove the destination first, and skip the repo's own .git — its pack objects +# are read-only and irrelevant to the package index (which only needs pkgs/), +# and are the sole reason the copy ever conflicts. +rm -rf "$default_index" mkdir -p "$default_index" -cp -a "$ROOT/." "$default_index/" +( cd "$ROOT" && find . -mindepth 1 -maxdepth 1 ! -name .git -exec cp -a {} "$default_index/" \; ) rm -f "$default_index/.xlings-index-cache.json" printf 'ok\n' > "$default_index/.mcpp-index-updated"