-
Notifications
You must be signed in to change notification settings - Fork 15
112 lines (104 loc) · 4.13 KB
/
sanitizers.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Sanitizers tests
on:
workflow_dispatch:
inputs:
llvm-branch:
description: 'Custom LLVM branch to use. If not specified, the branch from `LLVM.lock` file is used.'
required: false
default: ''
type: string
# For more information about the supported sanitizers in Rust, see:
# https://rustc-dev-guide.rust-lang.org/sanitizers.html
rust-sanitizer:
required: false
default: 'address'
type: string
description: 'A sanitizer to build Rust code with. Possible values are: address, cfi, hwaddress, kcfi, leak, memory or thread'
# For more information about the supported sanitizers in LLVM, see `LLVM_USE_SANITIZER` option in:
# https://www.llvm.org/docs/CMake.html
llvm-sanitizer:
required: false
default: 'Address'
type: string
description: 'A sanitizer to build LLVM with. Possible values are Address, Memory, MemoryWithOrigins, Undefined, Thread, DataFlow, and Address;Undefined'
path:
required: false
type: string
default: 'tests/solidity'
description: 'Path filter of the era-compiler-tester. For example: tests/solidity/simple'
mode:
required: false
type: string
default: 'Y+M3B3 0.8.28'
description: 'Mode filter for the era-compiler-tester. For example: Y+M3B3 0.8.28'
target:
required: false
type: string
default: 'eravm'
description: 'Target filter for the era-compiler-tester. Possible values are: `eravm` or `evm`'
toolchain:
required: false
type: string
default: 'llvm-ir'
description: 'Compiler toolchain. Available arguments: `ir-llvm`, `solc`, `solc-llvm`.'
environment:
required: false
type: string
default: 'zk_evm'
description: 'Environment to run tests on. Available arguments: `zk_evm`, `FastVM`, `EVMInterpreter`, `REVM`.'
jobs:
run-with-sanitizers:
timeout-minutes: 720
runs-on: matterlabs-ci-runner-high-performance
container:
image: ghcr.io/matter-labs/zksync-llvm-runner:latest
options: -m 110g
env:
TARGET: x86_64-unknown-linux-gnu
RUSTC_BOOTSTRAP: 1
steps:
- name: Checkout compiler-tester
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout llvm
if: inputs.llvm-branch != ''
uses: actions/checkout@v4
with:
repository: matter-labs/era-compiler-llvm
ref: ${{ inputs.llvm-branch }}
path: llvm
- name: Build LLVM
uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@v1
with:
clone-llvm: ${{ inputs.llvm-branch == '' }}
sanitizer: ${{ inputs.llvm-sanitizer }}
enable-assertions: true
- name: Build compiler-tester
env:
RUSTFLAGS: "-Z sanitizer=${{ inputs.rust-sanitizer }}"
run: |
rustup component add rust-src --toolchain "$(rustc --version | cut -d ' ' -f2)-${TARGET}"
cargo build --target ${TARGET} -Zbuild-std --bin 'compiler-tester'
- name: Build zksolc and zkvyper
env:
CARGO_CHECKOUT_DIR: /usr/local/cargo/git/checkouts
RUSTFLAGS: "-Z sanitizer=${{ inputs.rust-sanitizer }}"
run: |
cargo build --target ${TARGET} -Zbuild-std \
--manifest-path ${CARGO_CHECKOUT_DIR}/era-compiler-solidity-*/*/Cargo.toml \
--target-dir './target-zksolc/'
cargo build --target ${TARGET} -Zbuild-std \
--manifest-path ${CARGO_CHECKOUT_DIR}/era-compiler-vyper-*/*/Cargo.toml \
--target-dir './target-zkvyper/'
- name: Run tests with sanitizers
run: |
set -x
./target/${TARGET}/debug/compiler-tester \
--target "${{ inputs.target }}" \
--toolchain "${{ inputs.toolchain }}" \
--environment "${{ inputs.environment }}" \
--zksolc "./target-zksolc/${TARGET}/debug/zksolc" \
--zkvyper "./target-zkvyper/${TARGET}/debug/zkvyper" \
--path '${{ inputs.path }}' \
--mode '${{ inputs.mode }}'