From b701ceaf6b270753a15ec6a5939a126c0bd05707 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Tue, 20 Oct 2020 21:43:29 +0200 Subject: [PATCH] [dune subst] Interpret common command line flags. In particular I wanted this as to have `dune subst` interpret `--debug-backtraces` in the context of #3219 Signed-off-by: Emilio Jesus Gallego Arias --- CHANGES.md | 3 +++ bin/subst.ml | 12 ++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 031b07d63f18..61cc72584bfb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -48,6 +48,9 @@ Unreleased on UNIX-like systems as a unrelated `gmake` binary might exist on Windows. (#3853, @kit-ty-kate) +- `dune subst` now accepts common command-line arguments such as + `--debug-backtraces` (#3878, @ejgallego) + 2.7.1 (2/09/2020) ----------------- diff --git a/bin/subst.ml b/bin/subst.ml index dd473f9adba0..355cd99a96ae 100644 --- a/bin/subst.ml +++ b/bin/subst.ml @@ -58,14 +58,10 @@ let man = let info = Term.info "subst" ~doc ~man let term = - let+ () = Common.build_info in - let config : Config.t = - { Config.default with display = Quiet; concurrency = Fixed 1 } - in - Path.set_root (Path.External.cwd ()); - Path.Build.set_build_dir (Path.Build.Kind.of_string Common.default_build_dir); - Config.init config; - Log.init_disabled (); + let+ () = Common.build_info + and+ common = Common.term in + Common.set_common common ~targets:[]; + let config = Common.config common in Dune_engine.Scheduler.go ~config Watermarks.subst let command = (term, info)