-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dune-Coq: support transitive dependencies even for installed theories #11483
Comments
Aren't they already distinguished? coqdep will mention direct deps and won't mention indirect deps. |
I'm not sure if that would make a difference, but is that still true with IIUC, Dune just passes (to coqdep/coqc) -boot and a bunch of -Q/-R options for direct and indirect dependencies, and basically nothing else (minus maybe Init or Corelib) is on the COQPATH, for either coqdep or coqc? So how would coqdep be able to behave differently? |
If you have |
So,
I won't be surprised if there are problems — it's not clear to me if all of this behavior will stay the same. As a future alternative, we could inform both |
No, dune should pass the transitive -Q/-R flags to coqdep. coqdep will then return info on whether they are used directly. |
In short, depending on a coq.theory should also make its dependencies available. This issue is known to experts (at least Emilio and Rodolphe) but I didn't find a bug-tracker entry, and at Bluerock we are interested in a solution, so I figured I would make one.
Desired Behavior
Assume we have
(coq.theory (name foo.logical.prefix) (theories direct_deps))
and a clientclient
. Let us writedeps
fordirect_deps
plus any theories they depend on.When
client
'sbar.v
tries toRequire foo.logical.prefix.some_module.
, any used module fromdeps
must be in scope — so clients of theoryfoo.logical.prefix
need to depend on theories indeps
, and shouldn't have to listdeps
explicitly among their dependencies — that can even change whenfoo.logical.prefix
evolves.Dune usually supports this, except if
foo.logical.prefix
is installed and clients are usingdune-coq >= 0.8
: in that case:deps
are also installed, butfoo.logical.prefix
doesn't even record that it depends ondirect_deps
.Hence, we should
3
and record the dependenciesdirect_deps
of theories when installing themdeps
(so,direct_deps
and their dependencies) available toclient
.Possible future extension:
If
client
requires on some modules fromdep
indeps
explicitly, arguablyclient
should depend ondep
explicitly — to be more robust iffoo.logical.prefix
drops the dependency ondep
. Emilio has mentioned this a few times. However, nowadays dependencies are either available or not, and supporting this extension would require distinguishing direct and indirect uses — either in Coq, or in separate linters. Thankfully, that does not affect point 4: all (transitive) dependenciesdeps
offoo.logical.prefix
would be available as indirect dependencies forclient
, and none as direct dependencies. Hence, I propose to leave discussion of this to future work.Implementation ideas
IIRC, Rodolphe proposed to reuse findlib for this:
https://coq.zulipchat.com/#narrow/channel/240550-Dune-devs-.26-users/topic/.5Blaodpath.5D.20Coqdep.20vs.2E.20Coqmod/near/285853410
Other threads about this
https://coq.zulipchat.com/#narrow/channel/240550-Dune-devs-.26-users/topic/Dune-Coq.200.2E3.20dependency.20model
https://coq.zulipchat.com/#narrow/channel/240550-Dune-devs-.26-users/topic/Adding.20transitive.20deps.20into.20theories
Example
The text was updated successfully, but these errors were encountered: