-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[coq] Add dependency to META file for Coq plugins
Traditionally, `coqdep` requires the source files of all involved theories to be present in the filesystem, as to resolve logical paths to files. For `.v` files this process is easy, however for plugins, `coqdep` relies on the presence of a `plugin.mlpack` file as a hint that a `plugin.cmxs` file will be produced, so it can correctly map `Declare Ml` to the right `.cmxs`. Starting with 8.16, `coqdep` can alternatively use `META` files to do this mapping, but that requires `META` files to be present in the build tree, at the right path pointed by `OCAMLPATH`. We thus add the `META` files as a dependency for coqdep, which is backwards compatible and will allow us to fix Dune to work with the new findlib-based plugin loading method in Coq 8.16. Unfortunately, the code in Coq upstream seems pretty broken (it seems to produce paths that are wrong w.r.t. our `META` files), so this will need fixing in Coq to fully work, but this is the Dune part, so the rest of work belongs to Coq upstream IIANM. The issue upstream is coq/coq#16571 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
- Loading branch information
Showing
14 changed files
with
128 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
30 changes: 16 additions & 14 deletions
30
test/blackbox-tests/test-cases/coq/deprecate-libraries.t/run.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/coq/plugin-meta.t/dune-project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(lang dune 3.5) | ||
(using coq 0.6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let foo = "bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
The libraries field is deprecated | ||
$ cat > dune << EOF | ||
> (library | ||
> (public_name bar.foo) | ||
> (name foo)) | ||
> | ||
> (coq.theory | ||
> (name bar) | ||
> (plugins bar.foo)) | ||
> EOF | ||
|
||
$ dune build bar.v.d | ||
$ ls -R _build/install/default/lib/bar | ||
_build/install/default/lib/bar: | ||
META | ||
|
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/coq/plugin-private.t/dune-project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(lang dune 3.5) | ||
(using coq 0.6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let foo = "bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
The libraries field is deprecated | ||
$ cat > dune << EOF | ||
> (library | ||
> (name foo)) | ||
> | ||
> (coq.theory | ||
> (name bar) | ||
> (plugins foo)) | ||
> EOF | ||
|
||
$ dune build | ||
File "dune", line 6, characters 10-13: | ||
6 | (plugins foo)) | ||
^^^ | ||
Error: Using private library not supported as a Coq plugin is foo | ||
[1] | ||
|
||
Having both a libraries and plugins field is an error | ||
$ cat > dune << EOF | ||
> (library | ||
> (public_name bar.foo) | ||
> (name foo)) | ||
> | ||
> (coq.theory | ||
> (name bar) | ||
> (libraries bar.foo) | ||
> (plugins bar.foo)) | ||
> EOF | ||
|
||
$ dune build | ||
File "dune", line 7, characters 1-20: | ||
7 | (libraries bar.foo) | ||
^^^^^^^^^^^^^^^^^^^ | ||
Warning: 'libraries' was deprecated in version 0.5 of the Coq language. It | ||
has been renamed to 'plugins'. | ||
File "dune", line 7, characters 12-19: | ||
7 | (libraries bar.foo) | ||
^^^^^^^ | ||
Error: Cannot both use 'plugins' and 'libraries', please remove 'libraries' | ||
as it has been deprecated since version 0.5 of the Coq language. It will be | ||
removed before version 1.0. | ||
[1] | ||
|