-
-
Notifications
You must be signed in to change notification settings - Fork 16
1116 lines (939 loc) · 41.5 KB
/
Copy pathrust.yml
File metadata and controls
1116 lines (939 loc) · 41.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
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_check_case_sources tools.test_case_execution tools.test_case_manifest tools.test_test_contracts tools.test_process_tree tools.test_check_msvc_native
- 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_check_case_sources tools.test_case_execution tools.test_case_manifest tools.test_test_contracts tools.test_process_tree tools.test_check_msvc_native
- 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_check_case_sources tools.test_case_execution tools.test_case_manifest tools.test_test_contracts tools.test_process_tree tools.test_check_msvc_native
- 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_check_case_sources tools.test_case_execution tools.test_case_manifest tools.test_test_contracts tools.test_process_tree tools.test_check_msvc_native
- 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_check_case_sources tools.test_case_execution tools.test_case_manifest tools.test_test_contracts tools.test_process_tree tools.test_check_msvc_native
- 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_check_case_sources tools.test_case_execution 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
build-windows-msvc-amd64:
name: Build Windows MSVC amd64 natively
runs-on: windows-2025
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.89.0
with:
toolchain: 1.89.0-x86_64-pc-windows-msvc
components: rustfmt, clippy
- uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: "x64"
- name: Install pinned native LLVM SDK
shell: pwsh
run: ./tools/provision_windows_msvc_llvm.ps1 -Architecture x64
- name: Provision matching LLVM dependencies and audit CRT
shell: pwsh
run: ./tools/provision_windows_msvc_libxml2.ps1 -Architecture x64
- name: Verify native host and enabled LLVM backends
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
if ($env:PROCESSOR_ARCHITECTURE -ne "AMD64") { throw "Expected native x64 Windows" }
$hostLine = (rustc -vV | Select-String '^host: ').Line
if ($LASTEXITCODE -ne 0 -or $hostLine -ne "host: x86_64-pc-windows-msvc") { throw "Wrong Rust host" }
if (($env:PATH -split ';' | Where-Object { $_ -match '(?i)mingw|msys' }).Count -gt 0) { throw "Native MSVC validation must not inherit MinGW/MSYS paths" }
Write-Host "LLVM config: $env:LLVM_CONFIG_PATH"
Write-Host "MSVC linker: $((Get-Command link.exe).Source)"
$targets = & $env:LLVM_CONFIG_PATH --targets-built
if ($LASTEXITCODE -ne 0) { throw "LLVM backend probe failed" }
foreach ($backend in @("X86", "AArch64", "RISCV")) {
if (($targets -split '\s+') -notcontains $backend) { throw "Missing LLVM backend $backend" }
}
Write-Host "Native compiler uses x64 MSVC; enabled backends: $targets"
- name: Check formatting
run: cargo fmt --all --check
- name: Check all native targets
run: >-
cargo check --locked --workspace --all-targets --target x86_64-pc-windows-msvc
--no-default-features --features llvm-target-core64 --jobs 2
- name: Run Clippy
run: >-
cargo clippy --locked --workspace --all-targets --target x86_64-pc-windows-msvc
--no-default-features --features llvm-target-core64 --jobs 2 -- -D warnings
- name: Build release compiler
run: >-
cargo build --locked --release --target x86_64-pc-windows-msvc
--no-default-features --features llvm-target-core64 --jobs 2
- name: Run native hosted MSVC and bidirectional C ABI fixtures
id: msvc_native
timeout-minutes: 10
run: >-
python tools/check_msvc_native.py
--wavec target/x86_64-pc-windows-msvc/release/wavec.exe
--llvm-bin "$env:WAVE_WINDOWS_LLVM_BIN"
--target x86_64-pc-windows-msvc
--output "${{ runner.temp }}/wave-msvc-native-x64"
- name: Preserve native MSVC execution evidence
if: ${{ always() && steps.msvc_native.outcome != 'skipped' }}
uses: actions/upload-artifact@v4
with:
name: msvc-native-x64-evidence
path: ${{ runner.temp }}/wave-msvc-native-x64/
retention-days: 7
- name: Verify native LLVM allocation and target-data lifetimes
run: >-
cargo test --locked --release -p llvm --test message_ownership
--target x86_64-pc-windows-msvc --no-default-features
--features llvm-target-core64 --jobs 2
- name: Run native Rust and I/O regressions
run: >-
cargo test --locked --workspace --all-targets --target x86_64-pc-windows-msvc
--no-default-features --features llvm-target-core64 --jobs 2
- name: Check MSVC package tool inventory
run: python -m unittest tools.test_msvc_package_tools
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: ./tools/provision_windows_msvc_llvm.ps1 -Architecture arm64
- 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: Run native hosted MSVC and bidirectional C ABI fixtures
id: msvc_native
timeout-minutes: 10
run: >-
python tools/check_msvc_native.py
--wavec target/aarch64-pc-windows-msvc/release/wavec.exe
--llvm-bin "$env:WAVE_WINDOWS_LLVM_BIN"
--target aarch64-pc-windows-msvc
--output "${{ runner.temp }}/wave-msvc-native-arm64"
- name: Preserve native MSVC execution evidence
if: ${{ always() && steps.msvc_native.outcome != 'skipped' }}
uses: actions/upload-artifact@v4