Skip to content

Commit

Permalink
[coq] Display coq env flags in dune printenv (#4767)
Browse files Browse the repository at this point in the history
Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
  • Loading branch information
ejgallego authored Jun 23, 2021
1 parent c07c42f commit 6997cbe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ Unreleased
- Fix `root_module` when used with preprocessing (#4683, fixes #4682,
@rgrinberg, @CraigFe)

- Display Coq profile flags in `dune printenv` (#4767, @ejgallego)

2.9.0 (unreleased)
------------------

Expand Down
7 changes: 6 additions & 1 deletion src/dune_rules/super_context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ let dump_env t ~dir =
let ocaml_flags = get_node t ~dir >>= Env_node.ocaml_flags in
let foreign_flags = get_node t ~dir >>| Env_node.foreign_flags in
let menhir_flags = get_node t ~dir >>| Env_node.menhir_flags in
let coq_flags = get_node t ~dir >>= Env_node.coq in
let open Action_builder.O in
let+ o_dump =
let* ocaml_flags = Action_builder.memo_build ocaml_flags in
Expand All @@ -417,8 +418,12 @@ let dump_env t ~dir =
let+ flags = Action_builder.memo_build_join menhir_flags in
[ ("menhir_flags", flags) ]
|> List.map ~f:Dune_lang.Encoder.(pair string (list string))
and+ coq_dump =
let+ flags = Action_builder.memo_build_join coq_flags in
[ ("coq_flags", flags) ]
|> List.map ~f:Dune_lang.Encoder.(pair string (list string))
in
List.concat [ o_dump; c_dump; menhir_dump ]
List.concat [ o_dump; c_dump; menhir_dump; coq_dump ]

let resolve_program t ~dir ?hint ~loc bin =
let t = t.env_tree in
Expand Down
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/workspaces.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Workspaces also allow you to set the env for a context:
(c_flags ())
(cxx_flags ())
(menhir_flags ())
(coq_flags (-q))

$ dune build --root multiple-merlin-contexts
Entering directory 'multiple-merlin-contexts'
Expand Down

0 comments on commit 6997cbe

Please sign in to comment.