99# (that would require glibc/sysroot env activation, which is xlings'
1010# subos shim concern, not mcpp's toolchain-resolve feature).
1111set -e
12+ source " $( dirname " $0 " ) /_toolchain_env.sh"
1213
1314TMP=$( mktemp -d)
1415trap " rm -rf $TMP " EXIT
@@ -21,11 +22,21 @@ mkdir -p "$SANDBOX_HOME/registry/data/xpkgs"
2122# predicate (physical location must resolve inside cfg.registryDir), so the
2223# seed is deliberately KEPT: it doubles as a live canary — if the fence ever
2324# regresses, the machine's gcc breaks loudly and immediately.
24- if [[ -d " $HOME /.xlings/data/xpkgs/xim-x-gcc/16.1.0" ]]; then
25- ln -s " $HOME /.xlings/data/xpkgs/xim-x-gcc" \
26- " $SANDBOX_HOME /registry/data/xpkgs/xim-x-gcc"
25+ # The payload is the one this machine has: in the home mcpp installs into
26+ # (`mcpp toolchain install gcc <version>`, which is where CI's runners have it)
27+ # or in the system xlings. The probe named the system xlings and 16.1.0 alone
28+ # until 2026-11-12, and the script skipped itself on every runner.
29+ GCC_SEED=" "
30+ for store in " $( dirname " $MCPP_E2E_GCC_ROOT " ) " " $HOME /.xlings/data/xpkgs/xim-x-gcc" ; do
31+ if [[ -d " $store /$GCC_VERSION " ]]; then
32+ GCC_SEED=" $store "
33+ break
34+ fi
35+ done
36+ if [[ -n " $GCC_SEED " ]]; then
37+ ln -s " $GCC_SEED " " $SANDBOX_HOME /registry/data/xpkgs/xim-x-gcc"
2738else
28- echo " SKIP: system xlings has no gcc 16.1.0 "
39+ echo " SKIP: neither mcpp's home nor the system xlings has gcc $GCC_VERSION "
2940 echo " OK"
3041 exit 77
3142fi
@@ -36,7 +47,7 @@ cd "$TMP"
3647" $MCPP " new myapp > /dev/null
3748cd myapp
3849
39- cat > mcpp.toml << ' EOF '
50+ cat > mcpp.toml << EOF
4051[package]
4152name = "myapp"
4253version = "0.1.0"
@@ -45,7 +56,7 @@ standard = "c++23"
4556modules = true
4657import_std = true
4758[toolchain]
48- linux = "gcc@16.1.0 "
59+ linux = "gcc@${GCC_VERSION} "
4960[modules]
5061sources = ["src/**/*.cppm", "src/**/*.cpp"]
5162[targets.myapp]
@@ -66,9 +77,9 @@ echo "$out" | grep -q 'toolchain' || { echo "missing toolchain: $out"; exit 1;
6677# render as `@mcpp/...` — so we match the shortened form
6778# rather than the absolute one. The trailing path components are
6879# what actually prove the toolchain came from mcpp's sandbox.
69- echo " $out " | grep -q ' Resolved.*gcc@16.1.0 ' || {
70- echo " missing Resolved gcc@16.1.0 : $out " ; exit 1; }
71- echo " $out " | grep -q ' @mcpp/registry/data/xpkgs/xim-x-gcc/16.1.0 /bin/g++' || {
80+ echo " $out " | grep -q " Resolved.*gcc@${GCC_VERSION} " || {
81+ echo " missing Resolved gcc@${GCC_VERSION} : $out " ; exit 1; }
82+ echo " $out " | grep -q " @mcpp/registry/data/xpkgs/xim-x-gcc/${GCC_VERSION} /bin/g++" || {
7283 echo " Resolved path doesn't reference the mcpp sandbox xpkg: $out " ; exit 1; }
7384
7485echo " OK"
0 commit comments