Skip to content

fix: reject non-launchable wavec paths (#603) #737

fix: reject non-launchable wavec paths (#603)

fix: reject non-launchable wavec paths (#603) #737

Workflow file for this run

name: Wave CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
CARGO_BUILD_JOBS: "2"
LLVM_MINGW_VERSION: "20251216"
LLVM_MINGW_SHA256: "c892f0155c2201c43257b2c5d1e12b899229d8dc957aa3e5937ce00e3ca09e91"
LLVM_WINDOWS_ARM64_VERSION: "21.1.8"
LLVM_WINDOWS_ARM64_SHA256: "f214b1226d8de005b5f691dd29d9dfea2b49e22d0de445429916173dbb626f7f"
LOONGARCH_TOOLCHAIN_VERSION: "2025.08.08"
LOONGARCH_TOOLCHAIN_ARCHIVE: "x86_64-cross-tools-loongarch64-binutils_2.45-gcc_15.1.0-glibc_2.42.tar.xz"
LOONGARCH_TOOLCHAIN_SHA256: "b8572e2083143ff1807658f02e11eba53e5ed81d6194854d369b43fceea72de7"
PYTHONUNBUFFERED: "1"
PYTHONUTF8: "1"
PYTHONIOENCODING: "utf-8"
permissions:
contents: read
concurrency:
group: wave-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux-amd64:
name: Build Linux amd64
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install LLVM 21
run: |
sudo apt-get update
sudo apt-get install -y wget software-properties-common
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get install -y lld-21
echo "LLVM_SYS_211_PREFIX=/usr/lib/llvm-21" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=/usr/lib/llvm-21/bin/llvm-config" >> "$GITHUB_ENV"
echo "/usr/lib/llvm-21/bin" >> "$GITHUB_PATH"
- name: Install Wave stdlib
run: |
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Check Rust formatting
run: cargo fmt --all --check
- name: Check standard library policy
run: ./tools/check_std_policy.sh
- name: Build warning-free Rust documentation
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --locked --no-deps --jobs 2
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/check_wave_corpus.py tools/case_manifest.py tools/populate_case_matrix.py tools/run_tests.py tools/test_contracts.py tools/test_case_manifest.py tools/test_test_contracts.py tools/process_tree.py tools/test_process_tree.py
python3 -m unittest tools.test_case_manifest tools.test_test_contracts tools.test_process_tree
- name: Test Windows ARM64 dependency archive validation
shell: pwsh
run: ./tools/test_windows_arm64_libxml2.ps1
- name: Build release compiler
run: cargo build --locked --release --verbose
- name: Run Rust tests
run: cargo test --locked --workspace --all-targets --verbose
- name: Check examples and standard library corpus
run: >-
python3 tools/check_wave_corpus.py --wavec target/release/wavec
--run-std-examples
- name: Run x86_64 SysV ABI contract tests
if: ${{ always() }}
env:
WAVE_RUN_X86_64_INTEROP_TESTS: "1"
run: >-
cargo test --locked --test codegen_regressions
x86_64_c_abi_interoperates_with_c --verbose
build-wasm:
name: Build WebAssembly
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
- name: Install LLVM 21 and WebAssembly linker
run: |
sudo apt-get update
sudo apt-get install -y wget software-properties-common
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get install -y lld-21
echo "LLVM_SYS_211_PREFIX=/usr/lib/llvm-21" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=/usr/lib/llvm-21/bin/llvm-config" >> "$GITHUB_ENV"
echo "/usr/lib/llvm-21/bin" >> "$GITHUB_PATH"
- name: Install Wave stdlib
run: |
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Verify WebAssembly tools
run: |
set -euo pipefail
llvm-config --version
wasm-ld --version
llvm-readobj --version
node --version
- name: Build compiler with the WebAssembly backend only
run: >-
cargo build --locked --release --no-default-features
--features llvm-target-wasm --jobs 2
- name: Run WebAssembly compiler regressions
run: >-
cargo test --locked --no-default-features
--features llvm-target-wasm --test codegen_regressions
webassembly_ --jobs 2 --verbose
- name: Build and run browser and WASI modules
run: |
set -euo pipefail
output_dir="$RUNNER_TEMP/wave-wasm32"
target/release/wavec build examples/wasm_module.wave \
--target wasm32-unknown-unknown \
--out-dir "$output_dir"
llvm-readobj --file-headers "$output_dir/wasm_module.wasm" \
| grep -F 'Format: WASM'
node tools/run_wasm_smoke.mjs "$output_dir/wasm_module.wasm"
target/release/wavec run examples/wasm_run.wave \
--target wasm32-unknown-unknown
target/release/wavec build examples/wasm_wasi.wave \
--target wasm32-wasip1 \
--out-dir "$output_dir"
llvm-readobj --file-headers "$output_dir/wasm_wasi.wasm" \
| grep -F 'Format: WASM'
node --no-warnings tools/run_wasi_smoke.mjs \
"$output_dir/wasm_wasi.wasm" "$GITHUB_WORKSPACE"
target/release/wavec run examples/wasm_wasi.wave \
--target wasm32-wasip1
build-linux-arm64:
name: Build Linux arm64
runs-on: ubuntu-24.04-arm
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install LLVM 21
run: |
sudo apt-get update
sudo apt-get install -y wget software-properties-common
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
echo "LLVM_SYS_211_PREFIX=/usr/lib/llvm-21" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=/usr/lib/llvm-21/bin/llvm-config" >> "$GITHUB_ENV"
echo "/usr/lib/llvm-21/bin" >> "$GITHUB_PATH"
- name: Install Wave stdlib
run: |
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Check Rust formatting
run: cargo fmt --all --check
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/check_wave_corpus.py tools/case_manifest.py tools/populate_case_matrix.py tools/run_tests.py tools/test_contracts.py tools/test_case_manifest.py tools/test_test_contracts.py tools/process_tree.py tools/test_process_tree.py
python3 -m unittest tools.test_case_manifest tools.test_test_contracts tools.test_process_tree
- name: Build release compiler
run: cargo build --locked --release --verbose
- name: Check and run standard library examples
run: >-
python3 tools/check_wave_corpus.py --wavec target/release/wavec
--run-std-examples
- name: Run Rust tests
run: cargo test --locked --all-targets --verbose
- name: Run AArch64 AAPCS64 contract tests
if: ${{ always() }}
env:
WAVE_RUN_AARCH64_INTEROP_TESTS: "1"
run: >-
cargo test --locked --test codegen_regressions
aarch64_c_abi_interoperates_with_c --verbose
build-linux-riscv64:
name: Build Linux riscv64
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install LLVM 21 and RISC-V runtime tools
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y wget software-properties-common
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get install -y \
binutils-riscv64-linux-gnu \
gcc-riscv64-linux-gnu \
libc6-dev-riscv64-cross \
lld-21 \
qemu-user
echo "LLVM_SYS_211_PREFIX=/usr/lib/llvm-21" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=/usr/lib/llvm-21/bin/llvm-config" >> "$GITHUB_ENV"
echo "/usr/lib/llvm-21/bin" >> "$GITHUB_PATH"
- name: Verify RISC-V toolchain
run: |
set -euo pipefail
llvm-config --version
ld.lld --version
riscv64-linux-gnu-gcc --version
riscv64-linux-gnu-readelf --version
qemu-riscv64 --version
- name: Install Wave stdlib
run: |
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Check Rust formatting
run: cargo fmt --all --check
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/check_wave_corpus.py tools/case_manifest.py tools/populate_case_matrix.py tools/run_tests.py tools/test_contracts.py tools/test_case_manifest.py tools/test_test_contracts.py tools/process_tree.py tools/test_process_tree.py
python3 -m unittest tools.test_case_manifest tools.test_test_contracts tools.test_process_tree
- name: Build release compiler
run: cargo build --locked --release --verbose
- name: Run Rust tests
run: cargo test --locked --all-targets --verbose
- name: Build with the RISC-V-only LLVM feature
run: >-
cargo build --locked --no-default-features
--features llvm-target-riscv --jobs 2
- name: Build with the LoongArch-only LLVM feature
run: >-
cargo build --locked --no-default-features
--features llvm-target-loongarch --jobs 2
- name: Build with the x86-only LLVM feature
run: >-
cargo build --locked --no-default-features
--features llvm-target-x86 --jobs 2
- name: Build with the AArch64-only LLVM feature
run: >-
cargo build --locked --no-default-features
--features llvm-target-aarch64 --jobs 2
- name: Run Rust tests with the core 64-bit LLVM feature set
run: >-
cargo test --locked --all-targets --no-default-features
--features llvm-target-core64 --jobs 2
- name: Verify bundled Linux CRT matrix
if: ${{ always() }}
run: |
set -euo pipefail
crt_root="$(find target/release/build -type d -path '*/out/crt' -print -quit)"
test -n "$crt_root"
for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do
for crt_name in crt1.o Scrt1.o rcrt1.o crti.o crtn.o; do
test -f "$crt_root/$target/$crt_name"
done
done
for abi in lp64 lp64f lp64d; do
for crt_name in crt1.o Scrt1.o rcrt1.o crti.o crtn.o; do
crt_path="$crt_root/riscv64-unknown-linux-gnu/$abi/$crt_name"
test -f "$crt_path"
llvm-readelf -h "$crt_path" | grep -Eq 'Machine:[[:space:]]+RISC-V'
done
done
llvm-readelf -h "$crt_root/riscv64-unknown-linux-gnu/lp64/crt1.o" \
| grep -Eq 'Flags:[[:space:]]+0x1.*RVC'
llvm-readelf -h "$crt_root/riscv64-unknown-linux-gnu/lp64f/crt1.o" \
| grep -Eq 'Flags:[[:space:]]+0x3.*single-float ABI'
llvm-readelf -h "$crt_root/riscv64-unknown-linux-gnu/lp64d/crt1.o" \
| grep -Eq 'Flags:[[:space:]]+0x5.*double-float ABI'
- name: Run RISC-V contract tests
if: ${{ always() }}
env:
WAVE_RUN_RISCV64_INTEROP_TESTS: "1"
run: >-
cargo test --locked --test codegen_regressions riscv64_ --verbose
- name: Run shared language workloads under AArch64 QEMU
env:
WAVE_RUN_AARCH64_INTEROP_TESTS: "1"
run: >-
cargo test --locked --test codegen_regressions
aarch64_shared_language_workloads_run_under_qemu --jobs 2
- name: Run RISC-V networking contracts under QEMU
if: ${{ always() }}
run: |
set -euo pipefail
riscv_sysroot="$(target/release/wavec print sysroot \
--target riscv64-unknown-linux-gnu)"
test -d "$riscv_sysroot"
for source in \
examples/std/net_tcp.wave \
examples/std/net_udp.wave \
examples/std/net_ipv6.wave \
examples/std/net_dns.wave \
examples/std/net_interfaces.wave \
examples/std/net_unix.wave \
examples/std/net_vectored.wave \
examples/std/net_event.wave; do
case_name="$(basename "$source" .wave)"
output_dir="$RUNNER_TEMP/wave-linux-riscv64-net/$case_name"
mkdir -p "$output_dir"
target/release/wavec build "$source" \
--target riscv64-unknown-linux-gnu \
--out-dir "$output_dir"
timeout --signal=TERM --kill-after=5s 30s \
qemu-riscv64 -L "$riscv_sysroot" "$output_dir/$case_name"
done
build-linux-loongarch64:
name: Build Linux loong64
runs-on: ubuntu-24.04
timeout-minutes: 50
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install LLVM 21, LLD, and QEMU
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y wget curl xz-utils software-properties-common qemu-user
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get install -y lld-21
echo "LLVM_SYS_211_PREFIX=/usr/lib/llvm-21" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=/usr/lib/llvm-21/bin/llvm-config" >> "$GITHUB_ENV"
echo "/usr/lib/llvm-21/bin" >> "$GITHUB_PATH"
- name: Install pinned official LoongArch64 toolchain
run: |
set -euo pipefail
archive="$RUNNER_TEMP/$LOONGARCH_TOOLCHAIN_ARCHIVE"
url="https://github.com/loongson/build-tools/releases/download/$LOONGARCH_TOOLCHAIN_VERSION/$LOONGARCH_TOOLCHAIN_ARCHIVE"
curl -L --fail --retry 3 "$url" -o "$archive"
echo "$LOONGARCH_TOOLCHAIN_SHA256 $archive" | sha256sum -c -
install_root="$RUNNER_TEMP/wave-loongarch64-toolchain"
mkdir -p "$install_root"
tar -xf "$archive" -C "$install_root"
toolchain="$install_root/cross-tools"
test -x "$toolchain/bin/loongarch64-unknown-linux-gnu-gcc"
echo "$toolchain/bin" >> "$GITHUB_PATH"
echo "WAVE_LOONGARCH64_SYSROOT=$toolchain/target" >> "$GITHUB_ENV"
- name: Install Wave stdlib
run: |
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Build release compiler
run: cargo build --locked --release --jobs 2
- name: Run LoongArch-only LLVM regression tests
env:
WAVE_RUN_LOONGARCH64_INTEROP_TESTS: "1"
run: >-
cargo test --locked --no-default-features
--features llvm-target-loongarch --test codegen_regressions
loongarch64_ --jobs 2
- name: Verify LoongArch64 CRT and target contracts
env:
WAVE_RUN_LOONGARCH64_INTEROP_TESTS: "1"
run: |
set -euo pipefail
crt_root="$(find target/release/build -type d -path '*/out/crt' -print -quit)"
test -n "$crt_root"
for abi_flag in 'lp64s:0x41' 'lp64f:0x42' 'lp64d:0x43'; do
abi="${abi_flag%%:*}"
flag="${abi_flag##*:}"
for crt_name in crt1.o Scrt1.o rcrt1.o crti.o crtn.o; do
crt_path="$crt_root/loongarch64-unknown-linux-gnu/$abi/$crt_name"
test -f "$crt_path"
llvm-readelf -h "$crt_path" | grep -Eq 'Machine:[[:space:]]+LoongArch'
llvm-readelf -h "$crt_path" | grep -Eq "Flags:[[:space:]]+$flag"
done
done
cargo test --locked --test codegen_regressions loongarch64 --jobs 2 -- --nocapture
- name: Link and run Linux LoongArch64 smoke case
run: |
set -euo pipefail
sysroot="$(target/release/wavec print sysroot \
--target loongarch64-unknown-linux-gnu)"
test "$sysroot" = "$WAVE_LOONGARCH64_SYSROOT"
smoke_case="$(python3 tools/case_manifest.py field linux-loong64 smoke_case)"
smoke_stdout="$(python3 tools/case_manifest.py field linux-loong64 smoke_stdout)"
output="$(target/release/wavec run "tests/cases/$smoke_case" \
--target loongarch64-unknown-linux-gnu)"
printf '%s\n' "$output"
test "$output" = "$smoke_stdout"
- name: Run LoongArch64 standard-library smoke set
run: |
set -euo pipefail
cd "$RUNNER_TEMP"
for name in \
memory \
time \
environment \
filesystem \
io \
buffers \
datetime_roundtrip \
process; do
timeout --signal=TERM --kill-after=5s 30s \
"$GITHUB_WORKSPACE/target/release/wavec" run \
"$GITHUB_WORKSPACE/examples/std/$name.wave" \
--target loongarch64-unknown-linux-gnu
done
build-macos-arm64:
name: Build macOS arm64
runs-on: macos-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install LLVM 21 and LLD
run: |
brew install llvm@21 lld
- name: Set LLVM env
run: |
LLVM_PREFIX="$(brew --prefix llvm@21)"
LLD_PREFIX="$(brew --prefix lld)"
echo "LLVM_SYS_211_PREFIX=$LLVM_PREFIX" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=$LLVM_PREFIX/bin/llvm-config" >> "$GITHUB_ENV"
echo "$LLVM_PREFIX/bin" >> "$GITHUB_PATH"
echo "$LLD_PREFIX/bin" >> "$GITHUB_PATH"
echo "WAVE_LD64_LLD=$LLD_PREFIX/bin/ld64.lld" >> "$GITHUB_ENV"
- name: Verify LLVM tools
run: |
llvm-config --version
command -v ld64.lld
ld64.lld --version || true
- name: Install Wave stdlib
run: |
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Check Rust formatting
run: cargo fmt --all --check
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/check_wave_corpus.py tools/case_manifest.py tools/populate_case_matrix.py tools/run_tests.py tools/test_contracts.py tools/test_case_manifest.py tools/test_test_contracts.py tools/process_tree.py tools/test_process_tree.py
python3 -m unittest tools.test_case_manifest tools.test_test_contracts tools.test_process_tree
- name: Build release compiler
run: cargo build --locked --release --verbose
- name: Check and run standard library examples
run: >-
python3 tools/check_wave_corpus.py --wavec target/release/wavec
--run-std-examples
- name: Run Rust tests
run: cargo test --locked --all-targets --verbose
build-macos-amd64:
name: Build macOS amd64
runs-on: macos-15-intel
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install LLVM 21 and LLD
run: |
brew install llvm@21 lld
- name: Set LLVM env
run: |
LLVM_PREFIX="$(brew --prefix llvm@21)"
LLD_PREFIX="$(brew --prefix lld)"
echo "LLVM_SYS_211_PREFIX=$LLVM_PREFIX" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=$LLVM_PREFIX/bin/llvm-config" >> "$GITHUB_ENV"
echo "$LLVM_PREFIX/bin" >> "$GITHUB_PATH"
echo "$LLD_PREFIX/bin" >> "$GITHUB_PATH"
echo "WAVE_LD64_LLD=$LLD_PREFIX/bin/ld64.lld" >> "$GITHUB_ENV"
- name: Verify LLVM tools
run: |
llvm-config --version
command -v ld64.lld
ld64.lld --version || true
- name: Install Wave stdlib
run: |
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Check Rust formatting
run: cargo fmt --all --check
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/check_wave_corpus.py tools/case_manifest.py tools/populate_case_matrix.py tools/run_tests.py tools/test_contracts.py tools/test_case_manifest.py tools/test_test_contracts.py tools/process_tree.py tools/test_process_tree.py
python3 -m unittest tools.test_case_manifest tools.test_test_contracts tools.test_process_tree
- name: Build release compiler
run: cargo build --locked --release --verbose
- name: Check and run standard library examples
run: >-
python3 tools/check_wave_corpus.py --wavec target/release/wavec
--run-std-examples
- name: Run Rust tests
run: cargo test --locked --all-targets --verbose
build-windows-amd64:
name: Build Windows GNU amd64
runs-on: windows-latest
timeout-minutes: 60
# The pinned MINGW64 LLVM 21 package omits WebAssembly and LoongArch target
# libraries. Dedicated Linux jobs validate those backends with complete LLVM.
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
path-type: inherit
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-python
mingw-w64-x86_64-libffi
mingw-w64-x86_64-zstd
mingw-w64-x86_64-zlib
- name: Install pinned LLVM 21 and LLD packages
shell: msys2 {0}
run: |
set -euo pipefail
pacman --noconfirm -U \
https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-llvm-21-21.1.8-5-any.pkg.tar.zst \
https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-lld-21-21.1.8-5-any.pkg.tar.zst
- name: Install Rust GNU toolchain
shell: msys2 {0}
run: |
set -euo pipefail
rustup toolchain install 1.89.0-x86_64-pc-windows-gnu --profile minimal --force-non-host
rustup target add x86_64-pc-windows-gnu --toolchain 1.89.0-x86_64-pc-windows-gnu
rustup component add rustfmt clippy --toolchain 1.89.0-x86_64-pc-windows-gnu
rustup default 1.89.0-x86_64-pc-windows-gnu
- name: Configure Windows LLVM and MinGW runtime
shell: msys2 {0}
run: |
set -euo pipefail
llvm_root="$(cygpath -w /mingw64/opt/llvm-21)"
llvm_bin="$(cygpath -w /mingw64/opt/llvm-21/bin)"
llvm_config="$(cygpath -w /mingw64/opt/llvm-21/bin/llvm-config.exe)"
mingw_bin="$(cygpath -w /mingw64/bin)"
mingw_lib="$(cygpath -w /mingw64/lib)"
mingw_pkgconfig="$(cygpath -w /mingw64/lib/pkgconfig)"
rust_sysroot="$(rustc --print sysroot)"
rust_target_lib="$rust_sysroot/lib/rustlib/x86_64-pc-windows-gnu/lib"
crt2_path="$(find "$rust_target_lib" -name crt2.o -print -quit || true)"
if [[ -z "$crt2_path" ]]; then
echo "Could not find crt2.o under Rust target lib: $rust_target_lib" >&2
find "$rust_target_lib" -maxdepth 4 -type f | sort | head -200 >&2 || true
exit 1
fi
rust_mingw_self="$(dirname "$crt2_path")"
echo "WAVE_LLVM_HOME=$llvm_root" >> "$GITHUB_ENV"
echo "WAVE_WINDOWS_LLVM_BIN=$llvm_bin" >> "$GITHUB_ENV"
echo "LLVM_SYS_211_PREFIX=$llvm_root" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=$llvm_config" >> "$GITHUB_ENV"
echo "WAVE_WINDOWS_MINGW_LIB=$(cygpath -w "$rust_mingw_self")" >> "$GITHUB_ENV"
echo "$llvm_bin" >> "$GITHUB_PATH"
echo "$mingw_bin" >> "$GITHUB_PATH"
echo "$(cygpath -w /usr/bin)" >> "$GITHUB_PATH"
echo "LIBRARY_PATH=$mingw_lib" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=$mingw_pkgconfig" >> "$GITHUB_ENV"
echo "RUSTFLAGS=-Lnative=$mingw_lib -lffi -lzstd -lz" >> "$GITHUB_ENV"
- name: Verify Windows toolchain
shell: msys2 {0}
run: |
set -euo pipefail
rustc --version
cargo --version
llvm-config --version
which gcc
which ld.lld || true
test -f "$(cygpath -u "$WAVE_WINDOWS_MINGW_LIB")/crt2.o"
- name: Install Wave stdlib
shell: msys2 {0}
run: |
set -euo pipefail
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Check Rust formatting
shell: msys2 {0}
run: cargo fmt --all --check
- name: Run Clippy
shell: msys2 {0}
run: >-
cargo clippy --locked --all-targets --no-default-features
--features llvm-target-core64 -- -D warnings
- name: Validate Python tooling
shell: msys2 {0}
env:
PYTHONUTF8: "1"
PYTHONIOENCODING: "utf-8"
run: |
python -m py_compile x.py tools/check_wave_corpus.py tools/case_manifest.py tools/populate_case_matrix.py tools/run_tests.py tools/test_contracts.py tools/test_case_manifest.py tools/test_test_contracts.py tools/process_tree.py tools/test_process_tree.py
python -m unittest tools.test_case_manifest tools.test_test_contracts tools.test_process_tree
- name: Build release compiler
shell: msys2 {0}
run: >-
cargo build --locked --release --no-default-features
--features llvm-target-core64 --verbose
- name: Check and run standard library examples
shell: msys2 {0}
run: >-
python tools/check_wave_corpus.py --wavec target/release/wavec.exe
--run-std-examples
- name: Run Rust tests
shell: msys2 {0}
run: >-
cargo test --locked --all-targets --no-default-features
--features llvm-target-core64 --verbose
validate-windows-arm64:
name: Validate Windows GNU arm64 target
runs-on: ubuntu-24.04
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
- name: Install LLVM 21 and LLD
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y wget software-properties-common
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get install -y lld-21
echo "LLVM_SYS_211_PREFIX=/usr/lib/llvm-21" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=/usr/lib/llvm-21/bin/llvm-config" >> "$GITHUB_ENV"
echo "/usr/lib/llvm-21/bin" >> "$GITHUB_PATH"
- name: Install pinned LLVM 21 MinGW cross toolchain
run: |
set -euo pipefail
archive="$RUNNER_TEMP/llvm-mingw.tar.xz"
toolchain="$RUNNER_TEMP/llvm-mingw"
url="https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_VERSION}/llvm-mingw-${LLVM_MINGW_VERSION}-msvcrt-ubuntu-22.04-x86_64.tar.xz"
curl --fail --location --retry 3 "$url" --output "$archive"
echo "${LLVM_MINGW_SHA256} $archive" | sha256sum --check
mkdir -p "$toolchain"
tar -xJf "$archive" --strip-components=1 -C "$toolchain"
test -x "$toolchain/bin/aarch64-w64-mingw32-gcc"
echo "$toolchain/bin" >> "$GITHUB_PATH"
echo "WAVE_WINDOWS_ARM64_LINKER=$toolchain/bin/aarch64-w64-mingw32-gcc" >> "$GITHUB_ENV"
- name: Install Wave stdlib
run: |
mkdir -p "$HOME/.wave/lib/wave"
rm -rf "$HOME/.wave/lib/wave/std"
cp -R std "$HOME/.wave/lib/wave/std"
- name: Build release compiler
run: cargo build --locked --release --jobs 2
- name: Build with the AArch64-only LLVM feature
run: >-
cargo build --locked --no-default-features
--features llvm-target-aarch64 --jobs 2
- name: Validate Windows ARM64 target and C ABI contracts
run: >-
cargo test --locked --test codegen_regressions
windows_system_abi_is_target_scoped --jobs 2 -- --nocapture
- name: Link Windows ARM64 PE/COFF fixture
env:
WAVE_RUN_WINDOWS_ARM64_INTEROP_TESTS: "1"
run: >-
cargo test --locked --test codegen_regressions
windows_arm64_c_abi_links_with_mingw --jobs 2 -- --nocapture
build-windows-arm64:
name: Build Windows ARM64 natively
runs-on: windows-11-vs2026-arm
timeout-minutes: 90
env:
CARGO_PROFILE_RELEASE_DEBUG: "1"
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
components: rustfmt, clippy
# The pinned ARM64 LLDB links against Python 3.11.
- uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: "arm64"
- name: Install pinned native LLVM 21
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$archive = Join-Path $env:RUNNER_TEMP "llvm-arm64.tar.xz"
$directory = Join-Path $env:RUNNER_TEMP "llvm-arm64"
$url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$env:LLVM_WINDOWS_ARM64_VERSION/clang%2Bllvm-$env:LLVM_WINDOWS_ARM64_VERSION-aarch64-pc-windows-msvc.tar.xz"
curl.exe --fail --location --retry 3 $url --output $archive
if ((Get-FileHash $archive -Algorithm SHA256).Hash.ToLowerInvariant() -ne $env:LLVM_WINDOWS_ARM64_SHA256) {
throw "LLVM ARM64 archive checksum mismatch"
}
New-Item -ItemType Directory -Force -Path $directory | Out-Null
tar.exe -xJf $archive --strip-components=1 -C $directory
@(
"WAVE_LLVM_HOME=$directory"
"WAVE_WINDOWS_LLVM_BIN=$directory\bin"
"LLVM_SYS_211_PREFIX=$directory"
"LLVM_CONFIG_PATH=$directory\bin\llvm-config.exe"
) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"$directory\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Provision pinned ARM64 libxml2 for LLVM
shell: pwsh
run: ./tools/provision_windows_arm64_libxml2.ps1
- name: Verify native toolchain
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
if ($env:PROCESSOR_ARCHITECTURE -ne "ARM64") { throw "Expected an ARM64 runner" }
if ((rustc -vV | Select-String '^host: ').Line -ne "host: aarch64-pc-windows-msvc") {
throw "Rust is not using the native Windows ARM64 host toolchain"
}
& "$env:LLVM_CONFIG_PATH" --version
- name: Check formatting
run: cargo fmt --all --check
- name: Run Clippy for the ARM64 compiler
run: >-
cargo clippy --locked --target aarch64-pc-windows-msvc
--all-targets --no-default-features --features llvm-target-aarch64
--jobs 2 -- -D warnings
- name: Build native ARM64 compiler
run: >-
cargo build --locked --release --target aarch64-pc-windows-msvc
--no-default-features --features llvm-target-aarch64 --jobs 2
- name: Diagnose native ARM64 code generation
id: native_codegen
timeout-minutes: 10
run: >-
python tools/diagnose_windows_arm64.py
--wavec target/aarch64-pc-windows-msvc/release/wavec.exe
--llvm-bin "$env:WAVE_WINDOWS_LLVM_BIN"
--output "$env:RUNNER_TEMP/wave-arm64-diagnostics"
- name: Save native ARM64 crash diagnostics
if: ${{ failure() && steps.native_codegen.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: windows-arm64-codegen-diagnostics
path: |
${{ runner.temp }}/wave-arm64-diagnostics/
target/aarch64-pc-windows-msvc/release/wavec.exe
target/aarch64-pc-windows-msvc/release/wavec.pdb
retention-days: 7
- name: Check native Windows process supervision
run: python -m unittest tools.test_process_tree
- name: Run native ARM64 unit and frontend driver tests
run: >-
cargo test --locked --lib --test frontend_regressions --target aarch64-pc-windows-msvc
--no-default-features --features llvm-target-aarch64 --jobs 2
- name: Check native MSVC companion artifact publication
run: >-
cargo test --locked --test codegen_regressions --target aarch64-pc-windows-msvc
--no-default-features --features llvm-target-aarch64 --jobs 2
msvc_link_companions_keep_final_names_and_survive_failed_replacement
- name: Install Wave stdlib
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$libraryRoot = Join-Path $HOME ".wave\lib\wave"
New-Item -ItemType Directory -Force -Path $libraryRoot | Out-Null
Copy-Item -Path std -Destination (Join-Path $libraryRoot "std") -Recurse
- name: Validate native compiler and default target
shell: pwsh
env:
WAVE_CODEGEN_TRACE: "1"
run: |
$ErrorActionPreference = "Stop"
$compiler = "target\aarch64-pc-windows-msvc\release\wavec.exe"
$bytes = [System.IO.File]::ReadAllBytes($compiler)
$peOffset = [BitConverter]::ToInt32($bytes, 0x3c)
if ([BitConverter]::ToUInt16($bytes, $peOffset + 4) -ne 0xaa64) {
throw "wavec.exe is not an ARM64 PE image"
}
& $compiler -V
if ($LASTEXITCODE -ne 0) { throw "Compiler version probe failed: $LASTEXITCODE" }
$defaultTarget = & $compiler print default-target
if ($LASTEXITCODE -ne 0) { throw "Default target probe failed: $LASTEXITCODE" }
if ($defaultTarget -ne "aarch64-pc-windows-gnu") {
throw "Unexpected native Windows ARM64 default target"
}
$output = Join-Path $env:RUNNER_TEMP "wave-arm64-object"
& $compiler build tests/cases/windows/arm64/test1.wave `
--target=aarch64-pc-windows-gnu --emit=obj --out-dir $output
if ($LASTEXITCODE -ne 0) { throw "GNU object compilation failed: $LASTEXITCODE" }
$object = [System.IO.File]::ReadAllBytes((Join-Path $output "test1.o"))
if ([BitConverter]::ToUInt16($object, 0) -ne 0xaa64) {
throw "Wave did not emit an ARM64 COFF object"
}
- name: Validate explicit native ARM64 MSVC object output
shell: pwsh
env:
WAVE_CODEGEN_TRACE: "1"
run: |
$ErrorActionPreference = "Stop"
$compiler = "target\aarch64-pc-windows-msvc\release\wavec.exe"
$output = Join-Path $env:RUNNER_TEMP "wave-arm64-msvc-object"
& $compiler build tests/cases/windows/arm64/test1.wave `
--target=aarch64-pc-windows-msvc --emit=obj --out-dir $output
if ($LASTEXITCODE -ne 0) { throw "MSVC object compilation failed" }
$object = [System.IO.File]::ReadAllBytes((Join-Path $output "test1.o"))
if ([BitConverter]::ToUInt16($object, 0) -ne 0xaa64) {
throw "MSVC target did not emit an ARM64 COFF object"
}