Skip to content

Commit 40738ab

Browse files
committed
fix: pre-seed mcpp sandbox with global xlings LLVM via junction
xlings install into the mcpp sandbox creates an empty stub for LLVM (since it's already installed globally). Use a Windows directory junction to link the mcpp sandbox's xim-x-llvm to the global one, avoiding a redundant download and the empty-dir problem.
1 parent 13be30b commit 40738ab

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,23 @@ jobs:
260260
# Debug: test xlings directly
261261
"$USERPROFILE/.xlings/subos/default/bin/xlings.exe" --version || echo "xlings direct call failed"
262262
263-
# Debug: check what's in the mcpp sandbox after xlings installs
264-
"$MCPP_EXE" build || {
265-
echo "=== mcpp build failed, debugging ==="
266-
echo "=== mcpp sandbox contents ==="
267-
find "$USERPROFILE/.mcpp/registry/data/xpkgs" -name "*.exe" 2>/dev/null | head -20
268-
echo "=== LLVM bin dir ==="
269-
ls "$USERPROFILE/.mcpp/registry/data/xpkgs/xim-x-llvm/20.1.7/bin/" 2>/dev/null || echo "dir not found"
270-
ls "$USERPROFILE/.mcpp/registry/data/xpkgs/xim-x-llvm/" 2>/dev/null || echo "llvm dir not found"
271-
exit 1
272-
}
263+
# Pre-seed the mcpp sandbox with the already-installed LLVM from
264+
# the global xlings. xlings won't re-download if the package dir
265+
# exists, but it may create an empty stub. Symlinking avoids
266+
# a redundant ~500MB download.
267+
MCPP_XPKGS="$USERPROFILE/.mcpp/registry/data/xpkgs"
268+
XLINGS_XPKGS="$USERPROFILE/.xlings/data/xpkgs"
269+
if [ -d "$XLINGS_XPKGS/xim-x-llvm" ]; then
270+
mkdir -p "$MCPP_XPKGS"
271+
# Remove empty stub if mcpp's xlings created one
272+
rm -rf "$MCPP_XPKGS/xim-x-llvm"
273+
# Use junction (Windows symlink for directories)
274+
cmd.exe //c "mklink /J \"$(cygpath -w "$MCPP_XPKGS/xim-x-llvm")\" \"$(cygpath -w "$XLINGS_XPKGS/xim-x-llvm")\""
275+
echo "Linked LLVM xpkg from global xlings"
276+
ls "$MCPP_XPKGS/xim-x-llvm/20.1.7/bin/" | head -5
277+
fi
278+
279+
"$MCPP_EXE" build
273280
274281
# Find the self-hosted binary
275282
SELF_MCPP=$(find target -name "mcpp.exe" -path "*/bin/*" | head -1)

0 commit comments

Comments
 (0)