Let me start off. Do we need vok? AFAICT it is just a makefile thingright?
I think that's pretty easy to support as long as you set up rules as we do in coq_dune
there are two strategies:
wait — we got vos
in already?
.vo
or .vos
target(old thread https://coq.zulipchat.com/#narrow/stream/240550-Dune-devs-.26-users/topic/vos.2Fvok.20builds, MR https://github.com/ocaml/dune/pull/4050)
and select accordingly
if we go for 1, then dune will clean up all the stale .vo files automatically, and switching modes is great if using the cache
option 2 allows both rules to co-exists
does it make sense?
@Paolo Giarrusso we only have that for the stdlib
(even vos
alone would already be very valuable)
What is the point of vok files though?
I get that producing them is an act of checking, but the files themselves are never needed again right?
@Paolo Giarrusso I don't have the time to code that, but if you dare to try I can indicate you what code to touch
should be just a few lines
start by coq_module.ml
there is a function that returns the object dir
@Ali Caglayan the vok
files themselves are just to track if the code has been checked
update it to append .vo
to all objects
check it works
a .vo dir sorry to all object
to all objects
once that is working, add in another commit a mode
parameter
that will setup a .vos dir
this has a problem tho, in that it makes dune build theory/foo.vo
fail
you know what I mean?
or @Paolo Giarrusso an easier try is just to replace all .vo by .vos
depending on a flag
(in a meeting right now, but I/@Rodolphe Lepigre will check later)
but you have the problem that it is a kind of global switch
we always use the cache, and as you point out that's good enough
and my colleagues tell me many never use vok
— just vos
and stepping in the editor
then you can just patch dune to substitute .vo for .vos
and enable that with some flag
that's what we do in coq_dune
works well
what works bad is the following scenario (would be great if someone could write that down in the Dune issue)
Right, we should be discarding vok (or just get Coq not to output it).
The ambiguity with the vos /vo rule path is troubling tho
I would suggest having a mode in the stanza we can switch
We have file B.v which depends on A , then, if we setup rules
then calling coqc on B.v
[it doesn't matter if for .vo or .vos] will try to pick B.vo
, and if not present B.vos
, IIRC. But there you have a race potentially!
@Ali Caglayan but we don't want to change dune
files to switch to vos
@Paolo Giarrusso , indeed, that can be controlled with a profile for now
@Emilio Jesús Gallego Arias letting Coq choose still seems an anti-feature, but we don't have new facts since the last chat
I'd be happy not to let Coq choose, but note that this is due to Coq implementing the feature
of "incremental compilation" with the wrong tool in this case
what I mean is that once dune ensures vos XOR vo
, Coq can't choose
Oh, I have other idea
yes, that's the idea, have Dune enforce that
and profiles would work for that
another idea that maybe works is to setup object files like this
I think that'd work and allow files to coexists
tho
when a theory depends on another
how do we choose the right object dir?
so we have a problem of interface here :S
so maybe all rules for .vos set -Q to the .vos object dir
this would mean still the user can do dune build theory/foo.vo
but for .vos the user has to do dune build .vos_theory/foo.vos
that's a bit annoying, but a first step maybe
all you need to do is to update `Coq_modules
then the rules is the same, with just passing the mode
as the rule already calls Coq_module
to determine where the object files are
Emilio Jesús Gallego Arias said:
- $theory/foo.vo
- .vos_$theory/foo.vos
that's the right way to do it.
Emilio Jesús Gallego Arias said:
this would mean still the user can do
dune build theory/foo.vo
but for .vos the user has to dodune build .vos_theory/foo.vos
you can add a symlink rule %.vos: .vos_theory/%.vos
to improve the UI here
I didn't read the entire thread, but here's what I recall were the blockers:
-no-vok
mode in coq so that it stops producing these junk files.-no-vok
. This could rely on the coqc -config
PR.Rudi the -no-vok flag is IMHO optional for now (a nice thing to have)
Wouldn't the symlink tho create the problem that coqc would then see the file (and the race could re-appear?)
well if we have the -no-vos/-no-vok for coqc it would prevent that
Coq doesn't produce the -vos unless you pass -vos
I think
tho indeed vos files are not installed, but a build all would produce them too ; umm
so maybe we just go for the env flag
and share the object dir
-no-vos is for reading. in other words, prevent coqc from reading .vos files completely.
ah
I see, that'd be another approach
tho maybe just splitting the objects dirs is ok
not a big deal if the target name is a bit special I think
we could also add a vos alias i suppose
for foo.v
, we can have @foo.vos
but it's still an issue if things like PG except the .vos file to be adjacent to the source
Emilio Jesús Gallego Arias said:
tho maybe just splitting the objects dirs is ok
I think that's needed to workaround the overlapping .glob and .aux target anyway
the object files aren't adjacent to the real source anyway (only to dune's read-only copy), and we'd like to patch PG for it already
the patch tuareg uses is very easy!
agreed
Last updated: Jun 04 2023 at 23:30 UTC