Skip to content

Commit 20d2dde

Browse files
committed
fix(smoke): reseed mcpplibs cleanly, excluding the repo's read-only .git packs
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.
1 parent f08f9e7 commit 20d2dde

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/smoke_imgui_module.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ if [[ -f "$USER_MCPP/config.toml" ]]; then
5151
fi
5252

5353
default_index="$MCPP_HOME/registry/data/mcpplibs"
54+
# Reseed cleanly. The smoke jobs share one MCPP_HOME across several scripts, so
55+
# an earlier smoke may already have populated mcpplibs/.git with read-only pack
56+
# objects; `cp -a "$ROOT/."` over those then fails with "Permission denied".
57+
# Remove the destination first, and skip the repo's own .git — its pack objects
58+
# are read-only and irrelevant to the package index (which only needs pkgs/),
59+
# and are the sole reason the copy ever conflicts.
60+
rm -rf "$default_index"
5461
mkdir -p "$default_index"
55-
cp -a "$ROOT/." "$default_index/"
62+
( cd "$ROOT" && find . -mindepth 1 -maxdepth 1 ! -name .git -exec cp -a {} "$default_index/" \; )
5663
rm -f "$default_index/.xlings-index-cache.json"
5764
printf 'ok\n' > "$default_index/.mcpp-index-updated"
5865

0 commit comments

Comments
 (0)