From 1de95b9d811d3efc0ca8053ce5b5a28bd44cb2da Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Fri, 26 May 2017 14:07:21 +0100 Subject: [PATCH] Print the contents of OCAMLPARAM in the log --- bootstrap.ml | 5 +++++ src/log.ml | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bootstrap.ml b/bootstrap.ml index 9e89d112..823608d7 100644 --- a/bootstrap.ml +++ b/bootstrap.ml @@ -17,6 +17,11 @@ open Printf 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 *) let overridden = String_set.of_list diff --git a/src/log.ml b/src/log.ml index f842af60..1eabbba1 100644 --- a/src/log.ml +++ b/src/log.ml @@ -14,8 +14,11 @@ let create () = if not (Sys.file_exists "_build") then Unix.mkdir "_build" 0o777; let oc = Io.open_out "_build/log" in - Printf.fprintf oc "# %s\n%!" - (String.concat (List.map (Array.to_list Sys.argv) ~f:quote_for_shell) ~sep:" "); + Printf.fprintf oc "# %s\n# OCAMLPARAM: %s\n%!" + (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 ppf = Format.formatter_of_buffer buf in Some { oc; buf; ppf }