Skip to content

Commit b5b4c25

Browse files
authored
Merge pull request #101 from os-checker/verify-rust-std
Feat: add and deploy UI for verify-rust-std (kani)
2 parents a4e211a + ddd6943 commit b5b4c25

File tree

23 files changed

+19572
-2745
lines changed

23 files changed

+19572
-2745
lines changed

.github/workflows/doc.yml

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,50 @@ name: Deploy Doc
22

33
on:
44
push:
5-
branches: [ main ]
65

76
jobs:
8-
# Build job
97
build:
108
# Specify runner + build & upload the static files as an artifact
119
runs-on: ubuntu-latest
1210
steps:
1311
- uses: actions/checkout@v4
14-
- name: Build static files
15-
env:
16-
CARGO_TERM_COLOR: always
17-
run: |
18-
cargo doc --document-private-items --no-deps
19-
20-
- name: Install rustc internal docs
21-
run: |
22-
rustup toolchain list -v
23-
# Find toolchain path
24-
export TOOLCHAIN=$(rustc --print sysroot)
25-
echo "toolchain=\"$TOOLCHAIN\""
26-
# Remove rustc book
27-
rm $TOOLCHAIN/share/doc/rust/html/rustc -rf
28-
# Download rustc API docs
29-
rustup component add rustc-docs
30-
# Move the docs to deployment path
31-
mv $TOOLCHAIN/share/doc/rust/html/rustc target/doc/rustc
32-
33-
- name: Prepare index.html
34-
run: |
35-
# Find toolchain name
36-
export toolchain=$(rustc --print sysroot | grep -oP "nightly-\d{4}-\d{2}-\d{2}")
37-
echo "toolchain=\"$toolchain\""
38-
# Fill in toolchain placeholder in index.html
39-
sed "s/nightly-xxxx-xx-xx/$toolchain/" .github/index.html > target/doc/index.html
40-
12+
# - name: Build static files
13+
# env:
14+
# CARGO_TERM_COLOR: always
15+
# run: |
16+
# cargo doc --document-private-items --no-deps
17+
#
18+
# - name: Install rustc internal docs
19+
# run: |
20+
# rustup toolchain list -v
21+
# # Find toolchain path
22+
# export TOOLCHAIN=$(rustc --print sysroot)
23+
# echo "toolchain=\"$TOOLCHAIN\""
24+
# # Remove rustc book
25+
# rm $TOOLCHAIN/share/doc/rust/html/rustc -rf
26+
# # Download rustc API docs
27+
# rustup component add rustc-docs
28+
# # Move the docs to deployment path
29+
# mv $TOOLCHAIN/share/doc/rust/html/rustc target/doc/rustc
30+
#
31+
# - name: Prepare index.html
32+
# run: |
33+
# # Find toolchain name
34+
# export toolchain=$(rustc --print sysroot | grep -oP "nightly-\d{4}-\d{2}-\d{2}")
35+
# echo "toolchain=\"$toolchain\""
36+
# # Fill in toolchain placeholder in index.html
37+
# sed "s/nightly-xxxx-xx-xx/$toolchain/" .github/index.html > target/doc/index.html
38+
#
39+
# - name: Upload static files as artifact
40+
# uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
41+
# with:
42+
# path: target/doc/
43+
- name: Build UI
44+
run: cd ui && npm i && NUXT_APP_BASE_URL=/distributed-verification/ npm run generate
4145
- name: Upload static files as artifact
42-
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
46+
uses: actions/upload-pages-artifact@v3
4347
with:
44-
path: target/doc/
48+
path: ui/.output/public/
4549

4650
# Deployment job
4751
deploy:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "verify-rust-std"]
55
path = verify-rust-std
66
url = https://github.com/model-checking/verify-rust-std.git
7+
[submodule "ui/verify-rust-std_data"]
8+
path = ui/verify-rust-std_data
9+
url = https://github.com/os-checker/verify-rust-std_data.git

src/bin/verify_rust_std/merge.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,23 @@ impl SubCmdMerge {
4848
for func in &mut hash_json {
4949
let file = func.file.strip_prefix(&self.strip_hash_json_prefix).unwrap_or(&func.file);
5050
let fn_name = &*func.name;
51-
let value = &*func.hash;
51+
let value = (&*func.hash, func.proof_kind);
5252
hash_map.insert((file, fn_name), value);
5353
}
5454

5555
let cap = kani_list.totals.standard_harnesses + kani_list.totals.contract_harnesses;
5656
let mut v_merge = Vec::with_capacity(cap);
5757
for file_func in kani_list.file_func_name() {
5858
let (file, func) = file_func;
59+
let (hash, proof_kind) = match hash_map.get(&file_func) {
60+
Some((hash, proof_kind)) => (Some((*hash).into()), *proof_kind),
61+
None => (None, None),
62+
};
5963
v_merge.push(MergeHashKaniList {
6064
file: file.into(),
6165
func: func.into(),
62-
hash: hash_map.get(&file_func).map(|s| (*s).into()),
66+
hash,
67+
proof_kind,
6368
});
6469
}
6570
v_merge.sort_unstable();

src/diff.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ pub struct MergeHashKaniList {
254254
#[serde(skip_serializing_if = "Option::is_none")]
255255
#[serde(default)]
256256
pub hash: Option<Box<str>>,
257+
#[serde(skip_serializing_if = "Option::is_none")]
258+
#[serde(default)]
259+
pub proof_kind: Option<ProofKind>,
257260
}
258261

259262
/// Compare two `MergeHashKaniList`, and returns the ones from new that don't match the old,

0 commit comments

Comments
 (0)