feature(coq): composition of installed theories#7047
Conversation
|
Very nice! I'm unsure if we should introduce a A pain in the ass regarding plugins is that Coq by default will add anything under How are the meta files installed for plugins in 8.16? Some test ideas:
|
c011353 to
3630520
Compare
c8116b5 to
1b44109
Compare
This will be important once we have installed_theories in ocaml#7047 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
This will be important once we have installed_theories in ocaml#7047 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
This will be important once we have installed_theories in ocaml#7047 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
This will be important once we have installed_theories in ocaml#7047 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
1b44109 to
69476db
Compare
This will be important once we have installed_theories in ocaml#7047 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
This will be important once we have installed_theories in ocaml#7047 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
This will be important once we have installed_theories in ocaml#7047 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
This will be important once we have installed_theories in #7047 Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
69476db to
c88aece
Compare
|
I've pushed a bunch of commits for the current WIP. There is now support for composition with installed plugins and also -boot is being passed everywhere. There is a lot of clean up we can do now. There are a few commits in here I will cherry pick and make into their own PRs. I don't plan to keep the testing of equations and mathcomp in the CI, that is just for show. |
|
Amazing work @Alizter ! |
c88aece to
5ebaf6b
Compare
We could version that, or keep boot and add then user-contrib + coqpath by default if the lang version is less than 0.8 I guess the second apporach may be easier. |
|
Let's deprecate up to 0.4 to start with. |
|
Also |
But spelling out whether something is installed prevents dune composition, doesn't it? |
I guess @Alizter just meant that name as a token, the With this PR, things work for Coq like in OCaml, theories are looked locally (in scope, so both private and public are visible), then in the workspace, then in the installed_db which is built from COQLIB and COQPATH |
Yeah it was just a name. I should have said |
ce5651b to
3d8a217
Compare
615f06f to
46b1503
Compare
|
@ejgallego The tests are now passing. We no longer pass -boot if we are < 0.8. Please have a look through and let me know if there is anything left, otherwise we should be ready to merge. |
|
I've also tested this in a docker container with coq 8.17 and the tests all pass. |
Signed-off-by: Ali Caglayan <alizter@gmail.com>
This is some preliminary refactoring for the introduction of a legeacy library later on when we introduce library composition. Signed-off-by: Ali Caglayan <alizter@gmail.com>
When we start considering installed libraries we need to have a general path. Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
We turn a polymorphic variant into a few regular datatypes, so stages of resolution have a totally separate typing, not sharing constructors anymore. Signed-off-by: Ali Caglayan <alizter@gmail.com>
Added: - Coq_lib.equal (from compare) - Coq_lib.empty (convenience for mapping lib names to dirs) - Coq_lib.stdlib (name of the Coq standrad library) - Coq_lib.to_list (perhaps should be renamed explode) - Coq_lib.append Signed-off-by: Ali Caglayan <alizter@gmail.com>
4d0c4bc to
129d082
Compare
This commit introduces a new database for "installed" theories present in `user-contrib` and `COQPATH`. The above paths are scanned and the database of theories is populated based on the subdirectories found. In order to keep compatibility, we add to the database all possible theory names (so for example, given a directory `A/B` we will register two Coq theories `A` and `A.B`). Changes in the code are as expected, main new things are: - `Coq_lib.t` now can represent two kind of objects: theories with an associated dune stanza, and theories found in the system and for whom no stanza is available. - A new`Coq_path.t` type, which represents an inferred "stanza" for libraries that are installed in the `user-contrib` / `COQPATH` scheme. The list of such paths is then used to build the database. Starting with `(coq lang 0.8)` Coq will not see any theory, even if globally installed, unless that theory was declared in the corresponding `theories` field in the stanzas. This solves a longstanding problem due to users being not able to compose with a theory that could present either locally or in installed form. Signed-off-by: Ali Caglayan <alizter@gmail.com> Co-authored-by: Emilio Jesus Gallego Arias <e+git@x80.org>
129d082 to
49c35b0
Compare
Since ocaml#6409 we automatically infer rules for coq-native, and in general this requires at least Coq 8.10 due to the need of command-line option flags added in that version for native. Also, since ocaml#7047 and `(coq lang 0.8)` we detect installed theories, correcting a longstanding problem, we require all users to migrate. The recommended path for most projects is just to upgrade their dune file and Coq version file. Coq 8.10 will likely be the base we support in `(lang coq 1.0)`. Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
Since ocaml#6409 we automatically infer rules for coq-native, and in general this requires at least Coq 8.10 due to the need of command-line option flags added in that version for native. Also, since ocaml#7047 and `(coq lang 0.8)` we detect installed theories, correcting a longstanding problem, we require all users to migrate. The recommended path for most projects is just to upgrade their dune file and Coq version file. Coq 8.10 will likely be the base we support in `(lang coq 1.0)`. Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
We add support for composition with installed theories to the Coq rules.
This allows people to use Dune even if their project depends on an installed project built using make.
This works by first checking if coq lang is enabled, then scanning user-contrib and directories in COQPATH for potential theories. Then a database is constructed allowing users to write
(thories foo.bar)and Dune will look for the Coq_lib_namefoo.bar. The database would have an entry foruser-contrib/foo/barsay and would in turn be able to describe a Coq theory.Closes #6982
Any testing would be appreciated.
Tasks:
-bootto every coqc. We probably need to make a:standardfor plugins if we do this.