I am interested in understanding better/improving the doc of templates.
@Assia Mahboubi did you have a specific project you were trying to apply templates on? I could take a look if it's idiomatic.
The issue mentioned by @Yves Bertot about libraries is much more complicated I guess...
essentially, templates are very much WIP
@Karl Palmskog Yes, it is https://github.com/math-comp/apery
WIP yes, but at the same time widely used, no?
in coq-community, yes, but mostly by the same people who develop them
Configuration is not finished because last time I worked on it I consumed all the time I could allocate to this.
@Assia Mahboubi OK, so your goal would be to generate README, opam, and CI?
But the issue is mostly about setting up CI for projects depending on (a large chunk of) MathComp
@Karl Palmskog Yes.
I am interested in this too, let only because whetever I do will have to be integrated with this anyway
@Assia Mahboubi , what does your project depend on, other than coq-mathcomp-*
?
An answer to previous remark by @assia concerning the "complicated question about libraries". I think this is not a documentation problem, so out of topic for this working group.
Also, I guess I would like to improve the documentation so that we know exactly what the CI is doing wrt dependencies.
However, this looks like a topic that is a bit separate from the general documentation WG, should this be a sub-topic?
I suggest to rename the topic of this discussion to WG: coq-community template documentation
shall I?
@Christian Doczkal it is depending on CoqEAL, real-closed and bigenough (see https://github.com/math-comp/apery/blob/master/meta.yml)
you can take a subset of the comments and rename and keep the general WG topic for documentation?
And by transitivity on other libraries of course (like paramcoq)
OK, how about the following. I can set up apery for idiomatic template usage and make a pull request, and we can try to figure what the hard parts were and document them
The first thing that comes to my mind is using mathcomp images as I do for instance in graph-theory
: https://github.com/coq-community/graph-theory/blob/master/meta.yml#L57-L65
here is my PR with the usual Actions CI: https://github.com/math-comp/apery/pull/1
Coming back to the actual topic of this WG: there seems to be no documentation for the templates other than the pretty terse README.md
and ref.yml
, which is also not exactly newcomer friendly. Should we enable the wiki on this project to document the templates, or where should documentation go?
I'm somewhat averse to wikis. I would aim for adding more to README.md
as a first step
I was just thinking that it may be a good idea to have a human-readable documentation of things like tested_opam_versions
and other options, and that, if done properly, this could become too much or too verbose for the README.md
Also, everyone can edit the wiki without having to go through PRs.
Feel free to extend the README and when it becomes too long, we can split it into multiple files.
We also have the manifesto's wiki that could provide a general introduction to the templates.
But if we want precise documentation, it's indeed best to keep it close to the code, i.e. in the templates' repo.
I think a lot of complexity with using the templates is specifying all the requirements of the Coq project. Apery has 5+ dependencies, follows a certain naming schema for opam, etc.
Yes, some help in writing the meta.yml
might be nice. It looks like there isn't any skeleton meta.yml
in the repository.
To enable generating files using one such mustache tool, you should thus write a meta.yml file containing the required values.
I think we should, at the very least, curate one or two meta.yml
files from projects inside coq-community and direct people to use those as a examples or starting points. The current wording leaves this best-practice implicit.
we did have some examples originally. However, it's a huge chore to keep them up to date. I think we should simply provide a bunch of links to different projects' meta.yml
files.
Yes, the question is to which. Do we have simpler mathcomp based project than reglang? (that now also uses the repo
key for custom images.
just pick 5 or ten different ones, for example:
I would advocate for as few as possible, covering (and mentioning) the features used in the respective projects: custom docker images, deps, single-branch, one branch per coq-version, etc.
I created an issue for this: https://github.com/coq-community/templates/issues/78
Please feel free to suggest other projects/use-cases. I will make a PR once the list has been agreed upon.
Karl Palmskog said:
here is my PR with the usual Actions CI: https://github.com/math-comp/apery/pull/1
@Assia Mahboubi After looking at the PR from @Karl Palmskog, could you have a look at the README.md
of coq-community/templates and maybe give us some hints as to what is unclear (for someone less familiar with OPAM and CI).
Thanks a lot for all your comments. This is really helpful.
I will do a comment pass as well, but I think we can merge the PR and summarize as an issue in the template repo
I had a look (again) at the README file of community/templates, and here are the remarks I can make:
coq-ci.yml
file, when the wiki page mentions a travis.yml
page.for the record, ref.yml
lists all the affected files
@Karl Palmskog sure, I will merge the PR right away. Which content do you have in mind for the issue in the template repo?
@Assia Mahboubi I will call it something like "Improving template documentation", and I will copy some of what you just wrote and complement with my own observations
@Assia Mahboubi thank you for your observations.
My pleasure! I am also volunteering for small edits in the README of templates (once I understand things better).
As mentioned above, the first thing I would like to do is to provide some more example meta.yml
files for different setups. And indeed, we should probably say that, unless they have a reason to do otherwise, users should choose GitHub actions for CI.
But my feeling is that some improvements are also needed in the doc of CI setup for coq projects. A lot of material is already present but not yet as easy to find as one could hope for.
(I have to go offline for today, but will have a bit of time to allocate to this tomorrow if relevant).
With the right meta.yml
, CI setup is just a call to generate.sh
. At least for projects that don't have special requirements.
What is a "special requirement"?
for example, some projects have multiple opam files that depend on each other
and we don't support adding system packages (outside opam) to CI as of yet, it has to be done manually in the CI configuration
generate.sh
will not take care of things like this
Is this made explicit somewhere in the doc? I could not find it.
@Assia Mahboubi indeed we lack documentation of limitations, but right now there are many of those, so we probably start by being more thorough about what we can actually do
@Assia Mahboubi by the way, I noticed that Apery has a "flaky build", i.e., it sometimes fails randomly when doing parallel proving (e.g., make -j8
). This is due to coqdep
not picking up file dependencies injected by Load
commands. Specifically, some of the files under include
have Require
sentences for other files in the project.
the topological sort of .v
files done by coqdep
wil miss some dependencies, and thus it sometimes happen that a file is not compiled by make
when it is loaded
one way this could be fixed manually is to make sure that there are no files under include
that Require
a file inside the project, i.e., they should at most Require
external files.
however, Dune 1.0 will support running coqdep
on files that are only used by Load
, i.e., files that may not compile by themselves but are used by other files - I discussed this case with Emilio
@Erik Martin-Dorel do you maybe have a few minutes sometime today to synchronize on "the state of Coq CI" (and templates) in a BBB breakout room? Sometimes it can be a bit more effective than chat here.
Karl Palmskog said:
Assia Mahboubi by the way, I noticed that Apery has a "flaky build", i.e., it sometimes fails randomly when doing parallel proving (e.g.,
make -j8
). This is due tocoqdep
not picking up file dependencies injected byLoad
commands. Specifically, some of the files underinclude
haveRequire
sentences for other files in the project.
I know this this unusual and may seem bad practice. But this development is of a bit special nature.
Part of certain files have been generated by translating the output of Maple sessions. These files are stored under include
. These files need to Require
some files of the project, the ones that contain the Coq (counterpart) definitions of some sequences used in the Maple sessions. The Require
commands have actually been generated as well.
yes, it's perfectly fine to organize a project this way, but it's not fully supported by coq_makefile
unless you omit all Require
for local files in the include
directory
basically, project compilation will fail nondeterministically if you try with more parallel jobs than, say, 3
I would rather not edit these files manually, because one of the points of this project was to show that it was possible to make the two systems cooperate. So fixing the issue would require editing the script which generates the Coq files from the output of Maple scripts. And that's not something I can do instantaneously.
I understand, but just be aware of this issue and when Dune with 1.0 support for Coq comes out, Dune can compile the project properly regardless of number of parallel jobs
In makefile.coq.local
one can add lines like
foo.v: extra.bla
to add an extra dependency
Thanks for raising the issue indeed. So may be should I (at least temporarily) warn users about this limitation in the README?
See for example: https://github.com/LPCIC/coq-elpi/blob/a03579e8f3c1d3dfcfe08c3c81a1795b45ede513/Makefile.coq.local#L10
(assuming I got the issue)
Enrico's solution could work, but will require careful analysis of what is in each include
file
Ah I was about to raise this question indeed: can I indicate dependencies explicitly to help coqdep?
Karl Palmskog said:
Erik Martin-Dorel do you maybe have a few minutes sometime today to synchronize on "the state of Coq CI" (and templates) in a BBB breakout room? Sometimes it can be a bit more effective than chat here.
Sure, I think I'll be available at 15:00 UTC+1 to discuss this (and also recap the latest changes I've done with @Théo Zimmermann this morning about docker-keeper, and the changes to come for docker-coq images on next week :)
Karl Palmskog said:
Enrico's solution could work, but will require careful analysis of what is in each
include
file
Do you mean that I should put the transitive closure of dependencies?
Otherwise, it should be quite easy.
I would have done it the same way as Enrico, that is, dumping a bunch of dependencies into Makefile
.
you can write
file.v : dep1
dep1 : dep2 dep3
it will close it transitively for you
@Erik Martin-Dorel OK, let's meet at 15:00 then
@Erik Martin-Dorel so did you have time to chat a bit in BBB? Room 3?
yes! sorry for the delay :)
Last updated: Jun 10 2023 at 23:01 UTC