|
| 1 | +#!/usr/bin/env bash |
| 2 | +# TEMPORARY PROBE (do not merge): consume the published mcpp 2026.10.8.1 from |
| 3 | +# a fresh xlings home with the published xlings client, through one mirror, |
| 4 | +# and build and run a project with the host's default toolchain. |
| 5 | +set -euo pipefail |
| 6 | +V=2026.10.8.1; XV=2026.10.8.1; MIRROR=$1 |
| 7 | +base="$RUNNER_TEMP/consume-$MIRROR"; rm -rf "$base"; mkdir -p "$base"; cd "$base" |
| 8 | +case "$(uname -s)-$(uname -m)" in |
| 9 | + Linux-aarch64) a=xlings-$XV-linux-aarch64.tar.gz ;; |
| 10 | + Linux-x86_64) a=xlings-$XV-linux-x86_64.tar.gz ;; |
| 11 | + Darwin-arm64) a=xlings-$XV-macosx-arm64.tar.gz ;; |
| 12 | + *) a=xlings-$XV-windows-x86_64.zip ;; |
| 13 | +esac |
| 14 | +curl -fsSL -o "$a" "https://github.com/openxlings/xlings/releases/download/v$XV/$a" |
| 15 | +case "$a" in *.zip) unzip -q "$a" ;; *) tar xzf "$a" ;; esac |
| 16 | +xl=$(find "$base" -type f \( -name xlings -o -name xlings.exe \) -path '*/bin/*' | head -1) |
| 17 | +export XLINGS_HOME="$base/home" XLINGS_NON_INTERACTIVE=1 |
| 18 | +"$xl" --version |
| 19 | +"$xl" config --mirror "$MIRROR" |
| 20 | +"$xl" update |
| 21 | +mkdir -p "$base/neutral"; cd "$base/neutral" |
| 22 | +"$xl" install mcpp -y |
| 23 | +m=$(find "$XLINGS_HOME/data/xpkgs/xim-x-mcpp" -maxdepth 2 \( -name mcpp -o -name mcpp.exe -o -name mcpp.cmd -o -name mcpp.bat \) | head -1) |
| 24 | +echo "installed: $(ls "$XLINGS_HOME/data/xpkgs/xim-x-mcpp")" |
| 25 | +export MCPP_HOME="$base/mcpp-home" |
| 26 | +"$m" --version | tee version.txt |
| 27 | +grep -q "mcpp $V" version.txt |
| 28 | +"$m" new hello |
| 29 | +cd hello |
| 30 | +"$m" run 2>&1 | tee run.log |
| 31 | +grep -q "Hello from hello" run.log |
| 32 | +"$m" toolchain list 2>&1 | head -20 || true |
| 33 | +echo "PASS: $(uname -s)-$(uname -m) $MIRROR consumed mcpp $V and ran hello" |
0 commit comments