forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 8
90 lines (86 loc) · 3.61 KB
/
enzyme-ci.yml
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
name: Rust CI
on:
push:
branches:
- master
pull_request:
branches:
- master
merge_group:
jobs:
build:
name: Rust Integration CI LLVM ${{ matrix.llvm }} ${{ matrix.build }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [openstack22]
timeout-minutes: 600
steps:
- name: Checkout Rust source
uses: actions/checkout@v4
with:
submodules: true # check out all submodules so the cache can work correctly
fetch-depth: 2
- uses: dtolnay/rust-toolchain@nightly
- name: Get LLVM commit hash
id: llvm-commit
run: echo "HEAD=$(git rev-parse HEAD:src/llvm-project)" >> $GITHUB_OUTPUT
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v4
with:
path: build/build/x86_64-unknown-linux-gnu/llvm
key: ${{ matrix.os }}-llvm-${{ steps.llvm-commit.outputs.HEAD }}
- name: Get Enzyme commit hash
id: enzyme-commit
run: echo "HEAD=$(git rev-parse HEAD:src/tools/enzyme)" >> $GITHUB_OUTPUT
- name: Cache Enzyme
id: cache-enzyme
uses: actions/cache@v4
with:
path: build/build/x86_64-unknown-linux-gnu/enzyme
key: ${{ matrix.os }}-enzyme-${{ steps.enzyme-commit.outputs.HEAD }}
- name: Cache bootstrap/stage0 artifacts for incremental builds
uses: actions/cache@v4
with:
path: |
build/build/bootstrap/
build/build/x86_64-unknown-linux-gnu/stage0-rustc/
build/build/x86_64-unknown-linux-gnu/stage0-std/
build/build/x86_64-unknown-linux-gnu/stage0-tools/
build/build/x86_64-unknown-linux-gnu/stage1-std/
# Approximate stable hash. It doesn't matter too much when this goes out of sync as it just caches
# some stage0/stage1 dependencies and stdlibs which *hopefully* are hash-keyed.
key: enzyme-rust-incremental-${{ runner.os }}-${{ hashFiles('src/**/Cargo.lock', 'Cargo.lock') }}
restore-keys: |
enzyme-rust-incremental-${{ runner.os }}
- name: Build
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/`lsb_release -c | cut -f2`/ llvm-toolchain-`lsb_release -c | cut -f2`-17 main" || true
sudo apt-get -y update
sudo apt-get install -y lld-17
mkdir lld-path-manipulation
ln -s "$(which lld-17)" lld-path-manipulation/lld
ln -s "$(which lld-17)" lld-path-manipulation/ld
ln -s "$(which lld-17)" lld-path-manipulation/ld.lld
ln -s "$(which lld-17)" lld-path-manipulation/lld-17
export PATH="$PWD/lld-path-manipulation:$PATH"
mkdir -p build
cd build
rm -f config.toml
../configure --enable-llvm-link-shared --enable-llvm-plugins --enable-llvm-enzyme --set=rust.use-lld=true --release-channel=nightly --enable-llvm-assertions --enable-option-checking --enable-ninja --disable-docs
../x.py build --stage 1 library/std library/proc_macro library/test tools/rustdoc
rustup toolchain link enzyme build/host/stage1
- name: checkout Enzyme/rustbook
uses: actions/checkout@v4
with:
repository: EnzymeAD/rustbook
ref: main
path: rustbook
- name: test Enzyme/rustbook
working-directory: rustbook
run: |
RUSTFLAGS='-Z unstable-options' cargo +enzyme test
ENZYME_LOOSE_TYPES=1 RUSTFLAGS='-Z unstable-options' cargo +enzyme test -p samples-loose-types