Skip to content

Commit

Permalink
Merge pull request #3931 from ejgallego/coq+add_q_flags
Browse files Browse the repository at this point in the history
[coq] Add "-q" to default flags.
  • Loading branch information
rgrinberg authored Nov 25, 2020
2 parents 555fd33 + 307b0e4 commit d336ddd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ Unreleased
- Allow (formatting ...) field in (env ...) stanza to set per-directory
formatting specification. (#3942, @nojb)

- [coq] In `coq.theory`, `:standard` for the `flags` field now uses the
flags set in `env` profile flags (#3931 , @ejgallego @rgrinberg)

- [coq] Add `-q` flag to `:standard` `coqc` flags , fixes #3924, (#3931 , @ejgallego)

2.7.1 (2/09/2020)
-----------------

Expand Down
4 changes: 3 additions & 1 deletion doc/dune-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,9 @@ The stanza will build all ``.v`` files on the given directory. The semantics of
customary in the make-based Coq package ecosystem. For
compatibility, we also install under the ``user-contrib`` prefix the
``.cmxs`` files appearing in ``<ocaml_libraries>``,
- ``<coq_flags>`` will be passed to ``coqc`` as command-line options,
- ``<coq_flags>`` will be passed to ``coqc`` as command-line
options. ``:standard`` is taken from the value set in the ``(coq (flags <flags>))``
field in ``env`` profile. See :ref:`_dune-env` for more information.
- the path to installed locations of ``<ocaml_libraries>`` will be passed to
``coqdep`` and ``coqc`` using Coq's ``-I`` flag; this allows for a Coq
theory to depend on a ML plugin,
Expand Down
15 changes: 7 additions & 8 deletions src/dune_rules/coq_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,14 @@ module Context = struct
let dir = Path.build (snd t.coqc) in
Command.run ~dir ?stdout_to (fst t.coqc) args

let standard_coq_flags = Build.return [ "-q" ]

let coq_flags t =
Build.(
map ~f:List.concat
(all
[ Expander.expand_and_eval_set t.expander t.profile_flags
~standard:(Build.return [])
; Expander.expand_and_eval_set t.expander t.buildable.flags
~standard:(Build.return [])
]))
let standard = standard_coq_flags in
let standard =
Expander.expand_and_eval_set t.expander t.profile_flags ~standard
in
Expander.expand_and_eval_set t.expander t.buildable.flags ~standard

let theories_flags =
let setup_theory_flag lib =
Expand Down

0 comments on commit d336ddd

Please sign in to comment.