Skip to content

Commit

Permalink
Fix symtab json file removal and reduce regression scope (#2447)
Browse files Browse the repository at this point in the history
This fixes a regression introduced in #2439 when write symtab json is enabled. We still need to take that into consideration and remove them if needed.

This change also simplifies the write symtab json regression to avoid the out of disk space issue we've been seeing since #2439.
  • Loading branch information
celinval authored May 17, 2023
1 parent 2df67e3 commit 3d05d3f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/kani.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ jobs:
os: ubuntu-20.04

- name: Build Kani
run: cargo build-dev
run: cargo build-dev -- --features write_json_symtab

- name: Run tests
run: |
cargo run -p compiletest --quiet -- --suite kani --mode kani --quiet --no-fail-fast
cargo run -p compiletest --quiet -- --suite expected --mode expected --quiet --no-fail-fast
cargo run -p compiletest --quiet -- --suite cargo-kani --mode cargo-kani --quiet --no-fail-fast
- name: Execute Kani regression
env:
KANI_ENABLE_WRITE_JSON_SYMTAB: 1
run: ./scripts/kani-regression.sh
benchcomp-tests:
runs-on: ubuntu-20.04
Expand Down
8 changes: 4 additions & 4 deletions kani-driver/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ impl Project {
let goto = Artifact::try_new(&goto_path, Goto)?;

// All other harness artifacts that may have been generated as part of the build.
artifacts.extend([TypeMap, VTableRestriction, PrettyNameMap].iter().filter_map(
|typ| {
artifacts.extend(
[SymTab, TypeMap, VTableRestriction, PrettyNameMap].iter().filter_map(|typ| {
let artifact = Artifact::try_from(&symtab_out, *typ).ok()?;
Some(artifact)
},
));
}),
);
artifacts.push(symtab_out);
artifacts.push(goto);
}
Expand Down
13 changes: 3 additions & 10 deletions scripts/kani-regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ check_kissat_version.sh
${SCRIPT_DIR}/kani-fmt.sh --check

# Build all packages in the workspace
if [[ "" != "${KANI_ENABLE_WRITE_JSON_SYMTAB-}" ]]; then
cargo build-dev -- --features write_json_symtab
else
cargo build-dev
fi
cargo build-dev

# Unit tests
cargo test -p cprover_bindings
Expand Down Expand Up @@ -69,11 +65,8 @@ for testp in "${TESTS[@]}"; do
--quiet --no-fail-fast
done

# Don't run std regression if using JSON symtab to avoid OOM issues.
if [[ -z "${KANI_ENABLE_WRITE_JSON_SYMTAB-}" ]]; then
# Check codegen for the standard library
time "$SCRIPT_DIR"/std-lib-regression.sh
fi
# Check codegen for the standard library
time "$SCRIPT_DIR"/std-lib-regression.sh

# We rarely benefit from re-using build artifacts in the firecracker test,
# and we often end up with incompatible leftover artifacts:
Expand Down

0 comments on commit 3d05d3f

Please sign in to comment.