-
Notifications
You must be signed in to change notification settings - Fork 20
New auto-configurable Makefile and release system #232
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
Conversation
…aramana_standalone_opam
cbd3fd2 to
02cb04b
Compare
|
Trying a build overriding F*/krml and using my own OPAM root. I also noticed some errors like these: due to stray files in |
mtzguido
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than my comment above, looks good to me. I tested it in a couple of different ways.
|
Yes, I completely overlooked
|
Yes, there can be a problem if a user switches between two different F* while keeping the same Pulse (or Karamel): Pulse's .depend files are not updated. There is no obvious way to fix that without cleaning the Pulse directory, because making Pulse's .depend file depend on the F* executable would not work if the user switches to an F* with an older timestamp. |
|
Does vscode work for anyone? I'm getting errors like this: |
|
Ah, vscode works now after everything has finished building. |
|
Even with
If needed, I can add such a shortcut that will set all such variables to 1. |
This did work for me FWIW. (And I think the shortcut would be nice too!) |
|
Thanks to Guido's comments, I fixed the
|
|
From your unanimous requests, I added a shortcut, |
|
I'm running into a new error now: |
|
Ah, that's because karamel fails to build the first time. But after retrying everparse believes karamel has already been built! |
|
This is because I am not tracking the right witness to declare Karamel correctly built. Let me fix that. Thanks Gabriel! |
TL;DR: This PR:
This PR subsumes #227
New Makefile
With this PR, a user just needs to type
makeand everything will be built: opam packages, F*, Karamel, Pulse, with Z3 automatically downloaded, and all paths set up. Under the hood:downloads the Everest project intoinitializes an opam root inopt/everest(unless already present),opt/opamwith OCaml 5.3.0, andcallscollects the opam package definitions of F*, Karamel and Pulse to install the opam package dependencies. (Thisopt/everest/everest opamcomesinspires from Use a standalone opam root, fuse opam package build intomake -C opt#227)The user can supersede this whole step with their own opam installation (or
OPAMROOT) by settingEVERPARSE_USE_OPAMROOT=1. Then, it becomes the user's responsibility to install the opam packages.opam-env.Makefileto properly set up the environment variables to OCaml and opam (includingOCAMLPATH,PATH, etc.)FSTAR_EXEis not setEVERPARSE_USE_FSTAR_EXEis not set to 1, then the Makefile downloads F* intoopt/FStar(unless already present), compiles it and setsFSTAR_EXEtoopt/FStar/out/bin/fstar.exeIf the user sets
FSTAR_EXEEVERPARSE_USE_FSTAR_EXE=1, thenEVERPARSE_USE_OPAMROOT=1is automatically set because EverCDDL has a plugin that needs to be compiled with the very same OCaml setup as the one compiling F*. (Thus, users can no longer use F* binary packages to build EverParse.)If the user sets
EVERPARSE_USE_FSTAR_EXE=1without settingFSTAR_EXE, thenFSTAR_EXE=fstar.exeby default (relying onPATH)KRML_HOMEis not setEVERPARSE_USE_KRML_HOMEis not set to 1, then the Makefile downloads Karamel intoopt/karamel(unless already present), compiles it and setsKRML_HOMEtoopt/karamelIf the user sets
KRML_HOME, thenFSTAR_EXEis requiredEVERPARSE_USE_KRML_HOME=1, then automaticallyEVERPARSE_USE_FSTAR_EXE=1, because the.checkedfiles in Karamel must match the user's F* install, and EverParse is not going to recheck Karamel in that case.PULSE_HOMEis not setEVERPARSE_USE_PULSE_HOMEis not set to 1, then the Makefile downloads Pulse intoopt/pulse(unless already present), compiles it and setsPULSE_HOMEtoopt/pulse/outIf the user sets
PULSE_HOME, thenFSTAR_EXEis requiredEVERPARSE_USE_PULSE_HOME=1, then automaticallyEVERPARSE_USE_FSTAR_EXE=1, because the.checkedfiles in Pulse must match the user's F* install, and EverParse is not going to recheck Pulse in that case.fstar.exe --locate_z3, or in the PATH, or inopt/z3, then the Makefile downloads it intoopt/z3and updates thePATHaccordingly.This step is skipped if
ADMIT=1is provided (which automatically appends--admit_smt_queries truetoOTHERFLAGS.).dependF* dependency file as done currently. This dependency file itself depends on F*, Karamel and Pulse as determined with internalNEED_OPAM,NEED_FSTAR,NEED_KRML,NEED_PULSEandNEED_Z3variables automatically computed from the presence or absence of the corresponding user environment variables at the beginning of the Makefile.Steps 1 to 6 can be reproduced with
make deps.The only dependencies not automatically built are Rust and system packages that need to be installed as root. For transparency reasons, we describe them explicitly in the README.md, rather than letting
opam depextautomatically install them behind the user's back (also because there is no way for opam to ask for confirmation foropam depextbut not for the rest ofopam install, since we want to skip any user interaction when setting up anything inopt/)Then, the user can automatically set up their Bash environment with
eval "$(make -s env)". This will set up the OCaml and opam environments,FSTAR_EXE,KRML_HOME,PULSE_HOME,EVERPARSE_HOMEandPATHaccordingly. For users' convenience, we provide a Bash wrapper script,./shell.sh, to open a Bash shell (or run a command) with the environment set up accordingly.New release system
This PR defines
.github/workflows/release.ymlso that we just need to push a single button to provide the whole release automatically. This workflow now only uses GitHub-hosted runners, including on Windows. Example runs can be found at https://github.com/tahina-pro/quackyducky/actions/runs/17664901098 (that run has not been fully configured with Visual Studio Code yet, however) and https://github.com/tahina-pro/quackyducky/actions/runs/17686176690 (fully configured with Visual Studio Code, but with a custom version number that I set by hand at tahina-pro/quackyducky@32bbc76 and that I reverted by hand at tahina-pro/quackyducky@312d0bc)User inputs:
_release).The repository and branch for F*Then, when hitting the "release" button from a branch (called the "running branch" hereafter):
_dzomo_release_NNNNwhereNNNNis the run ID (the number followingactions/runsin the run URL.) This branch merges the release branch, commits the contents of the F* source package, andcreates submodules for Karamel, Pulse, Everest and opam-repository (which allowsusesopam lockto freeze the versions of the opam packages used to build everything)intoopt/. Then this branch creates a version number of the formvYYYY.MM.DDand writes it intoversion.txt. Please note that the hashes of F* (from which the GitHub workflow creates a source package), Karamel and Pulse are already assumed to be recorded in the running branch, usually via thenightly.ymlworkflow (ormake -C opt advance).The user can produce a specific
version.txtor specific copies ofEverest, Karamel, etc. intoopt/on the running branch before starting the workflow. In that case, the workflow will use those instead, but then the user needs to manually remove those copies from the release branch at the end of the release process, otherwise future releases will fail.version.txtfor the version number. We also perform interoperability tests between binary packages to check that the hashes produced by 3D on one platform can be checked with--check_hasheson another platform. Binary packages are pushed as run artifacts.ghcr.io/project-everest/everparse:_dzomo_release_NNNN. Then, a fullmake testis run in a container based on that image.vYYYY.MM.DD, corresponding to the version number inversion.txt:dzomo_release_NNNNimage, the only difference being that the Git clone within the Docker image is now tagged with the version tag as well.Caveats:
Documentation
This PR updates the README.md with all build instructions.
Since dependency build has become much easier for the user, this PR removes the whole "build" chapter from the manual.
This PR also updates the Visual Studio Code configuration files: now, the user is assumed to call Visual Studio Code from a shell suitably configured with
./shell.sh