Print the contents of OCAMLPARAM in the log
This commit is contained in:
parent
f1f95cda37
commit
1de95b9d81
|
@ -17,6 +17,11 @@ open Printf
|
||||||
|
|
||||||
module String_set = Set.Make(String)
|
module String_set = Set.Make(String)
|
||||||
|
|
||||||
|
let () =
|
||||||
|
match Sys.getenv "OCAMLPARAM" with
|
||||||
|
| s -> Printf.eprintf "OCAMLPARAM is set to %S\n%!" s
|
||||||
|
| exception Not_found -> ()
|
||||||
|
|
||||||
(* Modules overriden to bootstrap faster *)
|
(* Modules overriden to bootstrap faster *)
|
||||||
let overridden =
|
let overridden =
|
||||||
String_set.of_list
|
String_set.of_list
|
||||||
|
|
|
@ -14,8 +14,11 @@ let create () =
|
||||||
if not (Sys.file_exists "_build") then
|
if not (Sys.file_exists "_build") then
|
||||||
Unix.mkdir "_build" 0o777;
|
Unix.mkdir "_build" 0o777;
|
||||||
let oc = Io.open_out "_build/log" in
|
let oc = Io.open_out "_build/log" in
|
||||||
Printf.fprintf oc "# %s\n%!"
|
Printf.fprintf oc "# %s\n# OCAMLPARAM: %s\n%!"
|
||||||
(String.concat (List.map (Array.to_list Sys.argv) ~f:quote_for_shell) ~sep:" ");
|
(String.concat (List.map (Array.to_list Sys.argv) ~f:quote_for_shell) ~sep:" ")
|
||||||
|
(match Sys.getenv "OCAMLPARAM" with
|
||||||
|
| s -> Printf.sprintf "%S" s
|
||||||
|
| exception Not_found -> "unset");
|
||||||
let buf = Buffer.create 1024 in
|
let buf = Buffer.create 1024 in
|
||||||
let ppf = Format.formatter_of_buffer buf in
|
let ppf = Format.formatter_of_buffer buf in
|
||||||
Some { oc; buf; ppf }
|
Some { oc; buf; ppf }
|
||||||
|
|
Loading…
Reference in New Issue