Skip to content

Commit

Permalink
Optimization flags for kontrol build (#842)
Browse files Browse the repository at this point in the history
* kontrol build: Pass optimization flags to kevm_kompile

* Pass -O2 on CI
  • Loading branch information
gtrepta authored Oct 1, 2024
1 parent b030efa commit 1c2e677
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
docker exec --user ${DOCKER_USER} --workdir ${FOUNDRY_ROOT} ${CONTAINER_NAME} forge install --no-git runtimeverification/kontrol-cheatcodes@a5dd4b0
docker exec --user ${DOCKER_USER} --workdir ${FOUNDRY_ROOT} ${CONTAINER_NAME} forge build
- name: 'Run kontrol build'
run: docker exec --user ${DOCKER_USER} --workdir ${FOUNDRY_ROOT} ${CONTAINER_NAME} kontrol build
run: docker exec --user ${DOCKER_USER} --workdir ${FOUNDRY_ROOT} ${CONTAINER_NAME} kontrol build -O2
- name: 'Run kontrol prove'
run: docker exec --user ${DOCKER_USER} --workdir ${FOUNDRY_ROOT} ${CONTAINER_NAME} kontrol prove --match-test 'AssertTest.test_assert_true()'
- name: 'Run kontrol show'
Expand Down
10 changes: 10 additions & 0 deletions src/kontrol/kompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ def should_rekompile() -> bool:

if should_rekompile():
output_dir = foundry.kompiled

optimization = 0
if options.o1:
optimization = 1
if options.o2:
optimization = 2
if options.o3:
optimization = 3

kevm_kompile(
target=options.target,
output_dir=output_dir,
Expand All @@ -172,6 +181,7 @@ def should_rekompile() -> bool:
debug=options.debug,
verbose=options.verbose,
ignore_warnings=options.ignore_warnings,
optimization=optimization,
)

update_kompilation_digest()
Expand Down

0 comments on commit 1c2e677

Please sign in to comment.