I'm wondering if we could make coq-hott available in the platform: we're doing a HoTT-related summer school next month that could benefit from it. @Michael Soegtrop or @Enrico Tassi was there any issue with including it? (Maybe on windows it's not so easy)
@Matthieu Sozeau TTOMK it should be fine
@Matthieu Sozeau There's already an issue tracking that: https://github.com/coq/platform/issues/7
A summary of the situation:
This topic was moved here from #Coq devs & plugin devs > Coq-HoTT in the platform? by Théo Zimmermann
I've been working on getting rid of the custom hoq stuff, but I was waiting for changes in coq and dune.
Our current makefile set up does much more than build the library (documentation, proviola etc.)
It should be possible to get rid of most of this now, but I haven't had the time recently
There is some work that needs to be done in the HoTT library to completely severe it from the coq stdlib.
@Michael Soegtrop has created a version of the windows installer before for an earlier HoTT workshop.
CI is building it at every run, if you fork the repo and change the list of opam packages you get one
About adding it officially, 2021.02.1 ws about the OSX installer, 2021.02.2+ for adding packages, so it is not planned before the OSX isntaller is fixed
so it is not planned before the OSX isntaller is fixed
I am working on this right now ...
How is the installation structure of HoTT now? Back then one needed a different standard library and things where pretty incompatible. Afair the solution back then was to create scripts for the major executables, which setup things so that coqc would pick up the correct files. Would this still be required?
Technically this is still required, but with the splitting of coq-core it should be much easier to handle now. I just haven't had time to do this yet.
In order words, nothing much has changed
https://github.com/HoTT/HoTT/issues/1424
So you ping me, when you are ready? Otherwise it likely wouldn't be hard to make a Coq platform variant for HoTT. I anyway want to put all Coq versions into one Coq Platform branch, so that there is only one package file per Coq version and all the rest is shared. One could easily add a HoTT variant.
@Bas Spitters : in the license thread you mentioned that you have an upcomming HoTT school. Do you think it makes sense to make a HoTT specialization of Coq Platform now?
I anyway wanted to change the Coq Platform such that it can build different versions of Coq platform and would ask at startup which version you want. One could add a HoTT version there.
But I would need some background info on how to build it / set it up. Maybe a conf call on the topic would help.
@Matthieu Sozeau has been preparing an image for the students. I'm not entirely sure what the status is.
@Matthieu Sozeau : is this Coq platform based or does it work in a different way?
I'm a bit behind, I didn't start yet, so yes a conference call at your earliest convenience would be great!
Otherwise if you could point me to where the specialization should happen I can give it a try. Right now the coq-hott opam package installs its own hoqtop/hoqidetop, so already just being able to have this package would suffice. I mean we don't need to do anything special about it.
I'll try just following the README instructions on a custom installer and report :)
if you open a (draft) PR against coq/platform you will get CI build all the stuff for you.
Yes, I'm trying that
@Matthieu Sozeau : if you have time now, we can have a chat on this.
I'm in a meeting, but maybe in about ~1hr?
@Michael Soegtrop see also the PR https://github.com/coq/platform/pull/97 , I left some comment there, but a skype will surely go faster ;-)
@Enrico Tassi : are you also available around 7 PM?
nope
OK, then I try to sort it out with Matthieu. I would first do a branch for this and later merge it together with the changes to make the platform multi target (Coq 8.13, 8.12, 8.11 ...).
I'm available now @Michael Soegtrop
@Matthieu, sorry I didn't see your message here (email works better) I send you an invite.
@Enrico Tassi : I had a discussion with @Matthieu Sozeau . Currently HoTT uses scripts to start Coq which is not that appsopriate if we anyway generate a separate switch for it. Di you think one could extend the coq_environment.txt
mechanism such that one could also give command line arguments in there? Most important would be -indices-matter. It also gives a few -R and -Q options, but I don't think one needs this of paths are set up properly.
Mid term one could think about having a command line argument and/or environment variable to switch environment files, so that one can easily switch between HoTT and normal Coq.
What do you think? Does it make sense?
The CI worked! https://github.com/coq/platform/pull/97/checks?check_run_id=2220877237
I'm going to test them.. If only I could get the MacOS package as well that would be great!
just rebase on top of https://github.com/coq/platform/pull/50
@Matthieu Sozeau : the smoke test looks fishy, though - it includes all packages. Didn't you disable most packages?
It includes VST and compcert, which I thought could be disabled using PLATFORM_ARGS: -extent=f -parallel=p -jobs=2 -vst=n -compcert=n
in the CI script but that didn't do it
Indeed I have them available in the OS X package I'm testing now
Ah that changed with my rebase on #50, that might be it
I'll need to run a script on the hoq-config file that is installed by the coq-hott package, so that it can relocate into /Applications/... apparently
Otherwise everythings there and can be run (with a little bit of path fiddling)
On Mac you can run such a script before creating the DMG installer (rather than asking the user to do it afte rinstall) since one can assume that the installation is always under /Applications.
So what is left to do? Test it on Mac and Windows?
Yes. I need to find where to run the script to change hoq-config for all versions, and test it :)
Also, on MacOS, the installer missed a symlink that should be installed as well
I guess it should be changed in create_installer_macos.sh
Can I assume we have gnu sed installed?
you should check for it in the script https://github.com/coq/platform/pull/50/files#diff-0c76aa735af08df2c485e007971414f552bee2cb028351c44b2c0ccea457fa96R45, and install it here https://github.com/coq/platform/pull/50/files#diff-7b74d73de878e0e53f6768bbf3a3d4b50c3c6f1f16f9b64518690028b8206b1cR84
Be careful. If I remember correctly, brew
installs sed
as gsed
.
I believe both brew and ports call it gsed
(which is good, since the dmg script is expected to run on OSX only, so we can just ditch "sed")
Yep, I'm using gsed all the time :)
If you need help with translating - please let me know ;-)
Btw.: awk tends to be more compatible and is anyway easier to read for non trivial stuff.
It's just a path change, I think that'll be fine
I think I've got macos covered, now about windows and the snap package
Did you manage to try a build for windows @Michael Soegtrop ?
Just to let you guys know, I am currently getting rid of the hoq stuff. We have already removed our version of the coq prelude so we just need to change some makefiles at the moment.
Matthieu Sozeau said:
Did you manage to try a build for windows Michael Soegtrop ?
I started the build but didn't look at the results as yet ...
That's nice, it should be easy to change the script to not do the fixes if we get there in the next two weeks
@Ali Caglayan : that is great news! So in a near future one can add HoTT as package to the Coq Platform and just Require Include HoTT.HoTT.
and it will work?
That should work. I am currently experimenting with coq_makefile and it seems to be working. HoTT obviously needs the -noinit and -indices-matter flags however so I am not sure you can just import it into any file.
I guess you could as long as you have a _CoqProject
file that contains: -arg -noinit -arg -indices-matter
@Théo Zimmermann : that should be substantially more convenient than using hoqc, especially since one can include such a _CoqProject file in any relevant project.
Yeah, so this works fine. The main issue I am currently having is replacing our current makefile set up to call the coq makefile thing instead. However our current makefile does so much and is so intertwined with custom targets that I am having trouble separating things.
https://github.com/HoTT/HoTT/pull/1431
I've changed the _CoqProject so that we can now build the HoTT library with coq_makefile
If you want to make an installer for coq platform you should be able to now, just do the usual:
coq_makefile -f _CoqProject -o CoqMakefile
make -f CoqMakefile
I have a question about the makefile set up however. It seems that messages are printed into the make output. I know I have observed this before with @Emilio Jesús Gallego Arias when working on a dune set up. AFAIK there is a way to mute this in the makefile version, how is this done?
You mean the VERBOSE=1 (V=1 in HoTT Makefiles I think)?
What's happening is the following in the output:
COQC theories/Equiv/Relational.v
COQC theories/PropResizing/PropResizing.v
COQC theories/Metatheory/FunextVarieties.v
NaiveFunext
: Type
NaiveNondepFunext
: Type
WeakFunext
: Type
COQC theories/Categories/Category/Morphisms.v
due to Print
statements in some files.
Is there a reason to keep these Print
statements in the first place?
sometimes there is a Check
also
especially in the unit tests
I am not sure to understand. What is the point of having Check
in a unit test if you do not test the output of Check
? If it is just to check that a term has a given type, you could just as well use Definition
.
but then you have to give a name to definition
and fill any evars
I think when I spoke with Emilio about this a while back, we agreed that the current message passing system is not ideal.
We should rather put Definition foo : expected_type := test
in the test-suite files, or really do output tests like we do in Coq's test-suite
No, the output of Check
goes to stdout.
Indeed I have a PR which I did wit Ali , I hope to finish it up and submit, we agreed that there we some problems with the current system, it is a long story on how messages have been handled by Coq.
Regarding the prints: if this is built as a package with opam, opam will anyway redirect the output to a log file. There are other packages which produce (a lot) of output. So from a point of understandability of Coq Platform CI output, it doesn't matter a lot (it matters, but not a lot).
@Ali Caglayan would you happen to use Linux and could test the platform snap package for Coq + HoTT ?
@Matthieu Sozeau I am using linux and I would be able to test
What should I do?
Cool, it's here: https://github.com/coq/platform/actions/runs/701471850
A priori, you install it, and follow the instructions there: https://github.com/HoTT/EPIT-2020/pull/2/files
I don't know snap though :)
it still looks like you are using hoq scripts, you shouldn't need to after the PR i submitted is done.
I don't see any instructions for snap there btw
but I am doing it the usual snap way
Indeed, you still need to find hoqidetop, but that should disappear (not exactly sure though because I'm not sure we can pass arbitrary options in CoqIDE)
Matthieu Sozeau said:
I don't know snap though :)
Here it is: sudo snap install --dangerous xxxx_amd64.snap
I can try it out for you
Something is wrong with my snap:
error: cannot communicate with server: Post http://localhost/v2/snaps: dial unix /run/snapd.socket: connect: no such file or directory
It also hangs when I write snap --version
That doesn't look healthy
do you have snapd running? which linux distro are you on?
I didn't know we have to have snapd running?
I am using ubuntu bionic
I just installed snapd from ubuntu repos
it install fine here, but it does not include HoTT
That's curious :)
the snap by default has reduced platform args, change them (temporarily) in your PR by editing snap.yaml
Yep, I'll have a look
zap -extent=i
I just put extent=f ?
Let's try
New snap package here: https://github.com/coq/platform/actions/runs/701849310
With HoTT this time :)
@Matthieu Sozeau : I guess you tested this already on Mac, so what is left is testing on Windows?
@Enrico Tassi @Michael Soegtrop would it be ok to distribute the packages on github as a specific 2021.02-hott platform release when they're ready?
Yes, it's all that's left
(After install you have to right click on the app and say open, then you get an "unsigned warning" message box, where you can decide to "run anyway")
@Enrico Tassi : any chance we get this signed by INRIA?
Yep, it's the same with the MacOS version, that reminds me I should warn users about it
If we can get them signed that would be great indeed
for macos we can sign it by ourselves (not notarize it, which even Inria cannot)
Here the howto: https://github.com/coq/coq/wiki/SigningReleases
you need to access the osx slave, you both have the right I believe
but you need the certificate password, I can give you that in a private chat
do you want to follow the procedure? (cause I've to go)
Sure
Thanks !
Cool! Notarization is currently optional (even on BigSur afaik). Also afaik anybody with an Apple developer account can do it. One just uploads the signed app to Apple, they check it for viruses / malware and sign it with an Apple signature that they checked it. Afaik this is free of charge.
Would you happen to have an apple dev account ? :)
Notarization requires a bit of work it seems, but nothing impossible
Hmm, ci.inria.fr seems really unstable...
If HoTT is ready to properly package in the Coq Platform (in particular without hoq
and hoqide
) and the macOS installer is also ready, what about just releasing 2021.02.1 in time for the spring school with HoTT included inside?
It looks like it would bring less confusion and be better for everyone.
That would be simpler indeed. I'm for it.
I am currently looking at the Windows installer created by CI. It installs something but I have no idea how the scripts are supposed to work on Windows. Theres is neiter a Posix shell nor the concept of executable scripts.
For console calls one can up to a certain extent use batch files, but it would be better to replace the shell scripts with small C files.
Does someone know how hoqidetop is started by CoqIDE?
Atm there is a script hoqide
but if you wait a little bit https://github.com/HoTT/HoTT/pull/1431 will allow for use of coqide
Not that I can see it ... Anyway a shell script won't work on Windows.
What might work is do the argument hacking with a _CoqProject file, as Théo suggested.
ah then its probably generated by ./autogen.sh
But is it shell script or a batch file? Shell scripts are of no use. All the other files like hoqc are posix shell scripts.
How can I test if HoTT works? Can someone point me to a not entirely trivial tets file?
@Michael Soegtrop in principle you can just start coqide -coqlib .../share/hott/coq -R .../share/hott/theories HoTT -indices-matter
Require Import HoTT.Basics.
Check Contr.
Here is one: https://github.com/HoTT/EPIT-2020/pull/2/files#diff-3110edd8b78b8e325fdeee6f017dd26ca7a2a3a5ca318427a34477e52ee7c6b3
OK, then I think we should provide a _CoqProject file for users which sets these arguments
Let me try the _CoqProject approach ...
Ah, I didn't think of that, indeed that's good!
This is exactly what https://github.com/HoTT/HoTT/pull/1431 does
This hasn't been merged yet since I wrote it today, but I can speed that a long a bit
@Ali Caglayan : there are two different things, a _CoqProject file for building HoTT and one for users so that HoTT is properly imported.
Indeed, but it can also be used by the user itself, your _CoqProject only applies in the HoTT library
Ah I see what you mean now
I think one can get around all the hoqxyz files with a simple _CoqProject file.
Give me a few minutes ...
In principle yes, as long as coqide/coqtop is in the path and the IDEs pick the _CoqProject up (I think all do), we just have to instruct the users to put this configuration file at the root of their project. But it will still have to have the weird share/ paths until we update to use Ali's PRs
@Matthieu Sozeau : the ... in the path are supposed to refer to the Coq root folder?
This doesn't seem to work.
Absolute paths do work, though, both on the command line and in a _CoqProject file. So one could supply a batch file which creates a suitable _CoqProject file for HoTT.
This _CoqProject file works for me:
-R T:\test\CoqPlatform_2021_02_0_HoTT/share/hott/theories HoTT
-arg -coqlib
-arg T:\test\CoqPlatform_2021_02_0_HoTT/share/hott/coq
-arg -indices-matter
If I start coqide without options and load a file Test.v with contents:
Require Import HoTT.Basics.
Check Contr.
it runs through.
Yes, I was refering to the absolute paths
Great!
Ah OK, I thought there was some magic in Coq to interpret ... as Coq root (which would be a super cool feature btw.)
Now if we have Ali's PRs, coq can find the HoTT
library itself (as it'll be in coq/user-contrib
)
But we still need the Coqlib option and -indices-matter or not?
And the coqlib will disappear as well I believe
Just -indices-matter
I see.
This solves the path issue.
Will this be merged early enough before the workshop?
I merged my PR upstream, you should be able to use coqide with HoTT np
Ah, it is already merged? We just need to update the opam package?
Cool. Can you make a point release for Coq-8.13?
HoTT passes two important flags to coq -noinit
and indices-matter
Ah, the -noinit replaces the -coqlib?
yep
nice.
So we recommend HoTT users to use a _CoqProject file with
-arg -noinit
-arg -indices-matter
and remove all teh hoq files?
I'll make an opam release for 13.1
Michael Soegtrop said:
So we recommend HoTT users to use a _CoqProject file with
-arg -noinit -arg -indices-matter
and remove all teh hoq files?
Exactly.
We can take a local opam patch file in the platform
(for the time beeing)
But I have write rights to the Coq opam arhcive, so I could also merge a PR.
It'll be cleaner with a release, which we can put in the released
repo of Coq instead of extra-dev
and use it for the Coq Platform release
This all looks like a much nicer solution now. Having a _CoqProject file with simple options shouldn't kill anybody.
Yes, but as I said, for testing it might be better to have a local patch in Coq platform first.
I tend to do it that way for new stuff.
If it all works as expected, we can still push it to the opam repo.
As you prefer then
I think it is the better approach. In Coq release we should only push stuff which is somehow tested.
@Matthieu Sozeau : do you take care of it? I can then later test the result on Windows as soon as CI is through. But I could also do it.
If you have time now, go ahead, otherwise I'll work on it tomorrow morning
OK, then I will do it now.
Cool, thanks everyone!
@Ali Caglayan : can you give me the commit hash ot tag I shall use in the opam file?
67cdb33f91a1fba2f4d8413757ab9813c2652bf4
but I am working on a release with a tag and an opam release
@Ali Caglayan : are the build instruction in this opam file still OK:
https://github.com/coq/platform/blob/007c0075fd4c62f69d6fb3a6b0056143e2e00186/opam/packages/coq-hott/coq-hott.8.13/opam
As I said, let's first test it with a local opam patch (the Coq platform has a local opam patch repo which makes this easy).
So with my latest PR which got merged, you can use coq_makefile to build the library
at least just the vo files
I would prefer to wait with the release until we tested it in the platform
if you want to build documentation etc you still have to use the old makefile
Can you send me the build and install instructions you would recommend?
After cloning the repo, inside the HoTT
directory run:
coq_makefile -f _CoqProject -o CoqMakefile
make -f CoqMakefile
this ofcourse requires coq_makefile to be around
coq_makefile is part of teh coq opam package
so it should be fine?
I think I will do the opam release with this build method btw
but the "official" build instructions on the repo still suggest using the old makefile
I just haven't had the time to update this yet
As I said, let's test it and see ...
OK, a local Windows build is running ...
OK i've submitted an opam archive PR that uses the new way of building the library https://github.com/coq/opam-coq-archive/pull/1668
@Michael Soegtrop my opam build seems to be successful. How is your testing going?
M ylocal build works as expected with a _CoqProject file.
I push to @Matthieu Sozeau PR branch to run CI.
We can compare our opam files then.
opam-version: "2.0"
maintainer: [ "Jason Gross <jgross@mit.edu>" "Ali Caglayan <alizter@gmail.com>" ]
homepage: "http://homotopytypetheory.org/"
bug-reports: "https://github.com/HoTT/HoTT/issues"
license: "BSD-2-Clause"
build: [
["coq_makefile" "-f" "_CoqProject" "-o" "CoqMakefile"]
[make "-f" "CoqMakefile" "-j%{jobs}%"]
]
install: [make "-f" "CoqMakefile" "install"]
depends: [
"ocaml"
"ocamlfind" {build}
"coq" {>= "8.13" & < "8.14~"}
]
authors: ["The Coq-HoTT Development Team"]
dev-repo: "git+https://github.com/HoTT/HoTT.git"
synopsis: "The Homotopy Type Theory library"
tags: [ "logpath:HoTT" ]
url {
src: "git+https://github.com/HoTT/HoTT.git#V8.13.1"
}
I made a V8.13.1 tag for the HoTT library btw
For performance reasons it is prefered to use tar.gz files for releases.
opam-version: "2.0"
maintainer: [ "Jason Gross <jgross@mit.edu>" "Ali Caglayan <alizter@gmail.com>" ]
homepage: "http://homotopytypetheory.org/"
bug-reports: "https://github.com/HoTT/HoTT/issues"
license: "BSD-2-Clause"
build: [
["coq_makefile" "-f" "_CoqProject" "-o" "CoqMakefile"]
[make "-j%{jobs}%" "-f" "CoqMakefile"]
]
install: [make "-f" "CoqMakefile" "install"]
depends: [
"ocaml"
"ocamlfind" {build}
"coq" {>= "8.13" & < "8.14~"}
]
authors: ["The Coq-HoTT Development Team"]
dev-repo: "git+https://github.com/HoTT/HoTT.git"
synopsis: "The Homotopy Type Theory library"
tags: [ "logpath:HoTT" ]
url {
src: "https://github.com/HoTT/HoTT/archive/67cdb33f91a1fba2f4d8413757ab9813c2652bf4.tar.gz"
checksum: "sha512=421fddf05417c92aa0c35532efd5da4258bef0f0f6221ffcd3507b30a88b180cccb1bd25d6e5eb0349d4da007bf46a0a1f2b0dab09ac8386ea28f7c471496622"
}
Ah I wasn't aware of this
CI is running here: (https://github.com/coq/platform/pull/97)
As I said, local tests on Windows did work with this _CoqProject file:
-arg -noinit
-arg -indices-matter
Opening a .v file using HoTT from the same folder as this _CoqProject file works with plain coqide.
So all in all it is pretty nice now!
I guess you know how to compute the SHA code ...
No not really. How do you do it?
Stupid question: What's the point of a checksum here?
It makes sure nobody can tamper with the source code. You must have exactly the source code specified in the opam file with this hash.
For git this is not required because it is considered to be reasonably safe on its own.
I am gone for today! LetÄs continue tomorrow. What timezone are you in?
@Michael Soegtrop I'm in Europe time
@Matthieu Sozeau : on Windows the opam package of @Ali Caglayan works. I guess on other platforms we have to remove the HoTT specific hacks, e.g. the config file does not exist any more. I wonder if it wouldn't be easier to start from scratch from @Enrico Tassi's DMG PR. What is your opinion on this?
@Enrico Tassi : I have time to finalize the DMG stuff over easter. So how about making a normal release after easter including HoTT? @Matthieu Sozeau : would this fit your time line?
Btw.: is it possible to sneak into some introductory lectures on HoTT?
@Michael Soegtrop Of course! Just sign up for the school, and we promise not to fail you for not attending all the lectures. :-)
Many thanks for your help on the HoTT platform.
@Michael Soegtrop Hopefully the opam package looks better now. I couldn't find any documentation, but what am I allowed to put inside the description string? I've used markdown syntax hopefully it is ok.
Hello! Great news! I can just rebase interactively and remove the unneeded stuff
@Ali Caglayan you mean the opam package?
Yes, sorry, still waking up :-)
I think we should give a logical name to contrib/
, e.g. HoTT.contrib
I think part of the reason a logical name hadn't been given was that it wasn't really supposed to be used.
I'm fine with a 2021.02.2 = 2021.02.1 + DMG + coq-hott if that helps a school.
Glad to see that hott is finally just a library and a few flags
The thing is it gets installed in user-contrib/''
, which is clearly wrong
@Enrico Tassi @Michael Soegtrop If you can make it happen that'd be great :)
I think we should then update the install step not to install things from contrib
currently it is the default makefile install
But I don't know how to blacklist things from being installed there
Not sure coq_makefile has that ability. We can have an additional _ContribProject file though, that would be the cleanest
Ali Caglayan said:
Michael Soegtrop Hopefully the opam package looks better now. I couldn't find any documentation, but what am I allowed to put inside the description string? I've used markdown syntax hopefully it is ok.
The description is plain text (unicode). It observes new lines. E.g. coq-elpi always had an elaborate description. You can use opam show coq-hott to look at the description.
@Matthieu Sozeau : what exactly is the problem? On Windows it got installed under user-contrib/HoTT, which is where it should go now since it just needs a few extra options in a _CoqProject file to work.
Most of the files get installed right, but the two in contrib/
are problematic
Locally, I see them get installed in lib/coq/user-contrib/''
I see, I can check later in Windows around noon.
I rebased the PR removing the macos specific patching. It might be worth keeping the packages built by the PR as they are much smaller than a full platform I think.
@Matthieu Sozeau : the Coq Platform explicitly encourages it to create strip down and/or extended variants e.g. for courses, but we wouldn't offer these on the official release page.
Ok, that's fine. I'm sure I can find somewhere to host them.
@Michael Soegtrop We already have tags: [ "logpath:HoTT" ]
btw
Regarding the install issues: it is common to have a wrapper makefile around coq_makefile which does a few extra things.
Yeah, this isn't our main setup yet
I am working on untangling our current makefile
Eventually that will call the one generated by coq_makefile
@Ali Caglayan : ah, yes modal blindness, the tag is there. So just please adjust the description and squash your commits, then I will merge.
OK I have squashed the commits
@Ali Caglayan : thanks - after Matthieu's remark I need to do some additional checks about files installed directly in user-contrib. I will do so after lunch.
@Ali Caglayan : I did some tests. The issue with installing under user-contrib/'' can be solved by setting:
-R theories HoTT
-Q contrib HoTT.contrib
One can of course use any other path like e.g. HoTT.book.
Btw.: The HoTTbook files need to be adjusted to Require HoTT.HoTT, otherwise they won't run.
I would put a suitable _CoqProject file into the HoTT book folder, so that people can open the files from there from CoqIDE without issues. One can handle this as an extra install command in the opam file.
And is discussed in the PR, I was assuming that this is a release PR - that's the reason I was so picky. It has to be a release PR if you want to use it in Coq Platform without copying it there.
If you want to keep it in extra-dev, it should be named .beta and not .dev, since it is not a classical dev package (which would target master and not a specific commit or tag).
@Ali Caglayan I see you are not passing -boot
to Coq, do you want to keep the Coq.*
prefix in scope?
I recommend you don't keep it unless needed, this way you can just have coq-hott depend on coq-core
Yeah, so passing -boot
makes things much more complicated here
I need to then explicitly find the ltac and numeral notations plugin
or at least get _CoqProject to point to them
in my testing, everything was working fine without the flag
I see, you want to keep only the -I part
makes sense, tho note that if we manage to for 8.14 you can hopefully still depend only on coq-core and avoid locating the plugins
@Ali Caglayan : are you doing the changes I suggested to get rid of the files under user-contrib/'' ?
(deleted)
as when https://github.com/coq/coq/pull/14019 is merged you can just do Require ML Module "coq.plugins.ltac"
and Coq will find the plugin for you.
@Michael Soegtrop Yes, I'm taking a look now
I'm not super sure what to do about the fact that this is a dev package however
Just move it to released and remove the .dev extension.
We can test it in Coq platform before we inally commit it, but if it is used during the Spring School, there is no good reason for not making it a release package (except that it should point to a HoTT tag then).
I undertsood you such that you plan to do a HoTT release based on the commit after testing it.
Yeah, I can do a release for that
let me get the changes to _CoqProject sorted first
But lets' wait until everything is nice and clean in Coq platform.
OK fine. I would think that this is the most user friendly HoTT version so far, so it makes sense to officially release it.
OK just checking nothing is breaking: https://github.com/HoTT/HoTT/pull/1433
my local tests seem to indicate it is working as expected
once the ci for HoTT is green I will merge and then we can experiment with an opam release
@Ali Caglayan : you might want to choose a folder name like HoTT_book, so that people find it. Also please remember to edit the files such that they actually work with a HoTT in user-contrib and provide a _CoqProject file one can copy during opam install.
Contrib sounds more like "stuff you might want to look at much later".
Ah but I was weary of including contrib to begin with. In general, I don't think anybody in the HoTT library wants users to use those files.
Then I suggest we use a separete _ContribProject file and forget about it when we install
How does that work?
You can think of the files in Contrib as almost being documentation
anyhow, I think keeping the files in HoTT.Contrib is fine for now
doing what mattieu suggests will complicate things on our end for now
Ah OK, I thought this was a nice tutorial on HoTT users would like to find.
Yeah its just a pointer to places in the library which correspond to definitions/results from the HoTT book.
@Ali Caglayan : if you don't want to install Contrib in opam, you have the following options:
coq_makefile -f _CoqProjectContrib -o CoqMakefileContrib
and mane accordingly.Yeah they both seem fiddly for now, I will keep them installed as they do no harm
OK. If users are not supposed to find them easily, HoTT.Contrib is just fine.
Then of cause there is also no need to make them run from CoqIDE.
(easily)
speaking of CoqIDE, did you test HoTT with it?
I got it working yesterday, but today I am having trouble
Yes, sure. Works fine as long as you have a _CoqProject file with the two options.
Just tested it now, it's working again
earlier it was getting confused with Coq.Init.Prelude
Note that when you create a new file within CoqIDE, it won't pick up the _CoqPlatform file. You have to close it and open it again.
It reads the _CoqProject file only on file open.
yes, I suspected as much
Also stuff in scratch buffers won't work.
scratch buffers seem to work for me
but I am running from the _CoqProject directory so maybe thats why
Possibly.
One just should tell users that the pick up of the _CoqPlatform file does not work in some cases, and then a close + open fixes it.
@Michael Soegtrop Alright how is this: https://github.com/coq/opam-coq-archive/pull/1671
I haven't created a tag yet in the HoTT library so we can definitely be sure it works
Thanks, I will test it today and tomorrow. Are you available over the easter days? I plan to finalize the DMG package, so that we can do a new Platform release early next week.
@Enrico Tassi : you said that there will be a new Coq patch release. Do you have a schedule for it?
The pr is merged https://github.com/coq/coq/pull/14005 I will backport it today and see if I can tag.
Next week I will be busy, but If you do the release I can find a minute to upload the snap an sign windows pkg
@Enrico Tassi : sounds good, so let#s plan for that.
@Michael Soegtrop I should be available over Easter
@Ali Caglayan : good - I will ping you here every now and again ...
@Ali Caglayan : sorry, the Mac stuff took a bit longer. I am currently testing your package. It points to master, rather than a specific commit. Which commit should I test (the one you want to tag)?
I would also need one file from the repo to test for the smoke test kit. The file should run through in no more than 10 seconds and do some not entirely trivial HoTT.
dd3c399d6c6c9275c3f4b9feee46925f8f415f49
https://github.com/HoTT/HoTT/blob/master/theories/Homotopy/BlakersMassey.v
@Michael do you already have a coq-platform release I could point to? We're opening the school tomorrow, letting the students prepare and it could be nice to have it, although I already have functional releases with just HoTT.
@Matthieu Sozeau : not yet, but likely around noon - the installers will be unsigned, though.
@Matthieu Sozeau @Ali Caglayan : one note: as a test I did put a _CoqProject file with the proper options into the Coq Platform install folder of HoTT. This allows people to open and run HoTT files from the install folder in CoqIDE - which can be a great help to understand things. But this does not work for all files, because some files reference HoTT files without the HoTT prefix. It would help users to change all files such that this does work. As examples:
Homotopy/Join.v
ExcludedMiddle.v
Require Import Hott.XYZ
.Btw.: the recommended test file doesn't work either for this reason: it has: `Require Import HoTT.Basics HoTT.Types HProp.. The first required module name is fine, the second not. I will choose another file to make CI happy.
I picked theories/Analysis/Locator.v
.
I think that's fair to ask for cleanly qualified names in a library.
Maybe the From HoTT Require ...
syntax helps to keep the require statements readable.
Ah ok, so this causes problems outside of the library
Jason has a script that can qualify modules IIRC
@Ali Caglayan : it won't cause problems for people using HoTT as a library. But it causes problems for people who want to load a file from the HoTT library and single step through it to understand the proofs without locally recompiling HoTT. I would expect that for HoTT this is something people might want to do.
If one adds a _CoqProject file to the root of the HoTT install folder and fixes the Require statement a user could load any file from the HoTT installation or from downloaded compatible HoTT sources and just step through them. I find it rather annoying if I have to recompile a library to do that. And even then it is not always easy, because one has to figure out the correct -Q and -R options for CoqIDE.
So under the line this improves the situation for HoTT learners considerably.
The problem is that some of our developers like to write short and snappy requires. I agree that it is better to fully qualify names but I also sympathise with people who do not like to do this.
Last year we discussed changing the requires to their full length, but I don't think we reached a consensus.
Is Coq really not able to elaborate the module names? It looks to me like a useful feature.
Actually From ... Require has -R semantics.
So all you need to do for having things work technically is to prepend all Require statements which are not qualified with From HoTT
.
I suppose this works, but from the point of view of writing the library it seems a bit silly to write From HoTT
everywhere in it?
But I can give it a go in a branch and see how it works if you like
Well it is a question of coexistance. E.g. some files have a Require Basics. But there is a Basics.v in the standard library and you will get this then.
Actually I think this is something you want to fix for the school. It really makes the live of people who want to learn this unnecessarily hard.
Ali Caglayan said:
I suppose this works, but from the point of view of writing the library it seems a bit silly to write
From HoTT
everywhere in it?
Agreed. I think it was indeed discussed recently that the semantics should be that From X
is implicit whenever you are working on X
.
Eugh, some of our files already have the HoTT qualification which makes my life harder
@Théo Zimmermann : but how would you do this technically? Say someone is downloading the HoTT sources, opens a file in CoqIDE and wants to step through them? How is Coq supposed to know that you are in HoTT? Maybe a _CoqProject file would help if -Q and -R would support relative paths. Another option would be to have a statement just From HoTT.
or whatever Syntax, which sets a default From.
@Ali Caglayan : I have an awk
book, so it probably doesn't take me longer than 10 minutes. Shall I do it?
Yes, basically the _CoqProject
file -R
/ -Q
option would do the job (they do support relative paths of course, what do you mean by your point about this?)
I'll try one more thing first
@Théo Zimmermann : I mean they would have to support relative paths with respect to coqc -where
and not relative to pwd
.
Some time back I suggested to add a -V option which would be like -Q but relative to coqc -where
.
Well coq is complaining here: We have a line like Require HoTT.Tactics
in a file, so I went and removed the HoTT.
to get Require Tactics
and then replaced Require
with From HoTT Require
, but now coq complains about From HoTT Require Tactics
since Tactics
is ambiguous
@Ali Caglayan in such cases you either use Require without From or you give a longer Path with From, which makes the files unique.
If the fullname is HoTT.Tactics
, I don't think you have any solution with From
.
@Michael Soegtrop I can't make that one longer though, since From HoTT Require HoTT.Tactics
won't work
Let me check. Which file are you at?
Categories/GroupoidCategory/Morphisms.v
for example
Ok so if I decide to leave the HoTT.
in I run into more trouble, because some Require
statements are doing multiple: Require HoTT.Basics Foo.bar
So now I would have to split those up...
Yes, mixed requires need to be split - at which point AWK or whatever tools Jason has might become useful.
This is what I did for reference:
ali:~/HoTT$ find theories/ -type f -name "*.v" -exec sed -i 's/HoTT.//g' {} \;
ali:~/HoTT$ find theories/ -type f -name "*.v" -exec sed -i 's/Require /From HoTT Require /g' {} \;
Not sure if this is going to work ...
Yeah it doesn't :sweat_smile:
It is indeed nasty because you have so many duplicate names
I guess one needs to look into the .d files to get this sorted out.
For example you have this:
./Categories/Category/Sigma/Core.v
./Categories/Category/Core.v
There is no way to require the second file with From Require without a warning.
Wouldn't From HoTT Require Category.Core
work in this case?
Ah yes ...
@Ali Caglayan : so for the file you mentioned, this does work:
From HoTT.Basics Require Trunc Equivalences.
From HoTT.Categories Require Import Category.Core Category.Morphisms Category.Univalent GroupoidCategory.Core Tactics.
Yeah typically with names like Core they will be qualified as they appear in a lot of places in the library.
Originally it was
Require Import Category.Core Category.Morphisms Category.Univalent GroupoidCategory.Core.
Require Import Trunc Equivalences HoTT.Tactics.
But I messed it up, you have to use:
From HoTT.Basics Require Trunc Equivalences.
From HoTT.Categories Require Import Category.Core Category.Morphisms Category.Univalent GroupoidCategory.Core.
Require HoTT.Tactics.
I got the wrong Tactics file above.
So as I said, since it is that complicated I would look at the .d files and create the Require statements from that.
I like the idea of having a From HoTT.
statement that sets the default form.
Maybe it could even be inherited on import, that way we only need one From HoTT
in the whole library
But I guess it wouldn't work for the level of complexity you have in HoTT.
So how shall we proceed? Do you have the scripts from Jason you mentioned?
I think I am misremembering then
I can't find Jason's scripts
I can only find one which minimizes requires and imports
Oh no it exists
https://coq.inria.fr/related-tools.html
at the bottom
https://github.com/JasonGross/coq-tools/blob/master/move-requires.py
There are quite a few scripts there that might be useful
Looks too simple to be likely to work.
I guess there is no way one can get the Require statements right without looking into the .v.d files. One needs some artifacts which have info from what the -Q and -R options where during compile.
Yup. I dream of a day where we can program such things in MetaCoq :)
Just load the .vos, crawl the environment and output the minimal dependencies for each file
Even coqdep is not good enough because it relies on the Imports in the file, some of which might be unnecessary
You can't tell which imports are necessary, there can be arbitrary notations, hints, etc in there
Well I would take the Require statements from the files and just figure out the proper qualification from the .v.d files.
I'm not having much success with Jason's scripts
Of course that would require knowing something about the libobjects too, hence we couldn't do it today
@Ali Caglayan : I expected that. If you want I can have a look at it.
That would be great
OK, after lunch ...
Btw.: The Coq Platform Test CI ran though - including smoke tests on Windows and Mac: (https://github.com/coq/platform/pull/99). You can download full Mac, Windows and Linux installers from the CI artifacts.
(I used a local HoTT opam file in the patch repo).
Great news!
@Ali Caglayan : sorry I was busy with other things ...
I had a look at Jason's tools and I think you just picked the wrong one.
This does work (in the HoTT folder - adjust the path to the python script):
python2 ../coq-tools/absolutize-imports.py --update-all -f _CoqProject
It doesn't introduce From
prefixes but makes all paths absolute with HoTT prefix. IMHO that doesn't look that bad and might even be more informative to non expert users. I would suggest you take a look yourself.
Automatically introducing Form statements is more tricky than making paths absolute, because one need to consider if a path is unique or not with a From. After looking at it in more detail, I would actually advise against using From
for HoTT - it might be error prone cause of the duplicate names.
Example before:
Require Import HoTT.Basics HoTT.Types HProp.
Require Import Extensions HoTT.Truncations.
Require Import Modality Accessible Lex Nullification.
and after
Require Import HoTT.Basics HoTT.Types HoTT.HProp.
Require Import HoTT.Extensions HoTT.Truncations.
Require Import HoTT.Modalities.Modality HoTT.Modalities.Accessible HoTT.Modalities.Lex HoTT.Modalities.Nullification.
I think it might be a feasible workflow for you to let developers write what they want and then run Jason's tool over it before each release to normalize it.
As I said, I do find it more readable that way, and I think code should be optimized for readability.
FWIW, I can run HoTT on the provided MacOS Installer from the CI just fine
@Matthieu Sozeau : yes, this is expected. As I said above there is no issue with using HoTT as a library with the Requires as is. What does not work is open a HoTT library file in CoqIDE and step through it. This is something learners might want to do.
Indeed, that could happen
So especially for a HoTT school one might want to change this.
Applying Jason's script as above fixes this.
Also for a new comer the short require statements are hard to understand. It does help to be explicit here and tell which module comes from where.
Excellent to hear that you got that script working! I also tried that one but it looks like you are more patient then me :-)
I'll try and do a PR later
I hope @Matthieu Sozeau agrees to this change. If so please tag it after the change - I can update and merge your opam PR then.
I'm fine with it!
@Ali Caglayan : any progress with this? This should be really quick. I can also make a PR for it.
Sorry I didn't have the time for it, I can quickly do it now
OK. I can take care of the opam packages as soon as you have a tag.
The script is taking some time to run!
Ah the way you called the script caused Basics to get extended to Coq.Program.Basics
I need to set the coqc and try again
It took roughly half an hour to finish it last time
I also need it to stop crawling in the coq submodule
That seems to have imporved the timing
OK I finally got the script to work. It actually doesn't take long at all, the reason it was taking so long was because it had so many errors to output.
I really didn't think about building the library first...
But now it looks like it has worked I will crate a PR
Why doesn't -R theories HoTT
in the coqproject work?
@Gaëtan Gilbert Can I have some more context?
IIUC the goal is that after installing the platform users can open the installed hott .v files and run them interactively
to do that it should suffice to have a _CoqProject file nearby with the right arguments
I didn't test this myself but:
Michael Soegtrop said:
Matthieu Sozeau Ali Caglayan : one note: as a test I did put a _CoqProject file with the proper options into the Coq Platform install folder of HoTT. This allows people to open and run HoTT files from the install folder in CoqIDE - which can be a great help to understand things. But this does not work for all files, because some files reference HoTT files without the HoTT prefix. It would help users to change all files such that this does work. As examples:
- Does not work:
Homotopy/Join.v
- Does work:
ExcludedMiddle.v
It is currently not possible to have dynamic absolute paths in _CoqProject files nor is it possible to specify relative paths in -Q and -R options, so there is no easy other fix than changing all files to consistently useRequire Import Hott.XYZ
.
So it seems there is a correct _CoqProject but it still doesn't work
doesn't that just mean the _coqproject had incorrect options?
and why would it use absolute paths?
It could be
Michael Soegtrop said:
Théo Zimmermann : but how would you do this technically? Say someone is downloading the HoTT sources, opens a file in CoqIDE and wants to step through them? How is Coq supposed to know that you are in HoTT?
Umm, because the file is in the HoTT directory? I must be missing something.
@Ali Caglayan : I guess you are doing something wrong. For me the scripts takes just a few seconds to run.
@Gaëtan Gilbert : a _CoqProject files does not work, because it does not support to have relative paths to coqc -where
. So one would have to adjust the _CoqProject files to the real absolute paths, which is a bit tricky in installers.
@Mike Shulman : also a frequent scenario is that people git clone the same or close version as the installed one and step through that.
@Ali Caglayan : let me just do a PR for that.
Actually it takes less than 1 second to run ...
But you need to build before (in the same way as opam does), so that the information is available. Possibly if you do this without building first, the script does something else.
Are you saying that if they git clone a different version, then it wouldn't know which version of the files to load with require? But the cloned version will be in its own directory. Coq doesn't ordinarily have trouble looking in the current directory first to find files to load, so why is this any different?
@Ali Caglayan : https://github.com/HoTT/HoTT/pull/1445
I think Michael would want to use the compiled version if you clone the repo locally. I'm far from convinced that this is a good idea.
@Michael Soegtrop I already had a PR up: https://github.com/HoTT/HoTT/pull/1444
@Mike Shulman : you are looking at this from the perspective of a HoTT developer, who has a local nicely compiled build. I talk about students who hardly know how to build the stuff but want to single step through code.
Sorry if I didn't make it clear, I managed to get the script to work
@Ali Caglayan OK, then please close mine. But honstely I don't know what you are doing here. It really takes just a minute all together including a clean test building after the change.
Yes, I hadn't built the library first
It runs in under a second like you said
Sorry, I didn't read the last lines of your comment.
I'm actually going to close my PR since something got broken along the way
OK, I reopen mine then ...
Sorry about athat
No issue. I will put a few comments into mine how it was done (for reference).
Wait a minute, @Michael Soegtrop, are you saying that if there is a local compiled version of HoTT, and someone copies a different version of one file from somewhere, you want them to be able to step through that file and have it load the local compiled version of the files it Requires?
That seems to me like a terrible idea; a different version of a file coming from a different version of the library would be likely to also depend on different versions of the other files in the library.
@Mike Shulman : what I want is that if someone copies any HoTT file from the installed version somewhere where the is no _CoqPlatform file around which tells to do something else, that (s)he can step through it.
Students do want to experiment and this should be made easy without knowing how to clone / compile HoTT.
Say you have HoTT installed via Coq Platform. Now you can just go to GitHub, download a single raw HoTT file and step through it.
use the hoq scripts, otherwise you won't get -indices-matter etc
If you want a _CoqPlatform file to work it usually means you have to make a local build. I want people to be able to step through the code without making a local build.
Having fully qualified paths doesn't do anything bad to developers.
@Gaëtan Gilbert : yes you need a _CoqProject file which adds these two arguments for HoTT. The hoqc scripts are gone.
Well not gone as of yet, but not necessary to build the library
@Ali Caglayan : afaik the opam package does not install them.
Yes, but using the hoq scripts is still the recommended method in the git repo
I just haven't gotten round to doing that change yet
But for someone who is using the library through Platform and doesn't care about compiling HoTT it makes no difference
OK. I was talking about what is in Opam / the Coq Platform.
Yep, I was just making sure everybody knew what was happening :-)
So let me summarize, since the discussion took a few turns:
Michael Soegtrop said:
what I want is that if someone copies any HoTT file from the installed version somewhere where the is no _CoqPlatform file around which tells to do something else, that (s)he can step through it.
Why? Why can't they just leave it in place and step through it there?
And yes, one still needs a _CoqProject file, but it contains only the two -arg options.
Why? Why can't they just leave it in place and step through it there?
As I said, because this only works if you make a local build upfront, which is not easy to do for students.
Doesn't it work if you run it from the place where it is installed? (If you install both the .vo and the .v)
Anyway, I think there is something wrong with the assumption that any HoTT library file will be interesting to students.
IMHO There should be a few well delimited example files with the From HoTT
statements so that you can load them with an installed HoTT.
@Théo Zimmermann : that would be possible if one installs a suitable _CoqProject file. But at least on Mac the files are not easy to find. You need to tell macOS quite explicitly that you want to see the contents of an installed package.
Right
Well I can only talk of my experience. I frequently want to step through files to understand them and it is sometimes not easy - even with the above average experience in building stuff I have.
This is nothing specific to HoTT.
So really what we are doing is working around broken behavior of macOS?
@Mike Shulman : no. The files are not easy to find under .opam in Linux either.
You won't find them unless you know very well where to look.
Anyway, why is taken so negatively to just make Require statements more explicit, so that both average humans and machines can digest them better.
Huh. It just seems wrong to me to require all the files inside the library to refer to each other with fully-qualified names.
It makes the import statements much harder to parse visually for a human, and much more annoying to add new requires when needed.
Well I would say that with all the duplicate names, it does make it easier.
We generally already qualify duplicate names.
Sufficiently to disambiguate.
You can parse something quicker, but you will need much longer to understand what it really means.
Well I would say it is an issue with the From syntax, that it doesn't work well with the file structure of HoTT.
It would indeed be nicer to have From HoTT
everywhere and then be relaxed, but this doesn't really work for HoTT. Files in the top level folder would still have to be referenced as Require HoTT.XYZ
.
Sufficiently to disambiguate.
If you have been working with HoTT for a few months: yes. For new students: no.
Is that just because of duplicate names?
The problem with From
comes from duplicate names, yes.
Michael Soegtrop said:
Sufficiently to disambiguate.
If you have been working with HoTT for a few months: yes. For new students: no.
How is it harder than finding a file from a relative path name?
Things like HoTT.A
and HoTT.B.A
.
How is it harder than finding a file from a relative path name?
In HoTT you specify the tail of the qualification, while new comers would be more interested in the head of it.
Isn't the "tail" precisely what a relative path name does?
Isn't the "tail" precisely what a relative path name does?
Well yes. That's the reason why in my PR all paths are absolute below HoTT.
If I'm in the directory A/B and I write C/D.v, I know that I mean A/B/C/D.v and not A/E/C/D.v.
Even though C/D.v is the "tail" and I've omitted the "head" A/B.
Are you saying that your students don't understand relative path names either?
Well you know this, but an unexpereinces reader which has seen some C/D.f before might assume that it is that same C/D and not a different one.
To digest that properly, one actually first has to know that there might be two different C/D. Many users won't have this knowledge.
Mike Shulman said:
If I'm in the directory A/B and I write C/D.v, I know that I mean A/B/C/D.v and not A/E/C/D.v.
I don't think that's how Require works
I don't think that's how Require works
Well that's how it is set up in HoTT with lot's of folder local -Q and -R options.
What do other Coq libraries do? Do they fully qualify all imports? Or treat module names as globally unique?
Other libraries generally do not have duplicated names.
I would say HoTT as pretty much at the extreme end of having duplicate names.
Michael Soegtrop said:
I don't think that's how Require works
Well that's how it is set up in HoTT with lot's of folder local -Q and -R options.
I only see
-R theories HoTT
-Q contrib HoTT.Contrib
in https://github.com/HoTT/HoTT/blob/master/_CoqProject
@Gaëtan Gilbert : I think technically it works by having the second last part of the qualification unique (or fairly unique).
The "folder local -Q -R" is more what is happening in my head when I read HoTT code I guess.
@Mike Shulman : I think the best way to converge between your and my thinking would be to have a few more options for From. E.g. one could have an option to always choose the shortest path after the From qualification. Then one could always write From HoTT
and leave everything else as it is.
Another option would be to have a From which more works like -Q so that one can put more of the qualification into the From part and group requires this way.
To be honest, I'm surprised because I didn't think that we had that many duplicate file names. Doing a quick search and sort, most of the duplicate names I see are in Categories and Classes, both of which were imported into HoTT from previously separate libraries.
Anyway, isn't the whole point of namespacing that names don't have to be globally unique?
Anyway, isn't the whole point of namespacing that names don't have to be globally unique?
Sure, I am a big fan of naming the main type of a module "t".
What I brought up here are purely practical aspects for students.
I think that distributing HoTT via Opam / Coq Platform brings a few changes in the typical usage patterns of HoTT I think you did not fully adopt to as yet.
Some people approach projects like HoTT more or less by "playing" with them. All I want is that this isn't made harder than necessary.
The number of people who approach this by first reading the docs and then following what is written there might be a minority.
Gaëtan Gilbert said:
I don't think that's how Require works
Indeed, I see this now looking at the docs:
-R path Lib
associates to the file /path/fOO/Bar/File.vo the logical name Lib.fOO.Bar.File, but allows this file to be accessed through the short names fOO.Bar.File,Bar.File and File. If several files with identical base name are present in different subdirectories of a recursive loadpath, which of these files is found first may be system- dependent and explicit qualification is recommended.
It's very counterintuitive to me that name resolution of required files pays no attention to the location of the requiring file in the directory tree, but I guess it's at least consistent with this idea that one ought to be able to pick up a file from anywhere in the library, drop it somewhere else, and still load it.
My point is that if the design of the Coq tools essentially forces module names in a library to be globally unique, then something is wrong with that design.
@Mike Shulman : the names need to be unique inside of the Coq standard library and inside of each development like HoTT but not between developments.
I still maintain that something is wrong with that.
With the standard setup you can't access a HoTT file without HoTT prefix from the outside.
Anyway, as regards practical solutions moving forwards, this may be my favorite of the options mentioned, if I understand it correctly:
Another option would be to have a From which more works like -Q so that one can put more of the qualification into the From part and group requires this way.
Another option would be to have a From which more works like -Q so that one can put more of the qualification into the From part and group requires this way.
Yes, but this would have to be implemented in Coq first, so no option for Coq Platform 2021.02.1.
Although always choosing the shortest path after From could work fine too, and might be easier in practice though less informative.
I agree that the module searching of Coq can be improved in various ways. I guess we should open a CEP - there are a few other issues e.g. handling variants (like CompCert for different CPUs) as well.
But I would prefer to have this discussion after 2021.02.1 is out - the Coq release manager @Enrico Tassi is waiting for me to tag Coq Platform and I am waiting for HoTT to tag HoTT - either with or without my suggested change.
If this is highly controversial, we can also have this discussion for the next release and leave things as they are now. All I am saying is that as HoTT is more optimized for HoTT developers than for HoTT users and that this might not be what you want, but in the end this is the decision of the HoTT team.
I guess any Require change will have to wait until we have the dune integration and a single code path for handling them in all the tools.
But I side with Mike on the point that one should not require unique names in a library and rather be able to use informative disambiguation mechanisms.
rather be able to use informative disambiguation mechanisms.
full qualification is a form of that :-)
OK, so let's drop my PR for later.
Right now it works well when you are developing your own library but even then for example extraction is not up to the task in general and can get confused
Yes, absolutely that's just the most extreme form :)
Can then someone please tag #dd3c399d6c6c9275c3f4b9feee46925f8f415f49?
I'm certainly open to adding some disambiguation to make things easier on users, if From can be modified to make that less verbose than full qualification.
The main issue with From as is is that for top level files which have duplicates one cannot use "From HoTT Require File" but has to say "Require HoTT.File".
If one could avoid to have duplicates of top level files, From might work reasonably well.
Do you mean for the current implementation of From, or a hypothetical modification of it?
I don't think we have very many top level files with duplicate names -- maybe just Tactics and Utf8?
Indeed:
find . -name "*.v" -type f | awk -F/ '{ name=$NF } cnt[name]==1 { print name, fst[name]; } cnt[name] { print name, $0 } { fst[name]=$0; cnt[name]++ }' | sort | grep "^[^/]*/[^/]*/[^/]*$"
Tactics.v ./theories/Tactics.v
Utf8.v ./theories/Utf8.v
without the final grep you get a list of all duplicate files.
So are you talking about the current From
or a hypothetical one? We could certainly rename the toplevel Tactics and Utf8 if that would allow From
to solve the problem; it seems reasonable to put them in Basics anyway.
One thing that puzzles me in this discussion is that this change is not actually needed in the tagged version. If it ended being merged, it would still do the job even if that was after the tag / release.
@Théo Zimmermann : the latest tag (V8.13.1) is not what should go into platform. The latest information from @Ali Caglayan is that we either use dd3c399d6c6c9275c3f4b9feee46925f8f415f49 or something later.
@Ali Caglayan @Matthieu Sozeau : if you want HoTT in the Coq Platform 2021.02.1 I need a tag today before noon. Otherwise I will do a release without it, but likely the next release with additional packages will be in 4..6 weeks.
What I meant is simply that this commit could have been tagged two days ago and all this debate about whether to fully qualify Require
could have happened after. But what's done is done.
Well it would have been especially nice for the HoTT school ... I didn't foresee that this is so controversial.
My point is that it would have had the same usefulness if done after the release.
Hmm OK, that I fail to see because signed installers are also nice for a school, but I guess this opportunity is gone now.
I'm not really sure what to do anymore
Not necessarily gone yet but significantly impeded for sure.
But in the end I need to learn not to do such things in a hurry.
@Ali Caglayan Just tag the commit. It works, no?
@Ali Caglayan : I need a tag.
Or you say I shall use V8.13.1, but before you said I shall use something later.
@Ali Caglayan : or do you mean, you are not sure if you should do the tag with or without the change?
In that case I would say if there is doubt / controversy do it without.
Yeah it feels a bit unfortunate without the change
But then again we haven't fully reached a consensus on it
What both of you seem to not see is that if the point of the change is that users can copy a file from the repo and run it with the platform, then this change will still work even if done after the release.
I thought that thsi would be a non controversial no brainer change, but apparently it isn't, so this needs time to be discussed.
The release does not need this to work.
I will do a tag for today's master
@Théo Zimmermann : "banging my had against the desk" - you are absolutely right
Indeed it even doesn't nee dto be merged - one can say people to get it from the PR branch
By the way I am a bit confused, is 8.13.2 a real version? Or is it an april fools joke?
It is a real version.
I can't find a change log for it, and it was published on 1 Apr
But there is anyway no good reason to tie HoTT versions tightly to Coq versions. Minor releases of Coq are usually compatible.
I guess HoTT depends only on the major version of Coq. So you could have a HoTT 8.13.7 which is the 7th release of HoTT for Coq 8.13.
So please ping me here when the tag is done. The clock is ticking ...
Ok I've created a tag
https://github.com/HoTT/HoTT/releases/tag/CoqPlatform.8.13.1
@Michael Soegtrop
OK I pointed my release to the tagged tar and update the checksum
Hopefully I haven't screwed anything up
You mean in the opam file?
The tag name is a bit odd, but technically it is OK.
OK, CI is through, so I can start with my part ...
Yeah, I don't have too much choice with the versioning. We were sticking to coq releases for our version numbers. So making two releases on the same version becomes difficult. Perhaps it is time to have this conversation again and start numbering our releases.
@Enrico Tassi Any reason why you didn't publish the GitHub release for the V8.13.2 tag?
I was waiting for the packages to show up
I see thanks
But if you want my opinion, you could have just published the release on GitHub with a comment saying that binary installers will eventually be provided by the next release of the Coq platform.
Having published the GitHub release is useful to inform other packagers to update their version of Coq (e.g., Nix, Arch, etc.)
OK, the Coq Platform CI for 2021.02.1 is running ...
@Enrico Tassi : I expect the packages to be available for signing between 12:30 and 13:45 (Mac should be first, Windows takes longer)
great, just point me to the artifact page
I'll then forward the windows packages to inria's signing service
And I'll learn how to sign the mac one for good :)
@Enrico Tassi @Matthieu Sozeau : the Mac OS installer is ready and can be downloaded here (https://github.com/coq/platform/runs/2304424919)
Windows should be ready in 20..30 minutes
@Enrico Tassi : what do I need to do for the snap package?
And why does the snap package only take 20 minutes?
by default it only builds coq
can we skype 10 minutes?
I'll show you
Yes, I am available 13:25. I will send you an invite via email.
I'm super busy, so it will work faster
https://rdv3.rendez-vous.renater.fr/platform-coq
@Matthieu Sozeau are you taking care of signing the mac installer? Did I understand it right?
Yes, I'm working on it this afternoon
great
I'm trying to figure out how to download the installer now, a direct wget doesn't work, any idea?
A wget (https://github.com/coq/platform/suites/2456409472/artifacts/52730843) should work ...
I use scp to the osx worker, but wget from it works as well
if you use curl, don't forget -L, since GH bounces you a little
It just doesn't
Maybe there's an option to add
Indeed, let me check ...
I guess you need a browser.
If your are on a console machine I would suggest to follow Enrico`s advice of downloding it locally and scp it again, but it is a largish file.
Yeah, I'm doing that now
~10 min is ok
You have sufficient upstream bandwidth?
OK
Sorry folks I didn't get the problem with the From
, would anyone be kind to summarize it?
Well, I'm on fiber and only slightly limited by the provider, so it's alright
Oh, last time I did rename the files by hand (for windows) and forgot to update coq.nsi to call the coq-platform_$V_$ARCH.exe
@Michael Soegtrop you should be in CC for the signature, you should receive their reply with the signed files as well
Emilio Jesús Gallego Arias said:
Sorry folks I didn't get the problem with the
From
, would anyone be kind to summarize it?
The issue is that From HoTT Require A.
does not work if there is a module HoTT.A
and a module HoTT.B.A
and there is no kind of disambiguation one could do besides removing the From
and writing Require HoTT.A
.
Since HoTT has such cases, one has to mix Requires with and without From, which is really ugly.
The suggestions I discussed with @Mike Shulman were about what one can do so that one can just write From HoTT Require A
.
@Enrico Tassi : yes, I got the mail, so I will take care of the upload.
@Matthieu Sozeau : I just did the tag and the release, so you can upload the Mac installer now.
(https://github.com/coq/platform/releases/tag/2021.02.1)
Shall I use commit c41cf7dc9607833702213fd7bc8dfc0ce1d0e14d or the latest ?
I have the c41cf7dc9607833702213fd7bc8dfc0ce1d0e14d version ready to sign now
The latest one just changes the online readme file - it has no influence on the installer.
Ok
So it is fine to use c41cf7dc9607833702213fd7bc8dfc0ce1d0e14d
I did things in this order to save some time ...
Ok, perfect
Thanks @Michael Soegtrop , the corresponding Coq bug is https://github.com/coq/coq/issues/9697 , but I am not sure if there is a second one also by @Guillaume Melquiond asking for From Foo Require .A.
Isn't this issue about naming modules in the code, rather than in requires? Of cause one could have the same syntax in both cases and drop the From Syntax. But the proposal in https://github.com/coq/coq/issues/9697 suffers from the same issues as the From syntax - it can be ambiguous.
Or put in another way, for Require
the issue #9697 is solved with the From
syntax.
@Matthieu Sozeau : you are uploading the Mac installer?
Did @Enrico Tassi send the Windows installers to Inria's DSI in the end?
yes
OK great!
Sometimes they answer quite quick, but this is almost the week-end, so not sure about this time.
Yes, I'm working on it. Quite an hectic day here, sorry :)
@Enrico Tassi : I updated the snap package - worked nicely.
great!
(still no news from the signing...)
Well, I should have dropped the Require discussion yesterday and get it done ...
@Michael Soegtrop apparently you updated the latest
track, but not the 2021.02
one. I'll let you fix that, so that you find out how to do that in the UI.
(maybe you did, but forgot to hit "save", it happened to me before)
FTR, it seems we do have some users (185 to be exact):
Screenshot-from-2021-04-09-19-43-11.png
@Michael Soegtrop one thing I forgot to tell you: you should make a personal account on snapcraft.io and then give it the rights to manage the coq-prover package from the settings->dashbord (advanced) interface. The main reason is that the master account, the one I gave you the password to, is linked to a private mailing list here at inria, and if you need to reset the password that is not going to work for you, while for a personal account you can use your personal mail address.
@Enrico Tassi : yes the save buttons are nasty. I will try again after dinner.
Damn, signing broke the package
It tries to find a non-existent coqide.exe
??
Hmm, maybe that's not it
Ah no, the coq-platform dmg is broken from the get go
Even if I explicitely open
it it fails to launch
The Ressources/bin/coqide
inside is fine though
Oh they are definitely not the same coqide files:
#!/bin/sh
-HERE=$(cd $(dirname $0); pwd)
-export PATH="${HERE}/../Resources/bin/:${PATH}"
-export LD_LIBRARY_PATH="${HERE}"
-export DYLD_LIBRARY_PATH="${HERE}"
-export GDK_PIXBUF_MODULE_FILE="${HERE}/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/loaders.cache"
-export XDG_DATA_HOME="${HERE}/../Resources/share"
-exec coqide
+
+# Check if $0 is a link
+if [ -L "$0" ]
+then
+ LINKTARGET="$(readlink "$0")"
+ # Check if $0 is a an absolute or relative link
+ if [[ "$LINKTARGET" == '/'* ]]
+ then
+ BINDIR="$(dirname "$LINKTARGET")"
+ else
+ BINDIR="$(dirname "$0")/$(dirname "$LINKTARGET")"
+ fi
+else
+ BINDIR="$(dirname "$0")"
+fi
+
+# Normalize path
+BINDIR="$(cd "$BINDIR" ; pwd)"
+ROOTDIR="$(cd "$BINDIR/.." ; pwd)"
+
+export PATH="${BINDIR}:${PATH}"
+
+# This setting is required to find the image file format handlers
+# Note: these docs are contradicting on the default path for the "loaders.cache" file
+# https://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-query-loaders.html
+# https://developer.gnome.org/gtk3/stable/gtk-running.html
+# Setting GTK_EXE_PREFIX to ROOTDIR and putting the file into lib/gtk-3.0/3.0.0/loaders.cache doesn't work.
+export GDK_PIXBUF_MODULE_FILE="${ROOTDIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders/loaders.cache"
+
+# This setting is required to find the "Input Method" handlers
+# ToDo: the cache file links to locales, but we don't install locales
+# ToDo: the selection of input methods seems questionable (with MacPorts)
+# ToDo: not sure if this is needed at all on Mac (which should have its own IME)
+export GTK_IM_MODULE_FILE="${ROOTDIR}/lib/3.0/3.0.0/immodules.cache"
+
+# This setting is required to find the adwaita icon theme
+export XDG_DATA_HOME="${ROOTDIR}/share"
+
+exec ${BINDIR}/coqide.exe
The first is from a Platform 02.0 package the later from 02.1
And if I replace the one in 02.1 with the one in 02.0 it definitely works...
@Michael Soegtrop any idea why that happened?
Hmm, I tested it and it did work. Let me check again
Works for me
Indeed the scripts by enrico have been merged so make_macos installer should give the first output. I'm dumbfounded now
Can you check you indeed get the first version?
I get the second and it works
bin$ cat coqide
#!/bin/sh
# Check if $0 is a link
if [ -L "$0" ]
then
LINKTARGET="$(readlink "$0")"
# Check if $0 is a an absolute or relative link
if [[ "$LINKTARGET" == '/'* ]]
then
BINDIR="$(dirname "$LINKTARGET")"
else
BINDIR="$(dirname "$0")/$(dirname "$LINKTARGET")"
fi
else
BINDIR="$(dirname "$0")"
fi
# Normalize path
BINDIR="$(cd "$BINDIR" ; pwd)"
ROOTDIR="$(cd "$BINDIR/.." ; pwd)"
export PATH="${BINDIR}:${PATH}"
# This setting is required to find the image file format handlers
# Note: these docs are contradicting on the default path for the "loaders.cache" file
# https://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-query-loaders.html
# https://developer.gnome.org/gtk3/stable/gtk-running.html
# Setting GTK_EXE_PREFIX to ROOTDIR and putting the file into lib/gtk-3.0/3.0.0/loaders.cache doesn't work.
export GDK_PIXBUF_MODULE_FILE="${ROOTDIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders/loaders.cache"
# This setting is required to find the "Input Method" handlers
# ToDo: the cache file links to locales, but we don't install locales
# ToDo: the selection of input methods seems questionable (with MacPorts)
# ToDo: not sure if this is needed at all on Mac (which should have its own IME)
export GTK_IM_MODULE_FILE="${ROOTDIR}/lib/3.0/3.0.0/immodules.cache"
# This setting is required to find the adwaita icon theme
export XDG_DATA_HOME="${ROOTDIR}/share"
exec ${BINDIR}/coqide.exe
bin$
Are you sure you're trying 02.1 and not something else?
yes
The old file was quiet different and in a different older (under MacOS)
bin$ ./coqc --version
The Coq Proof Assistant, version 8.13.2 (April 2021)
compiled on Apr 9 2021 9:08:16 with OCaml 4.07.1
Well, maybe it's a MacOS issue then, I'm on 10.15.7
Quick online call?
Sure
I send you a link via email
done
@Enrico Tassi : regarding snap: I think I did hit save in the 2021.02 stream, but it restores to version 13 then. I did it 3 times - I can't find a way to update it.
sometimes there is a refresh problem
I see it updated
https://snapcraft.io/coq-prover
OK I have to hit browser refresh manually ...
They seem to have a problem with their page
yeah, there is but I guess
but I see the update in the page above, so I guess it is fine
Regarding Mac: the signing messed up the DMG.
It can't handle the symlink from MacOS to bin folder.
So @Matthieu Sozeau and me copied the script and adjusted it to the different position
There are two shell scripts now - not nice but should work.
I see, well, the usual last-minute hickup
Yes. And don't use "cp -r" on Mac.
The man page explicitly says that it is very unlikely that it does what you want :-P
Recursive copy is "cp-R" on Mac.
If one day you find the name of the chief architect of the macos userland, I'd like to meet him (not really)
Well macOS is older than Linux ...
X
the "unix" one
It is a true descendent of SystemV
Let me see what my ancient SystemV manual says ...
as far as I know, the userland is collage of tools picked from all the bsd variants... to maximamise the probablility something is off
And I'm sorry to say that, but today there is only one unix, so if you do it differently... you are looking for troubles
-R
is better indeed, and anyway it was forgetting the README.html file which was a pity :)
It's nice to see a long list of packages there!
ah ah, posix says -R ;-)
My SystemV manual says -R :-) Well compatibility is really difficult.
https://www.unix.com/man-page/posix/1p/cp/
remark the PROLOG
section
Yes. That's what I meant - it is not always MacOS to blame when things are not the same. But anyway it is a pitty that they are not the same.
@Matthieu Sozeau and all the SPDX record links ...
What I mean in my troll message, was that the userspace of OSX was "crafted" when Linux was already there...
Well but it mostly follows Posix and Unix, and this is older than Linux.
Anyway, citing my son: happy or those who forget what cannot be changed anyway (citing some opera).
I am off for today. Have a nice weekend!
With my academic hat on, I notice that posix does not have -r, but I guess you did not get an error ;-)
Yea, nice weeked, and thanks for the release.
The Mac man page says:
COMPATIBILITY
Historic versions of the cp utility had a -r option. This implementation
supports that option; however, its use is strongly discouraged, as it does
not correctly copy special files, symbolic links, or fifo's.
Do you want me to write an announcement? Or maybe you can post one yourself as soon as windows is there?
I would prefer if you do the announcement.
Ciao.
Earlier versions of this standard included support for the -r option to copy file hierarchies. The -r option is historical practice on BSD
and BSD-derived systems. This option is no longer specified by POSIX.1-2008 but may be present in some implementations. The -R option was
added as a close synonym to the -r option, selected for consistency with all other options in this volume of POSIX.1-2008 that do recursive
directory descent.
The difference between -R and the removed -r option is in the treatment by cp of file types other than regular and directory. It was imple-
mentation-defined how the - option treated special files to allow both historical implementations and those that chose to support -r with
the same abilities as -R defined by this volume of POSIX.1-2008. The original -r flag, for historic reasons, did not handle special files
any differently from regular files, but always read the file and copied its contents. This had obvious problems in the presence of special
file types; for example, character devices, FIFOs, and sockets.
I'll upload the signed macos package tonight hopefully :)
This is crazy ;-)
Ok, but I'll then wait Monday
Indeed, you can see how being driven by compatibility concerns results in a quite confusing situation :)
Well, I mean in the next ~15 mins
We always underestimate how long this stuff takes... I though I would be done with install matters on tuesday....
When is the HoTT school?
Monday, starting using Coq on Tuesday
Plenty of advance then ;-)
But the school is fine, we already have the stripped down packages that work.
signed?
No
I was kidding
Have a nice WE!
Haha ;)
You too
@Enrico Tassi @Matthieu Sozeau : should I upload the unsigned Windows uninstallers until we have signed ones (with a note). Unsigned Windows installers (unlike unsigned Windows kernel drivers or apps) are not that bad - Windows will just pop up a Window stating that the author is unknown.
Matthieu Sozeau said:
We always underestimate how long this stuff takes... I though I would be done with install matters on tuesday....
I hope this will get better now. The issue is that there was one missing piece: the DMG installer and its signing. I expect that this machinery needs much less changes in the future and we can concentrate on the actual content. At least it should be possible to separate working on the machinery and on the content.
I'm fine with that
I'm fine with unsigned ones while we wait
OK, I will upload them then and leave a note
@Michael Soegtrop From my experience handling releases for Coq itself, I would advise:
Both recommendations are minor though.
@Enrico Tassi Maybe you should ping the DSI?
Also, it sounds like this is time to publish the 8.13.2 release on the GitHub repo.
Well, we sent the email at 1PM IIRC, on friday, let's give them 1 working day before pinging them.
For 8.13.2, done!
@Théo Zimmermann : thanks, good hint! I guess it would be best to upfront call the output of CI "_unsigned" and remove that when it is signed.
I'm about to send this:
Dear Coq community,
the Coq development team is proud to announce the immediate
availability of the Coq Platform version 2021.02.1.
The Coq platform is a distribution of the Coq proof assistant together
with a selection of Coq libraries. It provides a set of scripts to
compile and install OPAM, Coq, Coq libraries and Coq plugins on MacOS,
Windows and many Linux distributions in a reliable way with consistent
results. See [1] for the project homepage, and [2] for the new
instructions for getting Coq.
This release is based on Coq 8.13.2 and provides binary installers
for Windows, MacOS and Linux. The next point releases, starting with
2021.02.2, will focus on including more Coq libraries (and no
breaking change).
Highlights for Coq 8.13.2:
- Fix crash when using vm_compute on an irreducible PArray.set
- Fix crash when loading .vo files containing a vm_compute
normalized primitive array
- Fix Ltac2.Array.init computational complexity
Highlights for the Coq Platform version 2021.02.1:
- DMG installer package for macOS
- Homotopy Type Theory library version 8.13
- The Verified Software Toolchain updated to 2.7.1
comments?
Looks good but a few comments:
I think the concentration on the scripts first and the installers later is a bit misleading. How about:
the Coq development team is proud to announce the immediate
availability of the Coq Platform version 2021.02.1, based on Coq 8.13.2.
The Coq platform is a distribution of the Coq proof assistant together
with a selection of Coq libraries. See [1] for the project homepage,
and [2] for the new instructions for getting Coq.
For expert users it provides a set of scripts to compile and install
OPAM, Coq, Coq libraries and Coq plugins on MacOS, Windows and
many Linux distributions in a reliable and extensible way with consistent
results.
For beginners it provides easy to use binary installers for Windows, MacOS and Linux.
The next point releases, starting with 2021.02.2, will focus on including
more Coq libraries (and no breaking change).
Also I would wait until the signed installers are uploaded, unless there is a good reason for not waiting.
Looks better indeed!
The website is now updated to stop special-casing macOS.
Or actually it will be when the last commit is deployed.
Dear Coq community,
the Coq development team is proud to announce the immediate
availability of the Coq Platform version 2021.02.1, based on Coq 8.13.2.
The Coq platform is a distribution of the Coq proof assistant together
with a selection of Coq libraries. See [1] for the project homepage, and [2]
for the new instructions for getting Coq.
For expert users it provides a set of scripts to compile and install
OPAM, Coq, Coq libraries and Coq plugins on MacOS, Windows and
many Linux distributions in a reliable and extensible way with consistent results.
For beginners it provides easy to use binary installers for Windows, MacOS and Linux.
The next point releases, starting with 2021.02.2, will focus on including more
Coq libraries (and no breaking change).
Highlights for Coq 8.13.2:
- Fix crash when using vm_compute on an irreducible PArray.set
- Fix crash when loading .vo files containing a vm_compute
normalized primitive array
- Fix Ltac2.Array.init computational complexity
Highlights for the Coq Platform version 2021.02.1:
- DMG installer package for macOS
- Homotopy Type Theory library version 8.13
- The Verified Software Toolchain updated to 2.7.1
Best regards,
--
Enrico Tassi for the Coq Team
[1]: https://github.com/coq/platform
[2]: https://coq.inria.fr/download
Here the current text, I can surely wait to send it.
Thanks!
LGTM
The installers are there, shall I send it?
Yes, though shouldn't it be announced on the website as well?
Yes, please go ahead!
sent, but I'm a bit short in time for the website
FWIW, Discourse cuts everything after ---
. I've edited your post on Discourse to fix that.
I did not receive my message on coq-club nor on coqdev, but it is on discourse... is inria's zimbra broken? Did you receive the main on coq-club?
I did receive it on Coq Club
ok, then it is my zimbra setup which tricked me. all good
I have the impression it did deduplicate the message... miracles...
Last updated: Jun 06 2023 at 22:01 UTC