Clear stale RUSTUP_HOME before installing rustup #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Windows ARM Build | |
| on: | |
| push: | |
| branches: [fix-windows-arm-build] | |
| jobs: | |
| windows-arm: | |
| runs-on: windows-11-arm | |
| steps: | |
| - name: Setup MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: CLANGARM64 | |
| update: true | |
| - name: Set MSYS2 mirror for ARM64 | |
| shell: msys2 {0} | |
| run: | | |
| echo 'Server = https://repo.msys2.org/mingw/$repo/' > /etc/pacman.d/mirrorlist.mingw | |
| - name: Install MSYS2 packages | |
| shell: msys2 {0} | |
| run: | | |
| pacman -S --noconfirm mingw-w64-clang-aarch64-gtk4 mingw-w64-clang-aarch64-gtksourceview5 mingw-w64-clang-aarch64-pkgconf mingw-w64-clang-aarch64-clang | |
| - uses: actions/checkout@v6 | |
| - name: Debug pre-install state | |
| shell: msys2 {0} | |
| run: | | |
| echo "=== pwd ===" | |
| pwd | |
| echo "=== Check for existing .rustup ===" | |
| ls -la .rustup 2>/dev/null || echo "No .rustup in workspace" | |
| echo "=== RUSTUP_HOME env ===" | |
| echo "$RUSTUP_HOME" | |
| echo "=== Check system rustup ===" | |
| which rustup 2>/dev/null || echo "No system rustup" | |
| echo "=== Check HOME ===" | |
| echo "$HOME" | |
| ls -la "$HOME/.rustup" 2>/dev/null || echo "No .rustup in HOME" | |
| - name: Install Rust | |
| shell: msys2 {0} | |
| run: | | |
| export CARGO_HOME="$(pwd)/.cargo" | |
| export RUSTUP_HOME="$(pwd)/.rustup" | |
| rm -rf "$RUSTUP_HOME" | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-host aarch64-pc-windows-gnullvm --default-toolchain stable | |
| export PATH="$(pwd)/.cargo/bin:$PATH" | |
| - name: Configure cargo linker | |
| shell: msys2 {0} | |
| run: | | |
| mkdir -p .cargo | |
| printf '[target.x86_64-pc-windows-gnu]\nlinker = "gcc"\n[target.aarch64-pc-windows-gnullvm]\nlinker = "clang"\n' > .cargo/config.toml | |
| - name: Debug post-install state | |
| shell: msys2 {0} | |
| run: | | |
| export CARGO_HOME="$(pwd)/.cargo" | |
| export RUSTUP_HOME="$(pwd)/.rustup" | |
| export PATH="$(pwd)/.cargo/bin:/$MSYSTEM/bin:/usr/bin" | |
| echo "=== rustc version ===" | |
| rustc -vV | |
| echo "=== rustup show ===" | |
| rustup show | |
| echo "=== settings.toml ===" | |
| cat "$(pwd)/.rustup/settings.toml" 2>/dev/null || echo "No settings.toml" | |
| echo "=== cargo config ===" | |
| cat .cargo/config.toml | |
| - name: Build release binary | |
| shell: msys2 {0} | |
| run: | | |
| export CARGO_HOME="$(pwd)/.cargo" | |
| export RUSTUP_HOME="$(pwd)/.rustup" | |
| export PATH="$(pwd)/.cargo/bin:/$MSYSTEM/bin:/usr/bin" | |
| export PKG_CONFIG_ALLOW_CROSS=1 | |
| cargo build --release --target aarch64-pc-windows-gnullvm |