Skip to content

Commit 55dd342

Browse files
The closure removes the index directory rather than trusting an update (#16)
⚠️⚠️ `xlings update' reports success without having refreshed anything, and this script is the one place where that matters most: its whole purpose is to read what was just published, and it cannot begin by reading what was published last time. Measured three times in one day, in three shapes --- an artifact pointer served from a cache, `xlings update' exiting zero while the index directory still held the previous artifact, and a registry reporting the current hash while holding older content. The second is the one that bites here, and deleting the refresh MARKER does not help: `update' re-derives it from the directory that is already there and writes the same hash back. ⇒ The directory is removed. "The index looked fresh" and "the index was fresh" are indistinguishable in every output either produces. Co-authored-by: speak-agent <x.d2learn.org@gmail.com>
1 parent 283b1ca commit 55dd342

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tools/sandbox-closure.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,26 @@ set -euo pipefail
7777
say() { printf '\n=== %s ===\n' "$*"; }
7878
7979
say "the engine, from the index"
80+
81+
# ⚠️⚠️ `xlings update' REPORTS SUCCESS WITHOUT HAVING REFRESHED ANYTHING, and
82+
# this script is the one place where that matters most.
83+
#
84+
# Measured three times in one day, in three shapes: the artifact pointer served
85+
# from a cache; `xlings update' exiting zero while the index directory still
86+
# held the previous artifact; and a registry reporting the current hash while
87+
# holding older content. The second is the one that bites here --- deleting the
88+
# refresh MARKER does not help, because `update' re-derives it from the
89+
# directory that is already there and writes the same hash back.
90+
#
91+
# ⇒ THE DIRECTORY IS REMOVED, not the marker. A script whose whole purpose is to
92+
# read what was just published cannot begin by reading what was published last
93+
# time, and "the index looked fresh" is indistinguishable from "the index was
94+
# fresh" in every output either produces.
95+
for base in "${XLINGS_HOME:-}" "$HOME/.xlings"; do
96+
[ -n "$base" ] || continue
97+
[ -d "$base/data/xim-pkgindex" ] && rm -rf "$base/data/xim-pkgindex" \
98+
&& echo " removed $base/data/xim-pkgindex so that the index is fetched again"
99+
done
80100
xlings update > /dev/null 2>&1 || true
81101
# ⚠️ THE INDEX IS NAMED. `mcpp@<v>` alone is AMBIGUOUS wherever more than one
82102
# index repository carries the name --- measured: local, scode and xim all

0 commit comments

Comments
 (0)