diff --git a/CHANGES.md b/CHANGES.md index 8fc967a0d8c..865cc57c0ae 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -55,6 +55,9 @@ - dune install: copy files in an atomic way (#6150, @emillon) +- Add `%{coq:...}` macro for accessing data about the configuration about Coq. + For instance `%{coq:version}` (#6049, @Alizter) + 3.4.1 (26-07-2022) ------------------ diff --git a/doc/concepts.rst b/doc/concepts.rst index 423b1f1da86..6a3f844bf90 100644 --- a/doc/concepts.rst +++ b/doc/concepts.rst @@ -186,6 +186,7 @@ Dune supports the following variables: variable ````, or ```` if it does not exist. For example, ``%{env:BIN=/usr/bin}``. Available since Dune 1.4.0. +- There are some Coq-specific variables detailed in :ref:`coq-variables`. In addition, ``(action ...)`` fields support the following special variables: diff --git a/doc/coq.rst b/doc/coq.rst index 010e94a00e1..4035b6cec72 100644 --- a/doc/coq.rst +++ b/doc/coq.rst @@ -543,3 +543,25 @@ Limitations * When new dependencies are added to a file (via a Coq ``Require`` vernacular command), it is in principle required to save the file and restart to Coq toplevel process. + +.. _coq-variables: + +Coq-Specific Variables +---------------------- + +There are some special variables that can be used to access data about the Coq +configuration. These are: + +- ``%{coq:version}`` the version of Coq. +- ``%{coq:version.major}`` the major version of Coq (e.g., ``8.15.2`` gives + ``8``). +- ``%{coq:version.minor}`` the minor version of Coq (e.g., ``8.15.2`` gives + ``15``). +- ``%{coq:version.suffix}`` the suffix version of Coq (e.g., ``8.15.2`` gives + ``.2`` and ``8.15+rc1`` gives ``+rc1``). +- ``%{coq:ocaml-version}`` the version of OCaml used to compile Coq. +- ``%{coq:coqlib}`` the output of ``COQLIB`` from ``coqc -config``. +- ``%{coq:coq_native_compiler_default}`` the output of + ``COQ_NATIVE_COMPILER_DEFAULT`` from ``coqc -config``. + +See :ref:`variables` for more information on variables supported by Dune.