Hi folks, there was discussion in the hacking event w.r.t. the use cases of the newly implemented %{coq:version}
variable. Two core questions that need feedback:
coq:version
vs coq:release
: I think that coq:release is the important one, like 8.15, 8.16, as people would like to use this variable for compat reasons mostly (and not often!) , is there a use for Coq version tho? coq:release
allows you to do stuff like (copy_rules foo-%{coq:release} foo.v)
easily, and that was my main motivation, but I don't know more.
Use cases. A good point raised in the meeting is that the use cases seem unclear. One use case is conditional compilation, but it was raised that a) conditional compilation could be implemented in Coq (but that's pretty costly) b) conditional compilation could be supported by some specialized stanza that would prevent user errors c) conditional compilation should be just discouraged.
What other uses cases for this variable we have?
Thoughts?
For version, I think you've listed all the potential use cases. We did not include the a discussion how coqc_config though. I think there are more use cases there - in particular, a way for coq to signal to dune which rules to setup and which features this compiler supports.
Yes @Rudi Grinberg , for coq:config
we have two cases that I know of:
coq:config:native
to setup rules for Coq's vo to cmxs coq:config:lib
to find the directory where the root of installed Coq libraries isI think that's all, coqc --config
outputs a bit more stuff, so YMMV
We also discussed quite a bit about allowing on demand native, which seems like a cool idea, but it makes sense to setup the rules the way coq_makefile does now for the immediate term (that is to say , Dune 3.4) , as the other part would require updates to Coq very likely
Here is my coq -config
:
COQLIB=/mnt/sda1/.opam/coq.dev/lib/coq/
COQCORELIB=/mnt/sda1/.opam/coq.dev/lib/coq/../coq-core/
DOCDIR=/mnt/sda1/.opam/coq.dev/doc/coq/
OCAMLFIND=/mnt/sda1/.opam/coq.dev/bin/ocamlfind
CAMLFLAGS=-thread -rectypes -w -a+1..3-4+5..8-9+10..26-27+28..40-41-42+43-44-45+46..47-48+49..57-58+59..66-67-68+69-70 -safe-string -strict-sequence
WARN=-warn-error +a-3
HASNATDYNLINK=true
COQ_SRC_SUBDIRS=boot config lib clib kernel library engine pretyping interp gramlib parsing proofs tactics toplevel printing ide stm vernac plugins/btauto plugins/cc plugins/derive plugins/extraction plugins/firstorder plugins/funind plugins/ltac plugins/ltac2 plugins/micromega plugins/nsatz plugins/ring plugins/rtauto plugins/ssr plugins/ssrmatching plugins/syntax
COQ_NATIVE_COMPILER_DEFAULT=yes
There is nothing there about vok/vos rules for example. That will have to be something that users enable themselves in a stanza
Apart from version and native, I don't really see many conditions the complication could use
Ali Caglayan said:
There is nothing there about vok/vos rules for example. That will have to be something that users enable themselves in a stanza
I think we don't need to enable anything in the stanza for vos/vok, let's discuss on its own topic tho
Ali Caglayan said:
Apart from version and native, I don't really see many conditions the complication could use
yes, we are tying to reduce config, so for now only native and coqlib
Ali Caglayan said:
There is nothing there about vok/vos rules for example. That will have to be something that users enable themselves in a stanza
Once someone adds -no-vok
to coqc
, hopefully it will be reflected in coqc -config
Rudi Grinberg said:
Ali Caglayan said:
There is nothing there about vok/vos rules for example. That will have to be something that users enable themselves in a stanza
Once someone adds
-no-vok
tocoqc
, hopefully it will be reflected incoqc -config
why would they add that? There are no plans to add this I think.
how would dune know when is -no-vok
available for use?
coqc --help
XDD
We could put it in coqc -config if implemented
The issue is that it is not so clear what we should be putting in coqc -config
atm it is just things that were passed during ./configure of coq
as much things as possible really. The version, configuration options, the location of things, which capabilities are enabled.
It's good to avoid having dune run multiple binaries to query for information
Why not deduce from the version?
If -no-vok gets implemented in 8.17 say, then it will be properly documented in coq
Then dune just has to check for the release version of coq rather than having to parse a whole config
On the other hand, I don't see any reason not to put it in the coq -config
However we might want to add existing features such as supported flags etc.
We could put them in coqc -config, but this would mean it won't work for older versions
Versions are inferior.
We can start adding things in to config but there are two issues:
And its still not totally clear what "as much things as possible really" means
We need to come up with some sort of guideline on the Coq side for keeping it maintained
It's usually obvious when a change is interesting to a build system
But by that time, you would have missed support in older coq versions no?
I guess we could have a mix of version and config here. v1 v2 v3 support feature X, but v4 onwards has it explicitly stated in config or something?
It doesn't matter. The absence of an entry means the feature is unavailable
For new features this is true
but what about things we already have
We should assume those things are always present and only support coq >= 8.15
what is -no-vok?
Prevent coqc from producing those pesky empty .vok
files
capabilities are the way to go. For now only two things relevant in coq --config : native capabilities and coqlib location
the rest are leftovers for Coq makefile, which should use it's own config system soon
Last updated: Oct 13 2024 at 01:02 UTC