Open ehildenb opened 5 months ago
poetry update
after editing the pyproject.toml
files, although make
may take care of that automatically.poetry run -- kontrol
in your local checkout of kontrol
to run the version with your custom changes (rather than the one installed through kup
, for instance).from @ehildenb
You can add TEST_ARGS="--timemout 600"
to a pytest command, for example, to tell it to timeout individual tests after 10 minutes. There isn't another way to timeout individual tests with timeout.
Running the kontrol test suite using docker containers to update the expected output
# from kontrol repo root, export aux vars
export K_VERSION=$(cat deps/k_release)
export Z3_VERSION=$(cat deps/z3)
export IMAGE_TAG="kontrol-image"
# FYI, docker might need sudo rights
# #clean first
# docker container stop kontrol-container
# docker container rm kontrol-container
# docker image rm ${IMAGE_TAG}
# build kontrol docker image
sudo docker build . --tag ${IMAGE_TAG} --build-arg K_VERSION=${K_VERSION} --build-arg Z3_VERSION=${Z3_VERSION}
#start a container using the newly created image
sudo docker run --name kontrol-container --rm --interactive --tty --detach --user root ${IMAGE_TAG}
#copy kontrol repo files to container
sudo docker cp . kontrol-container:/home/user/
# run poetry install in container
sudo docker exec kontrol-container /bin/bash -c 'poetry install'
#build kontrol from source in container
sudo docker exec kontrol-container /bin/bash -c 'CXX=clang++-14 poetry run kdist --verbose build -j`nproc` evm-semantics.haskell kontrol.foundry'
#run test stage, with `--update-expected-output`
docker exec kontrol-container make cov-integration TEST_ARGS='--numprocesses=8 -vv -k "not test_kontrol_cse" -k "not test_foundry_minimize_proof" --update-expected-output'
#run test stage, with `--update-expected-output`
docker exec kontrol-container make cov-integration TEST_ARGS='--numprocesses=8 -vv -k "test_kontrol_cse" -k "test_foundry_minimize_proof" --update-expected-output'
#copy back files
docker cp kontrol-container:/home/user/src .
When developing python code for Kontrol, you usually may need a custom pyk or evm-semantics to run against. To do this, you need to modify
pyproject.toml
to point at the custom version.In particular, you will need:
pyk
, perhaps at/home/dev/src/pyk
.evm-semantics
, perhaps at/home/dev/src/evm-semantics
kontrol
, perhaps at/home/dev/src/kontrol
.NOTE: Make sure to follow all the steps of the build instructions on the
README
files of thepyk
,evm-semantics
andkontrol
repos when first setting up your local working copies. In particular, make sure to install the dependencies, checkout the submodules and run thekdist
commands to build the definitions. If you get errors when building one of the projects, go back and check if you didn't miss a step.Then you need to:
evm-semantics
to point at the custompyk
:cd kevm-pyk && make
kontrol
to point at the customevm-semantics
:make
Then, you should be all setup to work on Kontrol and make changes that may also require changes to KEVM and pyk.