-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (97 loc) · 3.15 KB
/
Copy pathbootstrap-verify.yml
File metadata and controls
114 lines (97 loc) · 3.15 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
name: bootstrap-verify
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
jobs:
verify:
name: verify on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
cc: cc
- os: macos-latest
cc: cc
- os: windows-latest
cc: clang
steps:
- uses: actions/checkout@v4
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust toolchain
run: |
rustup toolchain install stable
rustup component add rustfmt clippy
- name: Install cc (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Install cc (macOS)
if: runner.os == 'macOS'
run: brew install --overwrite gcc || true
- name: Install clang (Windows)
if: runner.os == 'Windows'
run: choco install llvm -y
- name: Verify bootstrap
env:
CC: ${{ matrix.cc }}
shell: bash
run: ./checks/verify-bootstrap.sh
- name: Native pipeline test
env:
CC: ${{ matrix.cc }}
shell: bash
run: |
cargo run --bin xb -- --compile selfhost/compiler.x -o /tmp/compA
cargo run --bin xb -- --compile selfhost/cgen.x -o /tmp/cgen1
EXE=""
if [ -f /tmp/compA.exe ]; then EXE=".exe"; fi
cat selfhost/compiler.x | /tmp/compA$EXE > /tmp/irA.txt
cat /tmp/irA.txt | /tmp/cgen1$EXE > /tmp/compB.c
$CC -o /tmp/compB /tmp/compB.c
cat selfhost/compiler.x | /tmp/compB$EXE > /tmp/irB.txt
diff /tmp/irA.txt /tmp/irB.txt
cargo run --bin xb -- --emit-ir selfhost/compiler.x > /tmp/irRust.txt
diff /tmp/irA.txt /tmp/irRust.txt
echo "Native pipeline: all stages produce identical IR"
llvm-build:
name: LLVM feature build (ubuntu-latest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: linux-llvm-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust toolchain
run: |
rustup toolchain install stable
rustup component add rustfmt clippy
- name: Install LLVM 22
run: |
wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 22
sudo apt-get install -y libpolly-22-dev || echo "libpolly not available, continuing"
echo "LLVM_SYS_221_PREFIX=/usr/lib/llvm-22" >> "$GITHUB_ENV"
- name: Build with --features llvm
env:
CC: cc
run: cargo build --release --features llvm
- name: Test with --features llvm
env:
CC: cc
run: cargo test --release --features llvm -p xb-compiler -p xb-cli