Skip to content

Commit 210cc36

Browse files
committed
fix(ci): pick the newest mcpp.exe on Windows; gate e2e 163 step 4 on xlings 0.4.69
Two CI failures from PR #280, both real and both worth fixing rather than working around. 1. Windows e2e ran the PREVIOUS release's binary. `MCPP_SELF=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)` `target/` is restored from cache and keeps one directory per build fingerprint. A version bump changes the fingerprint, so the freshly built 0.0.106 binary landed next to the cached 0.0.105 one and `head -1` returned whichever the directory walk hit first — hence `Version mismatch: mcpp.toml=0.0.106, --version='mcpp 0.0.105'`. Latent all along; the version bump is just what made two candidates exist. The Linux workflows already sort by mtime and take the newest — this brings the five Windows/release sites in line with them. 2. e2e 163 step 4 asserted a capability the sandbox cannot have yet. That step covers two same-short-name packages in ONE index, which needs xlings >= 0.4.69 (openxlings/xlings#381). The sandbox xlings comes from bootstrapping the PREVIOUS mcpp release, so CI runs 0.4.68 until 0.0.106 ships bundling 0.4.69 — a genuine chicken-and-egg, not a defect. Step 4 now detects the sandbox xlings version and skips with a stated reason when it is older. Properties 1-3 (short-name install, legacy FQN install, arbitrary-filename discovery) are what this change is responsible for and stay asserted unconditionally. Verified both branches locally by swapping the sandbox xlings: 0.4.69 runs step 4, 0.4.68 skips it with the reason printed.
1 parent 436fca6 commit 210cc36

4 files changed

Lines changed: 60 additions & 8 deletions

File tree

.github/workflows/ci-windows-e2e.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ jobs:
4444
run: |
4545
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
4646
"$MCPP" build
47-
MCPP_SELF=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)
47+
# Pick the NEWEST mcpp.exe, not an arbitrary one: `target/` is
48+
# restored from cache and keeps a directory per build fingerprint,
49+
# so after a version bump the freshly built binary sits alongside
50+
# the previous release's. `find | head -1` returned whichever the
51+
# directory walk hit first — which is how a 0.0.106 build ran the
52+
# 0.0.105 binary and failed 01_help_and_version.
53+
MCPP_SELF=$(find target -name "mcpp.exe" -path "*/bin/*" -printf "%T@ %p\n" \
54+
| sort -rn | head -1 | cut -d" " -f2-)
4855
test -n "$MCPP_SELF" || { echo "FAIL: no mcpp.exe"; exit 1; }
4956
MCPP_SELF=$(cd "$(dirname "$MCPP_SELF")" && pwd)/$(basename "$MCPP_SELF")
5057
"$MCPP_SELF" --version

.github/workflows/ci-windows.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ jobs:
4040
run: |
4141
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
4242
"$MCPP" build
43-
MCPP_SELF=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)
43+
# Pick the NEWEST mcpp.exe, not an arbitrary one: `target/` is
44+
# restored from cache and keeps a directory per build fingerprint,
45+
# so after a version bump the freshly built binary sits alongside
46+
# the previous release's. `find | head -1` returned whichever the
47+
# directory walk hit first — which is how a 0.0.106 build ran the
48+
# 0.0.105 binary and failed 01_help_and_version.
49+
MCPP_SELF=$(find target -name "mcpp.exe" -path "*/bin/*" -printf "%T@ %p\n" \
50+
| sort -rn | head -1 | cut -d" " -f2-)
4451
test -n "$MCPP_SELF" || { echo "FAIL: no mcpp.exe"; exit 1; }
4552
MCPP_SELF=$(cd "$(dirname "$MCPP_SELF")" && pwd)/$(basename "$MCPP_SELF")
4653
"$MCPP_SELF" --version
@@ -59,8 +66,14 @@ jobs:
5966
VERSION=$(awk -F '"' '/^version[[:space:]]*=/{print $2; exit}' mcpp.toml)
6067
WRAPPER="mcpp-${VERSION}-windows-x86_64"
6168
ZIPNAME="${WRAPPER}.zip"
62-
63-
MCPP_BIN=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)
69+
# Pick the NEWEST mcpp.exe, not an arbitrary one: `target/` is
70+
# restored from cache and keeps a directory per build fingerprint,
71+
# so after a version bump the freshly built binary sits alongside
72+
# the previous release's. `find | head -1` returned whichever the
73+
# directory walk hit first — which is how a 0.0.106 build ran the
74+
# 0.0.105 binary and failed 01_help_and_version.
75+
MCPP_BIN=$(find target -name "mcpp.exe" -path "*/bin/*" -printf "%T@ %p\n" \
76+
| sort -rn | head -1 | cut -d" " -f2-)
6477
test -n "$MCPP_BIN" || { echo "FAIL: no mcpp.exe in target/"; exit 1; }
6578
6679
STAGING=$(mktemp -d)
@@ -116,7 +129,14 @@ jobs:
116129
run: |
117130
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
118131
"$MCPP" build
119-
MCPP_SELF=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)
132+
# Pick the NEWEST mcpp.exe, not an arbitrary one: `target/` is
133+
# restored from cache and keeps a directory per build fingerprint,
134+
# so after a version bump the freshly built binary sits alongside
135+
# the previous release's. `find | head -1` returned whichever the
136+
# directory walk hit first — which is how a 0.0.106 build ran the
137+
# 0.0.105 binary and failed 01_help_and_version.
138+
MCPP_SELF=$(find target -name "mcpp.exe" -path "*/bin/*" -printf "%T@ %p\n" \
139+
| sort -rn | head -1 | cut -d" " -f2-)
120140
test -n "$MCPP_SELF" || { echo "FAIL: no mcpp.exe"; exit 1; }
121141
MCPP_SELF=$(cd "$(dirname "$MCPP_SELF")" && pwd)/$(basename "$MCPP_SELF")
122142
echo "MCPP_SELF=$MCPP_SELF" >> "$GITHUB_ENV"

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,14 @@ jobs:
630630
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
631631
632632
"$MCPP" build
633-
634-
MCPP_BIN=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)
633+
# Pick the NEWEST mcpp.exe, not an arbitrary one: `target/` is
634+
# restored from cache and keeps a directory per build fingerprint,
635+
# so after a version bump the freshly built binary sits alongside
636+
# the previous release's. `find | head -1` returned whichever the
637+
# directory walk hit first — which is how a 0.0.106 build ran the
638+
# 0.0.105 binary and failed 01_help_and_version.
639+
MCPP_BIN=$(find target -name "mcpp.exe" -path "*/bin/*" -printf "%T@ %p\n" \
640+
| sort -rn | head -1 | cut -d" " -f2-)
635641
test -n "$MCPP_BIN" || { echo "FAIL: no mcpp.exe in target/"; exit 1; }
636642
MCPP_BIN=$(cd "$(dirname "$MCPP_BIN")" && pwd)/$(basename "$MCPP_BIN")
637643
echo "Self-hosted binary: $MCPP_BIN"

tests/e2e/163_identity_first_resolution.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,26 @@ mkapp app3 acme ../idx3 acme widget
8686
cat app3/out.txt; exit 1; }
8787

8888
# ── 4. two namespaces, one short name, ONE index ────────────────────
89-
# Needs xlings >= 0.4.69. Both must be independently addressable.
89+
# Needs xlings >= 0.4.69 (openxlings/xlings#381): before it, one index repo
90+
# keyed its table by the bare `package.name`, so the second package was
91+
# unreachable even with an explicit namespace.
92+
#
93+
# The sandbox xlings comes from bootstrapping the PREVIOUS mcpp release, so
94+
# until 0.0.106 ships (bundling 0.4.69) CI still runs 0.4.68 here. Skip this
95+
# sub-case rather than assert a capability the sandbox cannot have yet —
96+
# properties 1-3 above are the ones this change is responsible for.
97+
XLBIN="${MCPP_HOME:-$HOME/.mcpp}/registry/bin/xlings"
98+
XLVER=""
99+
[ -x "$XLBIN" ] && XLVER=$("$XLBIN" --version 2>/dev/null | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
100+
xl_ge_0469() {
101+
[ -n "$XLVER" ] || return 1
102+
printf '%s\n0.4.69\n' "$XLVER" | sort -V | head -1 | grep -qx "0.4.69"
103+
}
104+
if ! xl_ge_0469; then
105+
echo "PASS 163_identity_first_resolution (step 4 skipped: sandbox xlings ${XLVER:-unknown} < 0.4.69)"
106+
exit 0
107+
fi
108+
90109
mkidx idx4 a/alpha.widget.lua alpha widget
91110
mkidx idx4 b/beta.widget.lua beta widget
92111

0 commit comments

Comments
 (0)