Skip to content

Commit 2b08c7a

Browse files
committed
fix: use system xlings with XLINGS_HOME to install LLVM into mcpp sandbox
1 parent f74a693 commit 2b08c7a

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +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-
# Install LLVM first via system xlings — mcpp's sandboxed xlings
60-
# has an upstream bug where large package extraction fails on Windows.
61-
# See: https://github.com/mcpp-community/mcpp/pull/53
62-
xlings.exe install llvm -y || xlings.exe install llvm@20.1.7 -y
6359
xlings.exe install mcpp -y
6460
echo "=== Searching for mcpp binary ==="
6561
find "$USERPROFILE/.xlings" -name "mcpp.exe" -o -name "mcpp" 2>/dev/null | head -10
@@ -79,19 +75,21 @@ jobs:
7975
run: |
8076
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
8177
82-
# Find where xlings installed LLVM and pre-seed into mcpp sandbox
83-
MCPP_XPKGS="$USERPROFILE/.mcpp/registry/data/xpkgs"
84-
LLVM_SRC=$(find "$USERPROFILE/.xlings" -path "*/xim-x-llvm/20.1.7/bin/clang++.exe" 2>/dev/null | head -1)
85-
if [ -n "$LLVM_SRC" ]; then
86-
# Go up from bin/clang++.exe -> 20.1.7 -> xim-x-llvm
87-
LLVM_VER_DIR=$(dirname "$(dirname "$LLVM_SRC")")
88-
LLVM_PKG_DIR=$(dirname "$LLVM_VER_DIR")
89-
mkdir -p "$MCPP_XPKGS"
90-
cp -r "$LLVM_PKG_DIR" "$MCPP_XPKGS/xim-x-llvm"
91-
echo "Pre-seeded LLVM from $LLVM_PKG_DIR"
92-
else
93-
echo "WARNING: LLVM not found in xlings after install"
94-
find "$USERPROFILE/.xlings" -name "clang++.exe" 2>/dev/null | head -5
78+
# Install LLVM directly into mcpp sandbox via xlings.
79+
# xlings sandboxed install has issues with large packages on Windows,
80+
# so we use the system xlings binary with XLINGS_HOME pointed at
81+
# the mcpp sandbox to ensure LLVM lands in the right place.
82+
XLINGS_SYS="$USERPROFILE/.xlings/subos/default/bin/xlings.exe"
83+
MCPP_REGISTRY="$USERPROFILE/.mcpp/registry"
84+
export XLINGS_HOME="$MCPP_REGISTRY"
85+
"$XLINGS_SYS" install llvm -y || "$XLINGS_SYS" install llvm@20.1.7 -y
86+
unset XLINGS_HOME
87+
88+
# Verify LLVM is in the mcpp sandbox
89+
LLVM_CHECK="$MCPP_REGISTRY/data/xpkgs/xim-x-llvm"
90+
if [ ! -d "$LLVM_CHECK" ]; then
91+
echo "LLVM not in sandbox, searching..."
92+
find "$USERPROFILE" -path "*/xim-x-llvm/20.1.7/bin/clang++.exe" 2>/dev/null | head -3
9593
fi
9694
9795
"$MCPP" build

0 commit comments

Comments
 (0)