Skip to content

Commit

Permalink
tools: Add unsafe analyzer cargo gegier
Browse files Browse the repository at this point in the history
Signed-off-by: Sangwan Kwon <[email protected]>
  • Loading branch information
bitboom committed Jan 31, 2024
1 parent f807fc1 commit 1911715
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,19 @@ jobs:
- name: Run cli build (x86_64, aarch64)
working-directory: cli
run: make

rust-unsafe-analysis:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: ./scripts/init-unsafe-analysis.sh

- name: Run unsafe analyzer
run: ./scripts/analyze-unsafe.sh

- uses: actions/upload-artifact@v3
with:
name: tools
path: out/unsafe-analysis.log
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@
[submodule "third-party/certifier"]
path = third-party/certifier
url = https://github.com/vmware-research/certifier-framework-for-confidential-computing
[submodule "third-party/cargo-geiger"]
path = third-party/cargo-geiger
url = https://github.com/bitboom/cargo-geiger
12 changes: 12 additions & 0 deletions scripts/analyze-unsafe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

ROOT=$(git rev-parse --show-toplevel)
TOOL=$ROOT/third-party/cargo-geiger
OUT=$ROOT/out

mkdir -p $OUT

cd $ROOT/plat/fvp
cargo geiger --output-format Ratio | tee $OUT/unsafe-analysis.log
14 changes: 14 additions & 0 deletions scripts/init-unsafe-analysis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

ROOT=$(git rev-parse --show-toplevel)
HERE=$ROOT/scripts
TOOL=$ROOT/third-party/cargo-geiger

$HERE/deps/rust.sh

git submodule update --init $TOOL
cargo +stable install cargo-geiger --force --locked \
--path $TOOL/cargo-geiger \
--target x86_64-unknown-linux-gnu
1 change: 1 addition & 0 deletions third-party/cargo-geiger
Submodule cargo-geiger added at 053fb3

0 comments on commit 1911715

Please sign in to comment.