Skip to content

Commit 9c6c780

Browse files
committed
fix: install LLVM via direct download (bypass xlings extraction bug)
xlings 0.4.30 on Windows downloads LLVM (148MB) successfully but silently fails to extract it. Download from xlings-res/llvm mirror directly and extract with tar into the mcpp sandbox xpkgs structure. This bypasses the xlings bug while keeping the same package layout. Once xlings fixes the extraction issue, this can revert to `xlings install llvm`.
1 parent 5e04720 commit 9c6c780

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ jobs:
5656
export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH"
5757
echo "$USERPROFILE/.xlings/subos/default/bin" >> "$GITHUB_PATH"
5858
xlings.exe --version
59-
xlings.exe install llvm -y
6059
xlings.exe install mcpp -y
6160
echo "=== Searching for mcpp binary ==="
6261
find "$USERPROFILE/.xlings" -name "mcpp.exe" -o -name "mcpp" 2>/dev/null | head -10
@@ -76,16 +75,19 @@ jobs:
7675
run: |
7776
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
7877
79-
# Pre-seed LLVM into mcpp sandbox from system xlings install
80-
MCPP_XPKGS="$USERPROFILE/.mcpp/registry/data/xpkgs"
81-
LLVM_SRC=$(find "$USERPROFILE/.xlings" -path "*/xim-x-llvm/20.1.7/bin/clang++.exe" 2>/dev/null | head -1)
82-
if [ -n "$LLVM_SRC" ]; then
83-
LLVM_PKG_DIR=$(dirname "$(dirname "$(dirname "$LLVM_SRC")")")
84-
mkdir -p "$MCPP_XPKGS"
85-
[ -d "$MCPP_XPKGS/xim-x-llvm" ] || cp -r "$LLVM_PKG_DIR" "$MCPP_XPKGS/xim-x-llvm"
86-
echo "Pre-seeded LLVM from $LLVM_PKG_DIR"
87-
else
88-
echo "WARNING: LLVM not found after xlings install"
78+
# Install LLVM directly — xlings 0.4.30 has a bug on Windows where
79+
# large package extraction silently fails. Download and extract manually.
80+
LLVM_VER="20.1.7"
81+
LLVM_DEST="$USERPROFILE/.mcpp/registry/data/xpkgs/xim-x-llvm/$LLVM_VER"
82+
if [ ! -f "$LLVM_DEST/bin/clang++.exe" ]; then
83+
LLVM_URL="https://github.com/xlings-res/llvm/releases/download/$LLVM_VER/llvm-$LLVM_VER-windows-x86_64.tar.xz"
84+
echo "Downloading LLVM $LLVM_VER..."
85+
WORK=$(mktemp -d)
86+
curl -fsSL -o "$WORK/llvm.tar.xz" "$LLVM_URL"
87+
mkdir -p "$LLVM_DEST"
88+
tar -xf "$WORK/llvm.tar.xz" -C "$LLVM_DEST" --strip-components=1
89+
rm -rf "$WORK"
90+
echo "LLVM installed: $(ls "$LLVM_DEST/bin/clang++.exe" 2>/dev/null && echo OK || echo FAILED)"
8991
fi
9092
9193
"$MCPP" build

.github/workflows/release.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ jobs:
462462
export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH"
463463
echo "$USERPROFILE/.xlings/subos/default/bin" >> "$GITHUB_PATH"
464464
xlings.exe --version
465-
xlings.exe install llvm -y || xlings.exe install llvm@20.1.7 -y
466465
xlings.exe install mcpp -y
467466
MCPP=$(find "$USERPROFILE/.xlings" -name "mcpp.exe" -path "*/bin/*" 2>/dev/null | head -1)
468467
if [ -z "$MCPP" ]; then
@@ -481,17 +480,16 @@ jobs:
481480
run: |
482481
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
483482
484-
# Pre-seed LLVM into mcpp sandbox from system xlings
485-
MCPP_XPKGS="$USERPROFILE/.mcpp/registry/data/xpkgs"
486-
for src in "$USERPROFILE/.xlings/data/xpkgs/xim-x-llvm" \
487-
"$USERPROFILE/.xlings/subos/default/data/xpkgs/xim-x-llvm"; do
488-
if [ -d "$src" ]; then
489-
mkdir -p "$MCPP_XPKGS"
490-
cp -r "$src" "$MCPP_XPKGS/xim-x-llvm"
491-
echo "Pre-seeded LLVM from $src"
492-
break
493-
fi
494-
done
483+
# Install LLVM directly (xlings 0.4.30 extraction bug on Windows)
484+
LLVM_VER="20.1.7"
485+
LLVM_DEST="$USERPROFILE/.mcpp/registry/data/xpkgs/xim-x-llvm/$LLVM_VER"
486+
if [ ! -f "$LLVM_DEST/bin/clang++.exe" ]; then
487+
curl -fsSL -o /tmp/llvm.tar.xz \
488+
"https://github.com/xlings-res/llvm/releases/download/$LLVM_VER/llvm-$LLVM_VER-windows-x86_64.tar.xz"
489+
mkdir -p "$LLVM_DEST"
490+
tar -xf /tmp/llvm.tar.xz -C "$LLVM_DEST" --strip-components=1
491+
rm -f /tmp/llvm.tar.xz
492+
fi
495493
496494
"$MCPP" build
497495

0 commit comments

Comments
 (0)