[coq] Allow dependencies and composition with local Coq libraries.#2053
[coq] Allow dependencies and composition with local Coq libraries.#2053rgrinberg merged 4 commits intoocaml:masterfrom
Conversation
c5caafd to
14e8916
Compare
a902897 to
bf5fff2
Compare
|
Ok, so I am reasonably happy with this; testing seems to be doing fine and the code is not too horrible. A big todo is indeed to define the notion of coq libraries names, this is a slightly complex issue so I'll think about it a couple of days [as the library names are really wrappers and there can be overlapping]. IMHO I think it does make sense to add both closure and the possibility to depend on globally-installed libs on this PR; no point on having the users go thru incomplete steps. |
bd9d7c4 to
0f1eb64
Compare
98a80f3 to
3be8cd7
Compare
3be8cd7 to
352d67d
Compare
d22f43f to
9cfed05
Compare
|
Hi folks! It took a while but IMO this is finally ready for merging. I think code in some parts can be cleaned up a bit, I plan to keep working on this to provide inter-scope composition which is the main next feature we want. I've opted not to implement that yet as in-scope composition is enough to (finally!!) bootstrap Coq. Testing so far seems pretty positive. |
|
More generally, I think we can refactor the scope code to handle libraries on different languages in less of an ad-hoc way, I will try something in the PR for the inter-scope composition. |
|
I see I'm late for 2.4 by very little O_O @rgrinberg should I move the change entry to 2.4.1 or directly to 2.5? |
|
Even if |
I'm reluctant to have it documented yet, it is too unstable. Note that it was not introduced in this PR. |
|
Rebased, @rgrinberg I'll wait to merge until your change request is lifted. |
|
Added a couple of cleanups + check on private vs public libs. |
|
I had a first pass. Everything looks mostly fine. I think this is good to go for 2.5 |
We support simple composition of Coq libraries using the `(theories ...)` field. The main changes are: - Coq libraries now have a `Coq_lib.t` type - Stanza scanning does now initialize a `Coq_lib.DB`, per scope. Supporting inter-scope public libraries is left for a future PR. - We properly compose when the stdlib is in scope, this allows to have a compositional build with Coq itself; note that as of today, in a composed build the stdlib prefix `Coq` is introduced qualified; this reflects upstream roadmap of deprecating implicit libs. See comment in `Scope.public_libs` We have added tests for: - simple composition - composition with plugin - cyclic composition - boot composition [disabled until Coq 8.12 is released] - inter-scope composition [fails for now] We leave for future work: - Allow to depend on theories in a different scope - Allow to depend on theories installed globally, likely this will require the 2.0 version of the Coq language - Validation of Coq library names should be improved [clarify upstream rules] Includes changes by Rudi Grinberg [many suggestions] and Théo Zimmerman [documentation review] Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
We place them into a module; error handling in this part could indeed use more work but this is a first step. Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
For now we follow very simple rules, public theories cannot depend on any way on private ones. Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
Thanks @rgrinberg , comments addressed, except for the one on I'm gonna submit the second part of this, supporting inter-scope composition, that should hopefully make the construction of the |
Make it more like the way we handle applicative Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
|
Looks good so far. I'd like to see a lot of the DB handling stuff to be consistent between coq & ocaml, but I suppose there's no rush. |
|
Thanks @rgrinberg !
For now I'm going to separate the handling a bit more so the code is aware of different DBs , we will see how it looks. I think in the coq-lang 1.0 version we will be a bit limited on what we can do; hopefully once we revise the model and stop supporting coq_makefile we should be able to improve things. |
We support simple composition of Coq libraries using the
(theories ...)field. The main changes are:Coq libraries now have a
Coq_lib.ttypeStanza scanning does now initialize a
Coq_lib.DB, perscope. Supporting inter-scope public libraries is left for a future
PR.
We properly compose when the stdlib is in scope, this allows to have
a compositional build with Coq itself; note that as of today, in a
composed build the stdlib prefix
Coqis introduced qualified; thisreflects upstream roadmap of deprecating implicit libs. See comment
in
Scope.public_libsWe have added tests for:
We leave for future work:
require the 2.0 version of the Coq language
rules]
Includes changes by Rudi Grinberg [many suggestions] and Théo
Zimmerman [documentation review]