-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust makefile and build instructions to platform supplied compcert, flocq, ... #406
Adjust makefile and build instructions to platform supplied compcert, flocq, ... #406
Conversation
There's a problem: our travis-ci continuous integration fails The error message is,
It seems like the opam installation of CompCert does not have a VERSION file. |
Sorry, yes - you don't have the patched CompCert as yet. There are a few ways to fix this: 1.) Wait until PR (coq/opam#1246) is merged and then use the platform-flocq variant of CompCert I can do any of these. Which one would you prefer? I would think 2.) is most flexible long term. I would prefer 2.a) in case it works (I think it should). But I must admit I don't fully understand what is going on. CompCert 3.7. does install a VERSION file, but since there is no opam file for CompCert 3.7, I guess you are using CompCert 3.6 - I am not sure what this does. One more note: I replaced the use of CompCert |
622dbde
to
cd7ba67
Compare
I implemented method 2a, that is provide a folder with patched opam files within the VST git tree. I think you will need this from time to time when by default using libraries from opam, so I think it makes sense to keep this as general mechanism. In case no patches are required, the folder can just be empty. I think this would work now (VST starts to build and gets pretty far) but travis times out because a full CompCert build is done now which takes about 13 minutes. Can you extend the travis time (it is 50 min) or is this a hard limit? |
That's a hard limit. What could be done OTOH would be a setup to cache the build output of CompCert (especially if it's a fixed released version rather than a moving target). There are several ways this can be achieved. One way is through Nix + Cachix and another is through opam + Docker (cc @erikmd). Let us know if you are interested in hearing more. Another (less optimized) solution is simply to move to another CI provider that allows longer build times. For instance, we now have good support for GitHub Actions (thanks to @erikmd) and it allows 6-hour-long builds. |
I am in the process of switching from travis-ci.org to travis-ci.com where Princeton University has a paid account. Therefore it might be possible to relax the 30-minute restriction. However, I have some concerns about this: I really would like to avoid building all of CompCert in the VST CI, when only a few files (leading up to the specification of the Clight semantics) are really needed. It might also be possible/advisable to switch from travis-ci to GitHub Actions, where Princeton University also has a commercial account. |
Mid term (within < 6 months) the goal is to have a platform installer which automatically looks for precompiled binary packages at least for common platforms. This would solve this on average, but the CI system should still be able to build from sources, in case a binary package is not yet available. One can of cause also think about having a strip down compcert package in opam and stating that VST can live with either the full package or the strip down package. Let me see if I can prototype this here. Btw.: I also plan to do a 64 bit compcert package. The current opam package always installs the 32 bit version for the host OS/platform. |
There's another advantage to a stripped-down CompCert package in opam: That stripped-down package is fully open-source, whereas full CompCert is not open-source. |
That is an option indeed, although most people would need clightgen. One could create separate packages for the compcert frontend and for the clightgen binary. I have to see what changes in the CompCert makefiles this would require. Btw.: the 64 bit part shouldn't be an issue - I will create CompCert-64 opam packages. Regarding the compcert.ini file (which is currently blocking the CompCert opam PR): it seems to go into the direction of creating a separate file with configuration information for Coq-end users of CompCert. So I guess I can update this PR soon. |
I believe the clightgen binary is now covered by the open-source license. (Look at CompCert/LICENSE -- everything in the exportclight directory is dual-licensed.) This was not previously the case, but it has been true for at least a year now. |
That's good to hear. @MSoegtropIMC In this case, does it make sense to continue distributing the full CompCert as part of the Coq platform (as opposed to distributing a fully open source platform that would only contain the open source core of CompCert, since this is what VST needs anyway)? |
That would definitely require confirmation - I will review and discuss this. I won't comment about the implications before I confirmed this. |
I don't think this is the case - at least not when I look at what is used when I build just clightgen. The dependency resolution in the compcert makefile is automated, so this seems to be what is technically actually used. You can build (after configure) just clightgen with
This includes many files which are not open source. Of course it might be that there are not necessary dependencies, but this would need a deeper analysis. Anyway, I think we should ask what the intention is. I will create one more opam package:
which just contains the open source part as per LICENSE file. Let's see if this is sufficient for VST. I make this a coq-compcert "version" so in case VST can live with it, VST can take either variant. |
I suspect that the clightgen depends on a certain "extraction" file that is common to both clightgen and ccomp; and that it might be possible to reconfigure the extraction process so that clightgen depends on only the open-source files. But this would take some investigation. |
Correction: clightgen is not open-source, because it relies on the SimplExpr and SimplLocals passes of CompCert, which are not open-source. |
@palmskog : can you please have a look at the opam installation in the travis log - I don't understand this. I have:
but I get
Search and replace tells me that the version listed by I also thought about making separate packages |
P.S.: locally this works fine - maybe I should check the opam version on travis. Btw.: the local opam repo in VST CI is intended to be just temporary. I did this to give @andrew-appel the flexibility he might need when working with a platform approach for testing changes to e.g. compcert opam packages in VST CI while they are published (as in this case). The repo and repo registration in CI is intended to stay, but usually it should be empty. |
@andrew-appel : since I can't reproduce this issue locally, I would need a bit of random testing on your Travis CI. Would this be a problem, e.g. do you have project limitations? We can also wait until the opam compcert PR is merged which might resolve this issue. |
Go ahead and test in travis-ci, there are no global limitations, only the per-job limitation of 50 minutes. |
d6242ce
to
2e748c1
Compare
@andrew-appel : Two notes on CI reliability:
|
@andrew-appel : can you please help me with the failure of the 64bit progs check? Otherwise CI seems to be fine now. Is this an incompatibility with CompCert 3.7? |
661f662
to
c547c88
Compare
beab17d
to
2afdd6b
Compare
@andrew-appel : I enhanced the makefile to support various sources of CompCert, including the two bundled variants, platform supplied variants (default) and also arbitrary sources and installations. I tested all this locally. It might make sense to add a travis test for at least the usual bundled CompCert variant and maybe another one for a few ARM platforms. I hope the make interface and documentation are reasonably clean. The bundled compcert_new variant does not build - as far as I can tell there are simply missing files in the compcert_new folder. One note: it might make sense to revise the way VST configures CompCert. It should support substantially more architectures than you can configure this way. With the makefile as is, it should work to point it to arbitrary pre compiled CompCert instances, but it VST compiles the CompCert files it needs, this is substantially more restricted. One option would be to just document this and add a few tests for this to Travis. Sorry for the delay - it was quite a bit of work. The version which is in 8.12 beta should be identical in terms of what it builds, but the make file is different. I think we should leave it like this and aim to get this into the 8.12.0 Coq platform release, which I plan to do during this year's Coq workshop. |
@andrew-appel : did you have time to look at this? |
In BUILD_ORGANIZATION.md, change "nundled_new" to "bundled_new"; change "blow" to "below"; change "does configure" to "configures"; change "teh" to "the". I have pulled this branch, set COMPCERT=bundled, and using Coq 8.12+beta1 it works just fine. If you can merge the master branch into this branch, so that it's completely up to date w.r.t. the master, then we will be completely ready to merge this pull request into the master. |
- register opam-prerelease from VST git as local opam patch repo in Travis - install coq-compcert and coq-compcert-64 opam packages in Travis - Adjusted Makefile to use opam supplied CompCert (Support for building bundled CompCert is commented out and could be re-enabled with little effort) - Cleaned up and reorganized Makefile - Adjusted BUILD_ORGANIZATION.md to relfect these changes
- Added 64 bit CompCert variant - Added 64 bit CompCert variant with coq-platform supplied Flocq and MenhirLib - Added 64 bit CompCert variant with only open source files
3670884
to
62cd7fb
Compare
@andrew-appel : I rebased and fixed the typos. Please note that the instructions don't apply until the VST opam files are in place. Shall I create VST 2.6 beta opam files as soon as this is merged or wait for a release of VST? |
62cd7fb
to
c28d3bb
Compare
Before I answer the question, "shall we make a VST 2.6", it would be helpful to know, "Is there likely to be a new release of CompCert very soon?" Or even a CompCert 3.7.1 updated for Coq 8.12 and for clightgen's new canonical-identifiers feature. Maybe @xavierleroy can advise . . . |
I have tagged the current master branch as v2.6+beta, so you can experiment with making an opam version of VST with that label. |
Perfect, I will do the opam files PR tomorrow. It is anyway not much extra work to do a beta and definitely worthwhile for testing. |
P.S.: I need this PR merged before I can make the opam files. Opam files for current master without this would be quite different. |
Unfortunately the tag is on the wrong commit. How about a tag v2.6-beta-coq-platform? |
I suggest you add that tag to the appropriate commit, so there's no confusion. |
|
@liyishuai : the beta will go into extra-dev. As soon as there is a final release it will go into released. It might make sense to have e.g. a weekly or nightly build of the opam package to see if the dependencies are still in place, but since opam packages usually don't change - one just adds new ones - the risks of failure are pretty slim. |
I was planning a CompCert release early September, perhaps late August. |
I see if this is possible without disabling GitHub's master branch force push protection - I am not sure if this applies to tags. |
The protected branch GitHub feature does not apply to tags. |
Did you need me to tag the master branch? |
@Zimmi48 : thanks for the clarification! @andrew-appel : I will try today evening (in 5 or 6 hours from now). From what @Zimmi48 said it should work. |
@andrew-appel : changing the tag did work. I will create the opam files now. |
This PR does the following changes:
Note: the changes to the makefile look massive, but I mostly restructured it into sections for configuration, flags, file lists, rules and targets. It mostly was already like this but I moved things like configuration variables, notes, checks, ... all into the configuration section at the beginning.
The only real changes are: