Repository navigation
90 lines (76 loc) · 3.32 KB
/
Copy pathgenmc.yml
File metadata and controls
90 lines (76 loc) · 3.32 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
name: GenMC
# Checks the LLVM IR that vxc generates for the Mutex, the Semaphore, the channel and Arc, with
# GenMC under RC11. See formal/compiled/README.md.
on:
pull_request:
branches: [ main ]
paths: [ 'formal/compiled/**', 'stdlib/core/sync/**', 'stdlib/std/sync/**',
'src/dialect/VxLowering.cpp', '.github/workflows/genmc.yml' ]
workflow_dispatch:
env:
GENMC_COMMIT: fab5bba
jobs:
genmc:
name: Check the compiled library with GenMC
runs-on: ubuntu-26.04
timeout-minutes: 90
env:
RUSTFLAGS: "-C link-arg=-fuse-ld=lld"
steps:
- name: Checkout code
uses: actions/checkout@v7
# The LLVM of ci.yml. It builds vxc, and its clang, opt and llvm-link make the IR.
- name: Get our own LLVM
id: llvm
uses: ./.github/actions/build-own-llvm
- name: Use our own LLVM
uses: ./.github/actions/use-own-llvm
with:
key: ${{ steps.llvm.outputs.key }}
# GenMC links the shared libLLVM, which our own LLVM does not build. So GenMC uses the
# LLVM 22 of apt.llvm.org.
- name: Add apt.llvm.org
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key |
sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-22 main" |
sudo tee /etc/apt/sources.list.d/llvm-22.list
# The runner image lists Microsoft's apt repository, which no step here uses. A failure of
# that server makes `apt-get update` fail, so the step removes the repository first.
sudo rm -f $(grep -l packages.microsoft.com /etc/apt/sources.list.d/*)
sudo apt-get update -qq
sudo apt-get install -y -qq libllvm22 libffi-dev
# ImageOS names the OS release of the runner (ubuntu26), as in build-own-llvm.
- name: GenMC cache key
id: genmc-key
run: echo "key=genmc-$ImageOS-llvm22-$GENMC_COMMIT-${{ hashFiles('formal/compiled/genmc.patch') }}" >> "$GITHUB_OUTPUT"
- name: Cache GenMC
id: genmc-cache
uses: actions/cache@v6
with:
path: ~/genmc
key: ${{ steps.genmc-key.outputs.key }}
- name: Build GenMC
if: steps.genmc-cache.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y -qq llvm-22-dev clang-22 zlib1g-dev libedit-dev libzstd-dev libxml2-dev
git clone -q https://github.com/MPI-SWS/genmc.git "$RUNNER_TEMP/genmc"
cd "$RUNNER_TEMP/genmc"
git checkout -q "$GENMC_COMMIT"
git apply "$GITHUB_WORKSPACE/formal/compiled/genmc.patch"
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/lib/llvm-22/lib/cmake \
-DCMAKE_INSTALL_PREFIX="$HOME/genmc"
cmake --build build -j "$(nproc)"
cmake --install build
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: genmc-${{ steps.llvm.outputs.key }}
- name: Build vxc
run: cargo build --release --bin vxc
- name: Run GenMC on each client
run: |
python3 formal/compiled/run_genmc.py --genmc "$HOME/genmc/bin/genmc" \
--vxc target/release/vxc --llvm-bin "$GITHUB_WORKSPACE/toolchain/install/bin"