diff --git a/.github/probe/upgrade.sh b/.github/probe/upgrade.sh new file mode 100644 index 000000000..57e9fb0ba --- /dev/null +++ b/.github/probe/upgrade.sh @@ -0,0 +1,210 @@ +#!/usr/bin/env bash +# TEMPORARY probe (do not merge). Prints, never asserts. +# +# Measures what a user sees when they upgrade from the previous release +# (2026.10.11.1, bundled xlings 2026.10.10.2) to the current one +# (2026.10.16.3, bundled xlings 2026.10.16.2) on a home the previous release +# made, and then run `mcpp new && mcpp run`. +# +# variant: +# plain the previous release installs from today's index; nothing altered +# snapshot the previous release installs from the xim index as of +# 2026-10-07 (xim-pkgindex ebf1fbb, before llvm revision 1 and +# gcc 16.1.0-r1): payloads genuinely of the old revision +# stamp like plain, then every payload stamp records a revision other +# than its recipe's (the mechanism, on every platform) +# orphan like stamp, then the version DB loses c++@ while +# the workspace keeps it active (the shape of the reported home) +set -u +VARIANT="${1:-plain}" +OLD_VER=2026.10.11.1 +NEW_VER=2026.10.16.3 +SNAPSHOT=ebf1fbb3417ec513b923279044433887b3af8850 + +W="${RUNNER_TEMP:-/tmp}/upg" +rm -rf "$W"; mkdir -p "$W" +export MCPP_HOME="$W/home" +REG="$MCPP_HOME/registry" +PY=$(command -v python3 || command -v python) + +case "$(uname -s)-$(uname -m)" in + Linux-x86_64) PLAT=linux-x86_64; EXT=tar.gz; EXE= ;; + Linux-aarch64) PLAT=linux-aarch64; EXT=tar.gz; EXE= ;; + Darwin-arm64) PLAT=macosx-arm64; EXT=tar.gz; EXE= ;; + MINGW*|MSYS*) PLAT=windows-x86_64; EXT=zip; EXE=.exe ;; + *) echo "unknown platform $(uname -a)"; exit 0 ;; +esac +IS_LINUX=0; [[ $PLAT == linux-* ]] && IS_LINUX=1 + +section() { echo; echo "================ [$(date -u +%H:%M:%S)] $* ================"; } + +fetch_release() { # ver dest + local ver=$1 dest=$2 name="mcpp-$1-$PLAT.$EXT" + curl -fsSL -o "$W/$name" "https://github.com/mcpp-community/mcpp/releases/download/v$ver/$name" || { echo "download $name failed"; return 1; } + mkdir -p "$W/x-$ver" + if [[ $EXT == zip ]]; then + "$PY" -c "import zipfile,sys; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])" "$W/$name" "$W/x-$ver" + else + tar xzf "$W/$name" -C "$W/x-$ver" + fi + mv "$W/x-$ver"/mcpp-$ver-$PLAT "$dest" + chmod +x "$dest/bin/mcpp$EXE" "$dest/registry/bin/xlings$EXE" 2>/dev/null || true +} + +# run