This is a work-in-progress document describing the developer workflow for working on the Creusot codebase.
The "Creusot developer setup" sometimes requires more flexibility in how it
looks up why3 and related solvers, compared to the standard "user" workflow
provided by cargo creusot setup install
. You have two options:
- By default the testsuite will use the global Creusot configuration managed
by
cargo creusot setup
. You first need to have successfully runcargo creusot setup install
(orcargo creusot setup install-external
). - Alternatively you can set a custom "developer" Creusot configuration in
.creusot-config/
at the root of the git repo. Start by runningcp -r .creusot-config.sample .creusot-config
. This will tell the testsuite to use whicheverwhy3
binary is in the PATH, but you can also tweak.creusot-config/Config.toml
to point to a specific binary.
The first option is recommended if you simply want a working setup to run the testsuite.
The second option is useful if you need to try custom versions of Why3 or the solvers.
Notes:
- to avoid first installing the
cargo-creusot
binary before runningcargo creusot setup
, one can directly call it from the git repository:cargo run --bin cargo-creusot creusot setup
- the format of the
.creusot-config/
directory is simply the same as~/.config/creusot
, which is wherecargo creusot setup
writes its configuration.
- Test the output of creusot (mlcfg files) against reference files:
cargo test --test ui
Then, to update an out-of-date reference file:
cargo test --test ui -- "optional-string" --bless
- Replay proofs:
cargo test --test why3
Additional useful parameters, to avoid replaying every proof in development:
--diff-from=GIT_REF
--replay=<none|obsolete|all>
If the proof of a test is broken (e.g.
creusot/tests/should_succeed/cell/01.rs
), launch the why3 ide with ./ide
:
./ide creusot/tests/should_succeed/cell/01
To invoke why3 (manually or in scripts) with the same binary/configuration as
setup by cargo creusot setup
, one needs to setup a shell environment with the
correct PATH and environment variables.
To do so, we provide the following command:
eval $(cargo run --bin dev-env)
After that, the why3
binary in PATH will be the one configured by
cargo creusot setup
, using the adequate configuration file (through the
WHY3CONFIG
environment variable).
Edit creusot-deps.opam
to use the hash of the git commit of the latest commit
in Why3's master branch. (But first make sure that the Nightly CI job passes.)
There are several places to edit in the file: the pin-depends
field at the end
of the file (URLs and git-XXXX
versions), and the git-XXXX
versions in the
depends:
field.