forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 66
73 lines (65 loc) · 2.51 KB
/
rapx.yml
File metadata and controls
73 lines (65 loc) · 2.51 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
name: RAPx
on:
workflow_dispatch:
push:
branches: [main,rapx-verify-std]
pull_request:
branches: [main,rapx-verify-std]
env:
RAPx_VERSION: "05c016bcb13889119c94890821c2203d175b9a85"
SAFETY_TOOL_VERSION: "6b77419da66865bb5a36b6c9baec71b3e833d3c9"
jobs:
check-with-rapx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Clone and setup safety_tool
run: |
git clone https://github.com/safer-rust/tag-std.git
cd tag-std
git checkout $SAFETY_TOOL_VERSION
cargo install cargo-expand
cd safety-tool
TOOL_DIR=$(pwd)
echo "TOOL_DIR=$TOOL_DIR" >> $GITHUB_ENV
rm -f rust-toolchain.toml
echo '[toolchain]' > rust-toolchain.toml
echo 'channel = "nightly-2025-10-09"' >> rust-toolchain.toml
echo 'components = ["rust-src", "rustc-dev", "llvm-tools-preview"]' >> rust-toolchain.toml
# ./gen_rust_toolchain_toml.rs std
- name: Install safety_tool
run: |
export VERIFY_RUST_STD=1
cd tag-std/safety-tool
export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
cargo install --path . --locked -Fstd
safety-tool --version
safety-tool-rfl build-dev
safety-tool-rfl --display-extra-rustc-args
- name: Clone and install RAPx
run: |
rm -rf RAPx
git clone https://github.com/Artisan-Lab/RAPx.git
cd RAPx
git checkout $RAPx_VERSION
./install.sh
- name: Set up RAPx environment
run: |
cd RAPx
RUSTUP_TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f 1)
echo "RUSTUP_TOOLCHAIN=$RUSTUP_TOOLCHAIN" >> $GITHUB_ENV
RAPX_SYSROOT=$(rustc --print sysroot)
echo "RAPX_LD_LIBRARY_PATH=$RAPX_SYSROOT/lib" >> $GITHUB_ENV
cd ..
CURRENT_DIR=$(pwd)
RUST_SRC_PATH="$CURRENT_DIR/library"
echo "__CARGO_TESTS_ONLY_SRC_ROOT=$RUST_SRC_PATH" >> $GITHUB_ENV
- name: Run RAPx verification
run: |
cargo new dummy_crate
cd dummy_crate
export LD_LIBRARY_PATH=$RAPX_LD_LIBRARY_PATH
export RUSTFLAGS="--cfg=rapx -L $TOOL_DIR/target/safety-tool/lib --extern=safety_macro -Zcrate-attr=feature(register_tool) -Zcrate-attr=register_tool(rapx)"
cargo +$RUSTUP_TOOLCHAIN rapx check --verify-std -- -Zbuild-std=panic_abort,core,std --target x86_64-unknown-linux-gnu