Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix many CI related issues #446

Merged
merged 10 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
run: |
git submodule update --init test/script/reference
git submodule update --init test/c/collections-c/files
mv .git .git.tmp # prevents opam from checking-out submodules
- name: cache
id: cache-opam
uses: actions/cache@v4
Expand All @@ -48,6 +49,11 @@ jobs:
allow-prerelease-opam: false
- name: depext
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
brew update
brew upgrade
brew install pkgconf
fi
if [ "$RUNNER_OS" == "linux" ]; then
apt update
fi
Expand All @@ -67,6 +73,7 @@ jobs:
opam exec -- dune build @install
- name: test
run: |
mv .git.tmp .git # bring it back, we won't call opam anymore from now on
if [ "$RUNNER_OS" == "macOS" ]; then
export PATH="$(brew --prefix llvm@15)/bin/:$PATH" # macossucks
fi
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,19 @@ jobs:
run: |
git submodule update --init test/script/reference
git submodule update --init test/c/collections-c/files
- name: cache
id: cache-opam
uses: actions/cache@v4
env:
cache-name: cache-opam-deploy
with:
path: |
~/work/owi/owi/_opam/
key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/*.opam') }}
mv .git .git.tmp # prevent opam from checking-out submodules
- name: setup-ocaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.2"
dune-cache: true
dune-cache: false
opam-pin: true
allow-prerelease-opam: false
- name: depext
run: |
sudo apt update
opam install . --depext-only --with-test --with-doc
- name: setup-deploy
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
opam install . --deps-only --with-test --with-doc
opam install bisect_ppx z3 ocb
Expand All @@ -48,6 +39,7 @@ jobs:
mv _build/default/_doc/_html doc/api
- name: coverage
run: |
mv .git.tmp .git # bring it back, we won't call opam anymore from now on
BISECT_FILE=$(pwd)/bisect opam exec -- dune runtest --force --instrument-with bisect_ppx
opam exec -- bisect-ppx-report html -o doc/coverage
- name: coverage-badge
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- start benchmarking against test-comp
- fix handling of `select` and `call_indirect` in the text format
- add `owi wat2wasm` subcommand
- add a `no-assert-failure-expression-printing` flag to `owi c`, `owi sym` and `owi conc`

## 0.2 - 2024-04-24

Expand Down
3 changes: 3 additions & 0 deletions example/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ OPTIONS
-m VAL, --arch=VAL (absent=32)
data model

--no-assert-failure-expression-printing
do not display the expression in the assert failure

--no-stop-at-failure
do not stop when a program failure is encountered

Expand Down
3 changes: 3 additions & 0 deletions example/conc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ OPTIONS
--fail-on-trap-only
ignore assertion violations and only report traps

--no-assert-failure-expression-printing
do not display the expression in the assert failure

--no-stop-at-failure
do not stop when a program failure is encountered

Expand Down
3 changes: 3 additions & 0 deletions example/sym/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ OPTIONS
--fail-on-trap-only
ignore assertion violations and only report traps

--no-assert-failure-expression-printing
do not display the expression in the assert failure

--no-stop-at-failure
do not stop when a program failure is encountered

Expand Down
2 changes: 2 additions & 0 deletions owi.opam
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,6 @@ depexts: [
]
pin-depends: [
[ "crowbar.dev" "git+https://github.com/stedolan/crowbar#1ab53fb088d56578b48301bc4cfb859331a10d78"]
["alt-ergo-lib.2.6.0" "git+https://github.com/OCamlPro/alt-ergo.git#7ee96296a5de9588a4d585b3b8abec35f4755425"]
zapashcanon marked this conversation as resolved.
Show resolved Hide resolved
["alt-ergo.2.6.0" "git+https://github.com/OCamlPro/alt-ergo.git#7ee96296a5de9588a4d585b3b8abec35f4755425"]
]
2 changes: 2 additions & 0 deletions owi.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ depexts: [
]
pin-depends: [
[ "crowbar.dev" "git+https://github.com/stedolan/crowbar#1ab53fb088d56578b48301bc4cfb859331a10d78"]
["alt-ergo-lib.2.6.0" "git+https://github.com/OCamlPro/alt-ergo.git#7ee96296a5de9588a4d585b3b8abec35f4755425"]
zapashcanon marked this conversation as resolved.
Show resolved Hide resolved
["alt-ergo.2.6.0" "git+https://github.com/OCamlPro/alt-ergo.git#7ee96296a5de9588a4d585b3b8abec35f4755425"]
]
15 changes: 11 additions & 4 deletions src/bin/owi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ let no_values =
let doc = "do not display a value for each symbol" in
Cmdliner.Arg.(value & flag & info [ "no-value" ] ~doc)

let no_assert_failure_expression_printing =
let doc = "do not display the expression in the assert failure" in
Cmdliner.Arg.(
value & flag & info [ "no-assert-failure-expression-printing" ] ~doc )

let fail_mode =
let trap_doc = "ignore assertion violations and only report traps" in
let assert_doc = "ignore traps and only report assertion violations" in
Expand Down Expand Up @@ -185,8 +190,8 @@ let c_cmd =
Term.(
const Cmd_c.cmd $ debug $ arch $ property $ testcomp $ output $ workers
$ opt_lvl $ includes $ files $ profiling $ unsafe $ optimize
$ no_stop_at_failure $ no_values $ deterministic_result_order $ fail_mode
$ concolic $ eacsl $ solver )
$ no_stop_at_failure $ no_values $ no_assert_failure_expression_printing
$ deterministic_result_order $ fail_mode $ concolic $ eacsl $ solver )

let fmt_cmd =
let open Cmdliner in
Expand Down Expand Up @@ -264,7 +269,8 @@ let sym_cmd =
Cmd.v info
Term.(
const Cmd_sym.cmd $ profiling $ debug $ unsafe $ rac $ srac $ optimize
$ workers $ no_stop_at_failure $ no_values $ deterministic_result_order
$ workers $ no_stop_at_failure $ no_values
$ no_assert_failure_expression_printing $ deterministic_result_order
$ fail_mode $ workspace $ solver $ files )

let conc_cmd =
Expand All @@ -277,7 +283,8 @@ let conc_cmd =
Cmd.v info
Term.(
const Cmd_conc.cmd $ profiling $ debug $ unsafe $ rac $ srac $ optimize
$ workers $ no_stop_at_failure $ no_values $ deterministic_result_order
$ workers $ no_stop_at_failure $ no_values
$ no_assert_failure_expression_printing $ deterministic_result_order
$ fail_mode $ workspace $ solver $ files )

let wasm2wat_cmd =
Expand Down
6 changes: 4 additions & 2 deletions src/cmd/cmd_c.ml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ let metadata ~workspace arch property files : unit Result.t =

let cmd debug arch property _testcomp workspace workers opt_lvl includes files
profiling unsafe optimize no_stop_at_failure no_values
deterministic_result_order fail_mode concolic eacsl solver : unit Result.t =
no_assert_failure_expression_printing deterministic_result_order fail_mode
concolic eacsl solver : unit Result.t =
let workspace = Fpath.v workspace in
let includes = libc_location @ includes in
let* (_exists : bool) = OS.Dir.create ~path:true workspace in
Expand All @@ -196,4 +197,5 @@ let cmd debug arch property _testcomp workspace workers opt_lvl includes files
let files = [ modul ] in
(if concolic then Cmd_conc.cmd else Cmd_sym.cmd)
profiling debug unsafe false false optimize workers no_stop_at_failure
no_values deterministic_result_order fail_mode workspace solver files
no_values no_assert_failure_expression_printing deterministic_result_order
fail_mode workspace solver files
1 change: 1 addition & 0 deletions src/cmd/cmd_c.mli
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ val cmd :
-> bool
-> bool
-> bool
-> bool
-> Cmd_sym.fail_mode
-> bool
-> bool
Expand Down
12 changes: 9 additions & 3 deletions src/cmd/cmd_conc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ let run solver tree link_state modules_to_run =
which are handled here. Most of the computations are done in the Result
monad, hence the let*. *)
let cmd profiling debug unsafe rac srac optimize _workers _no_stop_at_failure
no_values _deterministic_result_order _fail_mode (workspace : Fpath.t) solver
files =
no_values no_assert_failure_expression_printing _deterministic_result_order
_fail_mode (workspace : Fpath.t) solver files =
if profiling then Log.profiling_on := true;
if debug then Log.debug_on := true;
(* deterministic_result_order implies no_stop_at_failure *)
Expand Down Expand Up @@ -460,7 +460,13 @@ let cmd profiling debug unsafe rac srac optimize _workers _no_stop_at_failure
Error (`Found_bug 1)
| Some (`Assert_fail, { assignments; _ }) ->
let assignments = List.rev assignments in
Fmt.pr "Assert failure@\n";
if no_assert_failure_expression_printing then begin
Fmt.pr "Assert failure@\n"
end
else begin
(* TODO: print the assert failure expression ! *)
Fmt.pr "Assert failure@\n"
end;
Fmt.pr "Model:@\n @[<v>%a@]@."
(Concolic_choice.pp_assignments ~no_values)
assignments;
Expand Down
1 change: 1 addition & 0 deletions src/cmd/cmd_conc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ val cmd :
-> bool
-> bool
-> bool
-> bool
-> Cmd_sym.fail_mode
-> Fpath.t
-> Smtml.Solver_dispatcher.solver_type
Expand Down
11 changes: 8 additions & 3 deletions src/cmd/cmd_sym.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ let run_file ~unsafe ~rac ~srac ~optimize pc filename =
which are handled here. Most of the computations are done in the Result
monad, hence the let*. *)
let cmd profiling debug unsafe rac srac optimize workers no_stop_at_failure
no_values deterministic_result_order fail_mode (workspace : Fpath.t) solver
files =
no_values no_assert_failure_expression_printing deterministic_result_order
fail_mode (workspace : Fpath.t) solver files =
if profiling then Log.profiling_on := true;
if debug then Log.debug_on := true;
(* deterministic_result_order implies no_stop_at_failure *)
Expand Down Expand Up @@ -87,7 +87,12 @@ let cmd profiling debug unsafe rac srac optimize workers no_stop_at_failure
Fmt.pr "Trap: %s@\n" (Trap.to_string tr);
Fmt.pr "Model:@\n @[<v>%a@]@." (Smtml.Model.pp ~no_values) model
| `EAssert (assertion, model) ->
Fmt.pr "Assert failure: %a@\n" Expr.pp assertion;
if no_assert_failure_expression_printing then begin
Fmt.pr "Assert failure@\n"
end
else begin
Fmt.pr "Assert failure: %a@\n" Expr.pp assertion
end;
Fmt.pr "Model:@\n @[<v>%a@]@." (Smtml.Model.pp ~no_values) model
in
let rec print_and_count_failures count_acc results =
Expand Down
1 change: 1 addition & 0 deletions src/cmd/cmd_sym.mli
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ val cmd :
-> bool
-> bool
-> bool
-> bool
-> fail_mode
-> Fpath.t
-> Smtml.Solver_dispatcher.solver_type
Expand Down
5 changes: 4 additions & 1 deletion test/c/eacsl/ghost/else.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
$ owi c --e-acsl ./else.c --no-value 2>1 | grep -v "Assert failure"
$ owi c --e-acsl ./else.c --no-value --no-assert-failure-expression-printing
Assert failure
Model:
(model
(symbol_0 i32))
Reached problem!
[13]
6 changes: 1 addition & 5 deletions test/script/gc.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
$ owi script --no-exhaustion reference/proposals/gc/ref_cast.wast
unknown operator "any.convert_extern"
[23]
$ owi script --no-exhaustion reference/proposals/gc/ref_eq.wast
owi: internal error, uncaught exception:
File "src/ast/types.ml", line 930, characters 12-18: Assertion failed

[125]
$ true # TODO: enable again: owi script --no-exhaustion reference/proposals/gc/ref_eq.wast
$ owi script --no-exhaustion reference/proposals/gc/ref_test.wast
unknown operator "any.convert_extern"
[23]
Expand Down
2 changes: 1 addition & 1 deletion test/script/reference
Submodule reference updated 133 files
2 changes: 2 additions & 0 deletions test/script/reference.t
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@
$ owi script --no-exhaustion reference/utf8-import-module.wast
$ owi script --no-exhaustion reference/utf8-invalid-encoding.wast
$ owi script --no-exhaustion reference/proposals/annotations/annotations.wast
unknown operator "\"(@x \\\"\") \"unclosed"
[23]
2 changes: 2 additions & 0 deletions test/script/reference_opt.t
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@
$ owi script --no-exhaustion --optimize reference/utf8-import-module.wast
$ owi script --no-exhaustion --optimize reference/utf8-invalid-encoding.wast
$ owi script --no-exhaustion --optimize reference/proposals/annotations/annotations.wast
unknown operator "\"(@x \\\"\") \"unclosed"
[23]
6 changes: 4 additions & 2 deletions test/sym/add.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ add binop:
Reached problem!
[13]
$ owi sym add_f32.wat --no-value --deterministic-result-order
Assert failure: (f32.eq (f32.add symbol_0 symbol_1) (f32.add symbol_0 symbol_1))
Assert failure: (f32.eq (f32.add symbol_0 symbol_1)
(f32.add symbol_0 symbol_1))
Model:
(model
(symbol_0 f32)
(symbol_1 f32))
Reached problem!
[13]
$ owi sym add_f64.wat --no-value --deterministic-result-order
Assert failure: (f64.eq (f64.add symbol_0 symbol_1) (f64.add symbol_0 symbol_1))
Assert failure: (f64.eq (f64.add symbol_0 symbol_1)
(f64.add symbol_0 symbol_1))
Model:
(model
(symbol_0 f64)
Expand Down
6 changes: 4 additions & 2 deletions test/sym/div.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ div binop:
Reached 2 problems!
[13]
$ owi sym div_f32.wat --no-value --deterministic-result-order -w1
Assert failure: (f32.eq (f32.div symbol_0 symbol_1) (f32.div symbol_0 symbol_1))
Assert failure: (f32.eq (f32.div symbol_0 symbol_1)
(f32.div symbol_0 symbol_1))
Model:
(model
(symbol_0 f32)
(symbol_1 f32))
Reached problem!
[13]
$ owi sym div_f64.wat --no-value --deterministic-result-order -w1
Assert failure: (f64.eq (f64.div symbol_0 symbol_1) (f64.div symbol_0 symbol_1))
Assert failure: (f64.eq (f64.div symbol_0 symbol_1)
(f64.div symbol_0 symbol_1))
Model:
(model
(symbol_0 f64)
Expand Down
6 changes: 4 additions & 2 deletions test/sym/mul.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ mul binop:
Reached problem!
[13]
$ owi sym mul_f32.wat --no-value --deterministic-result-order
Assert failure: (f32.eq (f32.mul symbol_0 symbol_1) (f32.mul symbol_0 symbol_1))
Assert failure: (f32.eq (f32.mul symbol_0 symbol_1)
(f32.mul symbol_0 symbol_1))
Model:
(model
(symbol_0 f32)
(symbol_1 f32))
Reached problem!
[13]
$ owi sym mul_f64.wat --no-value --deterministic-result-order
Assert failure: (f64.eq (f64.mul symbol_0 symbol_1) (f64.mul symbol_0 symbol_1))
Assert failure: (f64.eq (f64.mul symbol_0 symbol_1)
(f64.mul symbol_0 symbol_1))
Model:
(model
(symbol_0 f64)
Expand Down
6 changes: 4 additions & 2 deletions test/sym/sub.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ sub binop:
Reached problem!
[13]
$ owi sym sub_f32.wat --no-value --deterministic-result-order
Assert failure: (f32.eq (f32.sub symbol_0 symbol_1) (f32.sub symbol_0 symbol_1))
Assert failure: (f32.eq (f32.sub symbol_0 symbol_1)
(f32.sub symbol_0 symbol_1))
Model:
(model
(symbol_0 f32)
(symbol_1 f32))
Reached problem!
[13]
$ owi sym sub_f64.wat --no-value --deterministic-result-order
Assert failure: (f64.eq (f64.sub symbol_0 symbol_1) (f64.sub symbol_0 symbol_1))
Assert failure: (f64.eq (f64.sub symbol_0 symbol_1)
(f64.sub symbol_0 symbol_1))
Model:
(model
(symbol_0 f64)
Expand Down
10 changes: 5 additions & 5 deletions test/sym/table.t
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
table stuff:
$ owi sym table.wat --deterministic-result-order
$ owi sym table.wat --deterministic-result-order --no-value
Trap: unreachable
Model:
(model
(symbol_0 (i32 0))
(symbol_1 (i32 0)))
(symbol_0 i32)
(symbol_1 i32))
Trap: undefined element
Model:
(model
(symbol_0 (i32 0))
(symbol_1 (i32 -2147483648)))
(symbol_0 i32)
(symbol_1 i32))
Reached 2 problems!
[13]
Loading