Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 125 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,20 @@ jobs:
- name: Check formatting
run: cargo fmt --all --check

- name: Check standard library policy
run: ./tools/check_std_policy.sh

- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings

- name: Build warning-free Rust documentation
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --locked --no-deps --jobs 2

- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m py_compile x.py tools/check_wave_corpus.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m unittest tools.test_test_contracts

- name: Run Rust tests
Expand All @@ -175,12 +183,123 @@ jobs:
set -euo pipefail
target/release/wavec -V

- name: Check examples and standard library corpus
run: python3 tools/check_wave_corpus.py --wavec target/release/wavec

- name: Run Wave end-to-end tests
run: python3 tools/run_tests.py
run: python3 tools/run_tests.py --report-json wave-e2e-report.json

- name: Upload Wave end-to-end report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: release-validation-e2e
path: wave-e2e-report.json
if-no-files-found: warn
retention-days: 7

validate-riscv64:
name: Validate Linux RISC-V 64 release path
needs: validate
runs-on: ubuntu-24.04
timeout-minutes: 60

steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@1.89.0

- name: Install LLVM 21 and RISC-V runtime tools
shell: bash
run: |
set -euo pipefail

sudo apt-get update
sudo apt-get install -y wget software-properties-common
wget -q https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh "$LLVM_VERSION"
sudo apt-get install -y \
binutils-riscv64-linux-gnu \
gcc-riscv64-linux-gnu \
libc6-dev-riscv64-cross \
lld-"$LLVM_VERSION" \
qemu-user

echo "LLVM_SYS_211_PREFIX=$LLVM_PREFIX_LINUX" >> "$GITHUB_ENV"
echo "LLVM_CONFIG_PATH=$LLVM_PREFIX_LINUX/bin/llvm-config" >> "$GITHUB_ENV"
echo "$LLVM_PREFIX_LINUX/bin" >> "$GITHUB_PATH"

- name: Verify RISC-V toolchain
shell: bash
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
shell: bash
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: Build release compiler
run: cargo build --locked --release --jobs 2

- name: Build RISC-V-only LLVM feature set
run: >-
cargo build --locked --no-default-features
--features llvm-target-riscv --jobs 2

- name: Build core 64-bit LLVM feature set
run: >-
cargo build --locked --no-default-features
--features llvm-target-core64 --jobs 2

- name: Run RISC-V contract tests
env:
WAVE_RUN_RISCV64_INTEROP_TESTS: "1"
run: >-
cargo test --locked --test codegen_regressions
riscv64_ --jobs 2 --verbose

- name: Link and run Linux riscv64 Hello World
shell: bash
run: |
set -euo pipefail

riscv_sysroot=/usr/riscv64-linux-gnu
output_dir="$RUNNER_TEMP/wave-linux-riscv64"
binary="$output_dir/test2"
mkdir -p "$output_dir"

target/release/wavec build tests/cases/test2.wave \
--target riscv64-unknown-linux-gnu \
--sysroot "$riscv_sysroot" \
--out-dir "$output_dir"

test -x "$binary"
riscv64-linux-gnu-readelf -h "$binary" \
| grep -Eq 'Machine:[[:space:]]+RISC-V'
riscv64-linux-gnu-readelf -h "$binary" \
| grep -Eq 'Flags:[[:space:]]+0x5.*double-float ABI'
riscv64-linux-gnu-readelf -l "$binary" \
| grep -Fq '/lib/ld-linux-riscv64-lp64d.so.1'

runtime_output="$(timeout --signal=TERM --kill-after=5s 30s \
qemu-riscv64 -L "$riscv_sysroot" "$binary")"
printf '%s\n' "$runtime_output"
test "$runtime_output" = 'Hello World'

package-linux:
name: Package Linux x86_64
needs: validate
needs: [validate, validate-riscv64]
runs-on: ubuntu-latest
timeout-minutes: 60

Expand Down Expand Up @@ -288,7 +407,7 @@ jobs:

package-macos:
name: Package macOS
needs: validate
needs: [validate, validate-riscv64]
runs-on: macos-latest
timeout-minutes: 60

Expand Down Expand Up @@ -396,7 +515,7 @@ jobs:

package-windows:
name: Package Windows x86_64
needs: validate
needs: [validate, validate-riscv64]
runs-on: windows-latest
timeout-minutes: 90

Expand Down Expand Up @@ -561,7 +680,7 @@ jobs:

publish:
name: Create GitHub release
needs: [validate, package-linux, package-macos, package-windows]
needs: [validate, validate-riscv64, package-linux, package-macos, package-windows]
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
Expand Down
94 changes: 81 additions & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,20 @@ jobs:
- 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/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m py_compile x.py tools/check_wave_corpus.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m unittest tools.test_test_contracts

- name: Build release compiler
Expand All @@ -69,6 +77,9 @@ jobs:
- name: Run Rust tests
run: cargo test --locked --all-targets --verbose

- name: Check examples and standard library corpus
run: python3 tools/check_wave_corpus.py --wavec target/release/wavec

- name: Run x86_64 SysV ABI contract tests
if: ${{ always() }}
env:
Expand All @@ -78,7 +89,15 @@ jobs:
x86_64_c_abi_interoperates_with_c --verbose

- name: Run Wave end-to-end tests
run: python3 tools/run_tests.py
run: python3 tools/run_tests.py --report-json wave-e2e-report.json

- name: Upload Wave end-to-end report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: wave-e2e-${{ github.job }}
path: wave-e2e-report.json
if-no-files-found: warn

build-linux-arm64:
name: Build Linux arm64
Expand Down Expand Up @@ -122,7 +141,7 @@ jobs:

- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m py_compile x.py tools/check_wave_corpus.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m unittest tools.test_test_contracts

- name: Build release compiler
Expand All @@ -141,7 +160,15 @@ jobs:

- name: Run Wave end-to-end tests
if: ${{ always() }}
run: python3 tools/run_tests.py
run: python3 tools/run_tests.py --report-json wave-e2e-report.json

- name: Upload Wave end-to-end report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: wave-e2e-${{ github.job }}
path: wave-e2e-report.json
if-no-files-found: warn

build-linux-riscv64:
name: Build Linux riscv64
Expand Down Expand Up @@ -204,7 +231,7 @@ jobs:

- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m py_compile x.py tools/check_wave_corpus.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m unittest tools.test_test_contracts

- name: Build release compiler
Expand All @@ -213,6 +240,16 @@ jobs:
- 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 core 64-bit LLVM feature set
run: >-
cargo build --locked --no-default-features
--features llvm-target-core64 --jobs 2

- name: Verify bundled Linux CRT matrix
if: ${{ always() }}
run: |
Expand Down Expand Up @@ -244,7 +281,15 @@ jobs:

- name: Run Wave end-to-end tests
if: ${{ always() }}
run: python3 tools/run_tests.py
run: python3 tools/run_tests.py --report-json wave-e2e-report.json

- name: Upload Wave end-to-end report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: wave-e2e-${{ github.job }}
path: wave-e2e-report.json
if-no-files-found: warn

- name: Run RISC-V contract tests
if: ${{ always() }}
Expand Down Expand Up @@ -332,7 +377,7 @@ jobs:

- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m py_compile x.py tools/check_wave_corpus.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m unittest tools.test_test_contracts

- name: Build release compiler
Expand All @@ -342,12 +387,19 @@ jobs:
run: cargo test --locked --all-targets --verbose

- name: Run Wave end-to-end tests
run: python3 tools/run_tests.py
run: python3 tools/run_tests.py --report-json wave-e2e-report.json

- name: Upload Wave end-to-end report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: wave-e2e-${{ github.job }}
path: wave-e2e-report.json
if-no-files-found: warn

build-macos-amd64:
name: Build macOS amd64
runs-on: macos-15-intel
continue-on-error: true
timeout-minutes: 45

steps:
Expand Down Expand Up @@ -396,7 +448,7 @@ jobs:

- name: Validate Python tooling
run: |
python3 -m py_compile x.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m py_compile x.py tools/check_wave_corpus.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python3 -m unittest tools.test_test_contracts

- name: Build release compiler
Expand All @@ -406,7 +458,15 @@ jobs:
run: cargo test --locked --all-targets --verbose

- name: Run Wave end-to-end tests
run: python3 tools/run_tests.py
run: python3 tools/run_tests.py --report-json wave-e2e-report.json

- name: Upload Wave end-to-end report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: wave-e2e-${{ github.job }}
path: wave-e2e-report.json
if-no-files-found: warn

build-windows-amd64:
name: Build Windows GNU amd64
Expand Down Expand Up @@ -519,7 +579,7 @@ jobs:
PYTHONUTF8: "1"
PYTHONIOENCODING: "utf-8"
run: |
python -m py_compile x.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python -m py_compile x.py tools/check_wave_corpus.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
python -m unittest tools.test_test_contracts

- name: Build release compiler
Expand All @@ -535,4 +595,12 @@ jobs:
env:
PYTHONUTF8: "1"
PYTHONIOENCODING: "utf-8"
run: python tools/run_tests.py
run: python tools/run_tests.py --report-json wave-e2e-report.json

- name: Upload Wave end-to-end report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: wave-e2e-${{ github.job }}
path: wave-e2e-report.json
if-no-files-found: warn
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Wave is built for software where the machine matters. It combines familiar struc

- **Native by design.** Compile to executables, objects, assembly, LLVM IR, or bitcode.
- **Low-level when needed.** Use pointers, C ABI boundaries, inline assembly, and freestanding targets when system contracts must stay visible.
- **Structured language features.** Build with functions, generics, structs, enums, `proto`, arrays, and explicit mutable or immutable bindings.
- **Structured language features.** Build with functions, generics, structs, enums, `proto`, arrays, and explicit `var` declarations.
- **Cross-target compilation.** Generate code for x86-64, AArch64, and RISC-V 64 from supported compiler hosts.
- **Tool-friendly interfaces.** Query targets and compiler capabilities in human-readable or JSON form for build tools and editors.

Expand All @@ -39,7 +39,7 @@ Wave is under active pre-beta development. Syntax and toolchain contracts are be

```wave
fun main() {
let language: str = "Wave";
var language: str = "Wave";
var count: i32 = 1;

println("Hello from {} #{}", language, count);
Expand Down
Loading
Loading