Skip to content

Commit e9bd890

Browse files
committed
Merge branch 'master' into reanalyze-dce
2 parents d7088fd + 75f6130 commit e9bd890

File tree

20 files changed

+295
-109
lines changed

20 files changed

+295
-109
lines changed

.github/workflows/semgrep.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,15 @@ jobs:
1111
semgrep:
1212
runs-on: ubuntu-latest
1313

14-
continue-on-error: true # TODO: remove when semgrep fixed: https://github.com/returntocorp/semgrep-action/issues/429
14+
container:
15+
image: returntocorp/semgrep
1516

1617
steps:
1718
- name: Checkout code
1819
uses: actions/checkout@v3
1920

2021
- name: Run semgrep
21-
uses: returntocorp/semgrep-action@v1
22-
with:
23-
config: >-
24-
.semgrep/
25-
generateSarif: "1"
26-
env:
27-
SEMGREP_AGENT_DEBUG: 1 # https://github.com/returntocorp/semgrep-action/issues/429
22+
run: semgrep scan --sarif --output=semgrep.sarif
2823

2924
- name: Upload SARIF file to GitHub Advanced Security Dashboard
3025
uses: github/codeql-action/upload-sarif@v2

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ goblint.bc.js
5353

5454
sv-comp/goblint.zip
5555

56-
privPrecCompare*
56+
privPrecCompare
57+
privPrecCompare-creduce
58+
privPrecCompareRes
5759
apronPrecCompare
5860
messagesCompare
5961
tests/regression/*/run

.semgrep/stats.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
- id: stats-time-partial
3+
patterns:
4+
- pattern: Stats.time $NAME $FUNC $ARG $BADARG ...
5+
message: Stats.time measuring only partial, not complete function application (see https://goblint.readthedocs.io/en/latest/developer-guide/profiling/#stats)
6+
languages: [ocaml]
7+
severity: ERROR

dune-project

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
(sha (>= 1.12))
4646
cpu
4747
arg-complete
48+
yaml
49+
uuidm
4850
(conf-gmp (>= 3)) ; only needed transitively, but they don't have lower bound, which is needed on MacOS
4951
(conf-ruby :with-test)
5052
(benchmark :with-test) ; TODO: make this optional somehow, (optional) on bench executable doesn't work

goblint.opam

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ depends: [
4141
"sha" {>= "1.12"}
4242
"cpu"
4343
"arg-complete"
44+
"yaml"
45+
"uuidm"
4446
"conf-gmp" {>= "3"}
4547
"conf-ruby" {with-test}
4648
"benchmark" {with-test}

goblint.opam.locked

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ depends: [
3131
"bigarray-compat" {= "1.1.0"}
3232
"bigstringaf" {= "0.8.0"}
3333
"biniou" {= "1.2.1"}
34+
"bos" {= "0.2.1"}
3435
"camlidl" {= "1.09"}
3536
"cmdliner" {= "1.1.1" & with-doc}
3637
"conf-autoconf" {= "0.1"}
@@ -43,16 +44,20 @@ depends: [
4344
"cppo" {= "1.6.8"}
4445
"cpu" {= "2.0.0"}
4546
"csexp" {= "1.5.1"}
47+
"ctypes" {= "0.20.1"}
4648
"dune" {= "3.0.3"}
4749
"dune-private-libs" {= "3.0.3"}
4850
"dune-site" {= "3.0.3"}
4951
"dyn" {= "3.0.3"}
52+
"dune-configurator" {= "3.0.3"}
5053
"easy-format" {= "1.3.2"}
51-
"fmt" {= "0.9.0" & with-doc}
54+
"fmt" {= "0.9.0"}
5255
"fpath" {= "0.7.3"}
5356
"goblint-cil" {= "1.8.2"}
57+
"integers" {= "0.7.0"}
5458
"json-data-encoding" {= "0.11"}
5559
"jsonrpc" {= "1.10.3"}
60+
"logs" {= "0.7.0"}
5661
"mlgmpidl" {= "1.2.14"}
5762
"num" {= "1.4"}
5863
"ocaml" {= "4.14.0"}
@@ -80,6 +85,7 @@ depends: [
8085
"qcheck-ounit" {= "0.18.1" & with-test}
8186
"re" {= "1.10.3" & with-doc}
8287
"result" {= "1.5"}
88+
"rresult" {= "0.7.0"}
8389
"seq" {= "base" & with-test}
8490
"sexplib0" {= "v0.14.0"}
8591
"sha" {= "1.15.2"}
@@ -89,7 +95,9 @@ depends: [
8995
"topkg" {= "1.0.5"}
9096
"tyxml" {= "4.5.0" & with-doc}
9197
"uri" {= "4.2.0"}
98+
"uuidm" {= "0.9.8"}
9299
"uutf" {= "1.0.3" & with-doc}
100+
"yaml" {= "3.1.0"}
93101
"yojson" {= "1.7.0"}
94102
"zarith" {= "1.12"}
95103
]

src/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
(public_name goblint.lib)
99
(wrapped false)
1010
(modules :standard \ goblint mainarinc mainspec privPrecCompare apronPrecCompare messagesCompare)
11-
(libraries goblint.sites goblint-cil.all-features batteries.unthreaded qcheck-core.runner sha json-data-encoding jsonrpc cpu arg-complete fpath
11+
(libraries goblint.sites goblint-cil.all-features batteries.unthreaded qcheck-core.runner sha json-data-encoding jsonrpc cpu arg-complete fpath yaml yaml.unix uuidm
1212
; Conditionally compile based on whether apron optional dependency is installed or not.
1313
; Alternative dependencies seem like the only way to optionally depend on optional dependencies.
1414
; See: https://dune.readthedocs.io/en/stable/concepts.html#alternative-dependencies.

src/framework/analyses.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ struct
197197
Messages.xml_file_name := fn;
198198
BatPrintf.printf "Writing xml to temp. file: %s\n%!" fn;
199199
BatPrintf.fprintf f "<run>";
200-
BatPrintf.fprintf f "<parameters>%a</parameters>" (BatArray.print ~first:"" ~last:"" ~sep:" " BatString.print) BatSys.argv;
200+
BatPrintf.fprintf f "<parameters>%s</parameters>" Goblintutil.command_line;
201201
BatPrintf.fprintf f "<statistics>";
202202
(* FIXME: This is a super ridiculous hack we needed because BatIO has no way to get the raw channel CIL expects here. *)
203203
let name, chn = Filename.open_temp_file "stat" "goblint" in
@@ -241,7 +241,7 @@ struct
241241
let p_file f x = fprintf f "{\n \"name\": \"%s\",\n \"path\": \"%s\",\n \"functions\": %a\n}" (Filename.basename x) x (p_list p_fun) (SH.find_all file2funs x) in
242242
let write_file f fn =
243243
printf "Writing json to temp. file: %s\n%!" fn;
244-
fprintf f "{\n \"parameters\": \"%a\",\n " (BatArray.print ~first:"" ~last:"" ~sep:" " BatString.print) BatSys.argv;
244+
fprintf f "{\n \"parameters\": \"%s\",\n " Goblintutil.command_line;
245245
fprintf f "\"files\": %a,\n " (p_enum p_file) (SH.keys file2funs);
246246
fprintf f "\"results\": [\n %a\n]\n" printJson (Lazy.force table);
247247
(*gtfxml f gtable;*)

src/framework/control.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ struct
492492
GobConfig.write_file config;
493493
let module Meta = struct
494494
type t = { command : string; version: string; timestamp : float; localtime : string } [@@deriving to_yojson]
495-
let json = to_yojson { command = GU.command; version = Version.goblint; timestamp = Unix.time (); localtime = localtime () }
495+
let json = to_yojson { command = GU.command_line; version = Version.goblint; timestamp = Unix.time (); localtime = localtime () }
496496
end
497497
in
498498
(* Yojson.Safe.to_file meta Meta.json; *)
@@ -673,6 +673,11 @@ struct
673673
if get_bool "ana.sv-comp.enabled" then
674674
WResult.write lh gh entrystates;
675675

676+
if get_bool "witness.yaml.enabled" then (
677+
let module YWitness = YamlWitness.Make (struct let file = file end) (Cfg) (Spec) (EQSys) (LHT) (GHT) in
678+
YWitness.write lh gh
679+
);
680+
676681
let marshal = Spec.finalize () in
677682
(* copied from solve_and_postprocess *)
678683
let gobview = get_bool "gobview" in

src/goblint.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let main () =
2121
handle_flags ();
2222
if get_bool "dbg.verbose" then (
2323
print_endline (localtime ());
24-
print_endline command;
24+
print_endline Goblintutil.command_line;
2525
);
2626
let file = Fun.protect ~finally:GoblintDir.finalize preprocess_and_merge in
2727
if get_bool "server.enabled" then Server.start file else (

0 commit comments

Comments
 (0)