Skip to content

Commit

Permalink
[coq] Check version for Coq's (theories ...) field.
Browse files Browse the repository at this point in the history
Users willing to use this indeed need to bump their `dune-project`
version.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
  • Loading branch information
ejgallego committed Mar 20, 2020
1 parent b332148 commit 5d3aeec
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 29 deletions.
21 changes: 11 additions & 10 deletions doc/dune-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ like:

.. code:: scheme
(lang dune 2.4)
(lang dune 2.5)
Additionally, they can contains the following stanzas.

Expand Down Expand Up @@ -1526,17 +1526,18 @@ in the ``dune-project`` file. For example:

.. code:: scheme
(using coq 0.1)
(using coq 0.2)
This will enable support for the ``coq.theory`` stanza in the current project. If the
language version is absent, dune will automatically add this line with the
latest Coq version to the project file once a ``(coq.theory ...)`` stanza is used anywhere.

The only version supported is ``0.1`` and it doesn't provide any kind
of guarantees with respect to stability, however, as implementation of
features progresses, we hope to bump ``0.1`` to ``1.0`` soon. The 1.0
version will commit to a stable set of functionality; features marked
``1.0`` below are expected to reach 1.0 unchanged.
The supported Coq language versions are ``0.1``, and ``0.2`` which
adds support for the ``theories`` field. We don't provide any
guarantees with respect to stability yet, however, as implementation
of features progresses, we hope reach ``1.0`` soon. The ``1.0``
version will commit to a stable set of functionality; all the features
below are expected to reach 1.0 unchanged or minimally modified.

The basic form for defining Coq libraries is very similar to the OCaml form:

Expand Down Expand Up @@ -1589,7 +1590,7 @@ The stanza will build all ``.v`` files on the given directory. The semantics of
domain). We will lift this restriction in the future. Note that
composition with the Coq's standard library is supported, but in
this case the ``Coq`` prefix will be made available in a qualified
way.
way. Since Coq's lang version ``0.2``.

Recursive qualification of modules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -1696,7 +1697,7 @@ a typical ``dune-workspace`` file looks like:

.. code:: scheme
(lang dune 2.4)
(lang dune 2.5)
(context (opam (switch 4.02.3)))
(context (opam (switch 4.03.0)))
(context (opam (switch 4.04.0)))
Expand All @@ -1708,7 +1709,7 @@ containing exactly:

.. code:: scheme
(lang dune 2.4)
(lang dune 2.5)
(context default)
This allows you to use an empty ``dune-workspace`` file to mark the root of your
Expand Down
2 changes: 1 addition & 1 deletion doc/opam.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ configuration will tell ``dune`` to generate two opam files: ``cohttp.opam`` and

.. code:: scheme
(lang dune 2.4)
(lang dune 2.5)
(name cohttp)
(generate_opam_files true)
Expand Down
10 changes: 7 additions & 3 deletions src/dune/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ module Coq = struct

let syntax =
Dune_lang.Syntax.create ~name:"coq" ~desc:"the coq extension (experimental)"
[ (0, 1) ]
[ (0, 2) ]

let coq_public_decode =
map_validate
Expand Down Expand Up @@ -2041,11 +2041,15 @@ module Coq = struct
and+ synopsis = field_o "synopsis" string
and+ flags = Ordered_set_lang.Unexpanded.field "flags"
and+ boot =
field_b "boot" ~check:(Dune_lang.Syntax.since Stanza.syntax (2, 3))
field_b "boot" ~check:(Dune_lang.Syntax.since syntax (0, 2))
and+ modules = modules_field "modules"
and+ libraries =
field "libraries" (repeat (located Lib_name.decode)) ~default:[]
and+ theories = field "theories" (repeat Coq_lib_name.decode) ~default:[]
and+ theories =
field "theories"
( Dune_lang.Syntax.since syntax (0, 2)
>>> repeat Coq_lib_name.decode )
~default:[]
and+ enabled_if = enabled_if ~since:None in
let package = select_deprecation ~package ~public in
{ name
Expand Down
2 changes: 1 addition & 1 deletion src/dune/stanza.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Parser = struct
type nonrec t = string * t list Dune_lang.Decoder.t
end

let latest_version = (2, 4)
let latest_version = (2, 5)

let syntax =
Dune_lang.Syntax.create ~name:"dune" ~desc:"the dune language"
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose_boot/dune-project
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 2.4)
(lang dune 2.5)

(using coq 0.1)
(using coq 0.2)
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/compose_cycle/dune-project
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 2.4)
(lang dune 2.5)

(using coq 0.1)
(using coq 0.2)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 2.4)
(lang dune 2.5)

(using coq 0.1)
(using coq 0.2)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 2.4)
(lang dune 2.5)

(using coq 0.1)
(using coq 0.2)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 2.4)
(lang dune 2.5)

(using coq 0.1)
(using coq 0.2)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 2.4)
(lang dune 2.5)

(using coq 0.1)
(using coq 0.2)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(lang dune 2.4)
(lang dune 2.5)

(using coq 0.1)
(using coq 0.2)

0 comments on commit 5d3aeec

Please sign in to comment.