Skip to content

Commit ae124da

Browse files
committed
fix: Windows CI xlings install path handling
1 parent e1a2569 commit ae124da

1 file changed

Lines changed: 17 additions & 30 deletions

File tree

.github/workflows/ci-windows.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,48 +41,35 @@ jobs:
4141
XLINGS_NON_INTERACTIVE: '1'
4242
XLINGS_VERSION: '0.4.30'
4343
run: |
44-
# Download xlings for Windows
45-
tarball="xlings-${XLINGS_VERSION}-windows-x86_64.zip"
46-
curl -fsSL -o "/tmp/${tarball}" \
47-
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}" || {
48-
echo "::warning::xlings Windows zip not available, trying tar.gz"
49-
tarball="xlings-${XLINGS_VERSION}-windows-x86_64.tar.gz"
50-
curl -fsSL -o "/tmp/${tarball}" \
51-
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
52-
}
53-
# Extract
54-
cd /tmp
55-
if [[ "$tarball" == *.zip ]]; then
56-
unzip -q "$tarball" || 7z x "$tarball"
57-
else
58-
tar -xzf "$tarball"
59-
fi
60-
# Find and install xlings
61-
XLINGS_DIR=$(find /tmp -maxdepth 2 -name "xlings.exe" -o -name "xlings" | head -1 | xargs dirname)
44+
WORK=$(mktemp -d)
45+
zipfile="xlings-${XLINGS_VERSION}-windows-x86_64.zip"
46+
curl -fsSL -o "${WORK}/${zipfile}" \
47+
"https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${zipfile}"
48+
cd "${WORK}"
49+
unzip -q "${zipfile}"
50+
XLINGS_DIR="${WORK}/xlings-${XLINGS_VERSION}-windows-x86_64"
6251
echo "xlings dir: $XLINGS_DIR"
63-
ls "$XLINGS_DIR/" || true
64-
# Try self install
65-
"$XLINGS_DIR/xlings" self install || "$XLINGS_DIR/xlings.exe" self install || true
66-
echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
67-
echo "$HOME/.xlings/bin" >> "$GITHUB_PATH"
52+
ls "$XLINGS_DIR/bin/"
53+
"$XLINGS_DIR/subos/default/bin/xlings.exe" self install
54+
echo "$USERPROFILE/.xlings/subos/default/bin" >> "$GITHUB_PATH"
55+
echo "$USERPROFILE/.xlings/bin" >> "$GITHUB_PATH"
6856
6957
- name: Verify xlings
7058
shell: bash
7159
run: |
72-
xlings --version || xlings.exe --version || echo "xlings not found in PATH"
73-
which xlings || which xlings.exe || echo "xlings location unknown"
60+
xlings.exe --version || xlings --version || echo "xlings not found in PATH"
7461
7562
- name: Install LLVM via xlings
7663
shell: bash
7764
run: |
78-
xlings install llvm -y || xlings install llvm@20.1.7 -y || {
65+
xlings.exe install llvm -y || xlings.exe install llvm@20.1.7 -y || {
7966
echo "::warning::xlings install llvm failed"
8067
exit 1
8168
}
82-
# Find LLVM
83-
LLVM_ROOT=$(find "$HOME/.xlings" -path "*/xpkgs/xim-x-llvm/*/bin/clang++.exe" 2>/dev/null | head -1 | xargs dirname | xargs dirname)
84-
if [ -z "$LLVM_ROOT" ]; then
85-
LLVM_ROOT=$(find "$HOME/.xlings" -path "*/xpkgs/xim-x-llvm/*/bin/clang.exe" 2>/dev/null | head -1 | xargs dirname | xargs dirname)
69+
# Find LLVM root
70+
LLVM_ROOT=$(find "$USERPROFILE/.xlings" -path "*/xpkgs/xim-x-llvm/*/bin/clang.exe" 2>/dev/null | head -1)
71+
if [ -n "$LLVM_ROOT" ]; then
72+
LLVM_ROOT=$(dirname "$(dirname "$LLVM_ROOT")")
8673
fi
8774
echo "LLVM_ROOT=$LLVM_ROOT"
8875
echo "LLVM_ROOT=$LLVM_ROOT" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)