Skip to content

Commit

Permalink
Print version/kernel on fstar.exe -d output
Browse files Browse the repository at this point in the history
  • Loading branch information
mtzguido committed Feb 7, 2025
1 parent 9312745 commit ddeccf5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/basic/FStarC.Platform.Base.fsti
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
module FStarC.Platform.Base

open FStarC.Effect

type sys =
| Unix
| Win32
| Cygwin

val system : sys

(* Tries to read the output of the `uname` command. *)
val kernel () : string
5 changes: 3 additions & 2 deletions src/fstar/FStarC.Main.fst
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,9 @@ let go_normal () =
fstar_files := Some filenames;

if Debug.any () then (
Util.print1 "- F* executable: %s\n" (Util.exec_name);
Util.print1 "- Library root: %s\n" ((Util.dflt "<none>" (Find.lib_root ())));
Util.print3 "- F* version %s -- %s (on %s)\n" !Options._version !Options._commit (Platform.kernel ());
Util.print1 "- Executable: %s\n" (Util.exec_name);
Util.print1 "- Library root: %s\n" (Util.dflt "<none>" (Find.lib_root ()));
Util.print1 "- Full include path: %s\n" (show (Find.include_path ()));
Util.print_string "\n";
()
Expand Down
6 changes: 6 additions & 0 deletions src/ml/FStarC_Platform_Base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ let system =
| "Win32" -> Win32
| "Cygwin" -> Cygwin
| s -> failwith ("Unrecognized system: " ^ s)

let kernel () : string =
try
List.hd (Process.read_stdout "uname" [| |])
with
| _ -> Sys.os_type
1 change: 1 addition & 0 deletions stage1/dune/fstar-guts/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
dynlink
menhirLib
pprint
process
sedlex
mtime.clock.os
)
Expand Down
1 change: 1 addition & 0 deletions stage2/dune/fstar-guts/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
dynlink
menhirLib
pprint
process
sedlex
mtime.clock.os
)
Expand Down

0 comments on commit ddeccf5

Please sign in to comment.