From 86e4df847bda5ecf611ab233edcdfc6377edb015 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 12 Apr 2018 00:00:31 +0700 Subject: [PATCH] Warn the user when DUNE_CONFIGURATOR is overwritten with -ocamlc --- src/configurator/v1.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/configurator/v1.ml b/src/configurator/v1.ml index ad347739..7c209e93 100644 --- a/src/configurator/v1.ml +++ b/src/configurator/v1.ml @@ -427,7 +427,14 @@ let main ?(args=[]) ~name f = let dest_dir = ref None in let args = Arg.align - ([ "-ocamlc", Arg.String (fun s -> ocamlc := Some s), + ([ "-ocamlc", Arg.String (fun s -> + Option.iter !ocamlc ~f:(fun _ -> + Format.eprintf + "ocamlc is already passed through DUNE_CONFIGURATOR. \ + There's no need to pass it manually through -ocamlc.@." + ); + ocamlc := Some s + ), "PATH ocamlc command to use. \ This value is set automatically when configurator is invoked by dune." ; "-verbose", Arg.Set verbose,