Skip to content

Commit

Permalink
Add foundry.md (#135)
Browse files Browse the repository at this point in the history
* Add `kevm-dist` target `foundryx`

* Replace target `foundry` by `foundryx`

* Set Version: 0.1.38

---------

Co-authored-by: devops <devops@runtimeverification.com>
  • Loading branch information
tothtamas28 and devops authored Oct 27, 2023
1 parent e4f1d6e commit 08de16a
Show file tree
Hide file tree
Showing 8 changed files with 1,622 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: 'Build KEVM'
run: |
docker exec -u github-user kontrol-ci-profile-${GITHUB_SHA} /bin/bash -c 'poetry install'
docker exec -u github-user kontrol-ci-profile-${GITHUB_SHA} /bin/bash -c 'CXX=clang++-14 poetry run kevm-dist --verbose build -j`nproc` plugin foundry'
docker exec -u github-user kontrol-ci-profile-${GITHUB_SHA} /bin/bash -c 'CXX=clang++-14 poetry run kevm-dist --verbose build -j`nproc` plugin foundryx'
- name: 'Run profiling'
run: |
PROF_ARGS=--numprocesses=8
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- name: 'Build KEVM'
run: |
docker exec -u github-user kontrol-ci-integration-${GITHUB_SHA} /bin/bash -c 'poetry install'
docker exec -u github-user kontrol-ci-integration-${GITHUB_SHA} /bin/bash -c 'CXX=clang++-14 poetry run kevm-dist --verbose build -j`nproc` plugin haskell foundry'
docker exec -u github-user kontrol-ci-integration-${GITHUB_SHA} /bin/bash -c 'CXX=clang++-14 poetry run kevm-dist --verbose build -j`nproc` plugin haskell foundryx'
- name: 'Run integration tests'
run: |
TEST_ARGS=--numprocesses=8
Expand Down
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.37
0.1.38
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kontrol"
version = "0.1.37"
version = "0.1.38"
description = "Foundry integration for KEVM"
authors = [
"Runtime Verification, Inc. <contact@runtimeverification.com>",
]

[tool.poetry.scripts]
kontrol = "kontrol.__main__:main"

[tool.poetry.dependencies]
python = "^3.10"
kevm-pyk = { git = "https://github.com/runtimeverification/evm-semantics.git", tag = "v1.0.323", subdirectory = "kevm-pyk" }
Expand All @@ -34,6 +31,12 @@ pytest-mock = "*"
pytest-xdist = "*"
pyupgrade = "*"

[tool.poetry.scripts]
kontrol = "kontrol.__main__:main"

[tool.poetry.plugins.kdist]
kontrol = "kontrol.kdist.plugin"

[tool.isort]
profile = "black"
line_length = 120
Expand Down
2 changes: 1 addition & 1 deletion src/kontrol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
if TYPE_CHECKING:
from typing import Final

VERSION: Final = '0.1.37'
VERSION: Final = '0.1.38'
Empty file added src/kontrol/kdist/__init__.py
Empty file.
1,584 changes: 1,584 additions & 0 deletions src/kontrol/kdist/foundry.md

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions src/kontrol/kdist/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from __future__ import annotations

from pathlib import Path
from typing import TYPE_CHECKING

from kevm_pyk.kdist.plugin import KEVMTarget
from kevm_pyk.kompile import KompileTarget

if TYPE_CHECKING:
from typing import Final


FOUNDRY_MD_FILE: Final = Path(__file__).parent / 'foundry.md'


__TARGETS__: Final = {
'foundryx': KEVMTarget(
{
'target': KompileTarget.HASKELL,
'main_file': FOUNDRY_MD_FILE,
'main_module': 'FOUNDRY',
'syntax_module': 'FOUNDRY',
},
),
}
4 changes: 2 additions & 2 deletions src/kontrol/kompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def foundry_kompile(
copied_requires = []
copied_requires += [f'requires/{name}' for name in list(requires_paths.keys())]
imports = ['FOUNDRY']
kevm = KEVM(kdist.get('foundry'))
kevm = KEVM(kdist.get('foundryx'))
empty_config = kevm.definition.empty_config(Foundry.Sorts.FOUNDRY_CELL)
bin_runtime_definition = _foundry_to_contract_def(
empty_config=empty_config,
Expand All @@ -99,7 +99,7 @@ def foundry_kompile(
)

kevm = KEVM(
kdist.get('foundry'),
kdist.get('foundryx'),
extra_unparsing_modules=(bin_runtime_definition.all_modules + contract_main_definition.all_modules),
)

Expand Down

0 comments on commit 08de16a

Please sign in to comment.