From 70fcc9745ea07bf8a14e04ba4d3ae0d01c77a56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20V=C4=83caru?= <16517508+anvacaru@users.noreply.github.com> Date: Tue, 5 Dec 2023 00:42:33 +0200 Subject: [PATCH] Various documentation fixes (#224) * typos * Set Version: 0.1.80 * fix KVersion warning * add cheatcodes.md disclaimer * gracefully shut down when forge is not in PATH --------- Co-authored-by: devops --- README.md | 6 +++--- package/version | 2 +- pyproject.toml | 2 +- src/kontrol/__init__.py | 2 +- src/kontrol/__main__.py | 4 +++- src/kontrol/foundry.py | 5 ++++- src/kontrol/kdist/cheatcodes.md | 3 ++- 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6119c1017..fc445e09b 100644 --- a/README.md +++ b/README.md @@ -30,17 +30,17 @@ poetry install In order to build `kontrol`, you need to build these specific targets: ```sh -poetry run kdist --verbose build -j3 evm-semantics.haskell kontrol.foundry +poetry run kdist --verbose build -j2 evm-semantics.haskell kontrol.foundry ``` To change the default compiler: ```sh -CXX=clang++-14 poetry run kdist --verbose build -j3 evm-semantics.haskell kontrol.foundry +CXX=clang++-14 poetry run kdist --verbose build -j2 evm-semantics.haskell kontrol.foundry ``` On Apple Silicon: ```sh -APPLE_SILICON=true poetry run kdist --verbose build -j3 evm-semantics.haskell kontrol.foundry +APPLE_SILICON=true poetry run kdist --verbose build -j2 evm-semantics.haskell kontrol.foundry ``` Targets can be cleaned with: diff --git a/package/version b/package/version index b9dbcf613..8c1c54a74 100644 --- a/package/version +++ b/package/version @@ -1 +1 @@ -0.1.79 +0.1.80 diff --git a/pyproject.toml b/pyproject.toml index 67722cdb2..5c8f5848c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "kontrol" -version = "0.1.79" +version = "0.1.80" description = "Foundry integration for KEVM" authors = [ "Runtime Verification, Inc. ", diff --git a/src/kontrol/__init__.py b/src/kontrol/__init__.py index e1fc7d7ac..8286e42a6 100644 --- a/src/kontrol/__init__.py +++ b/src/kontrol/__init__.py @@ -5,4 +5,4 @@ if TYPE_CHECKING: from typing import Final -VERSION: Final = '0.1.79' +VERSION: Final = '0.1.80' diff --git a/src/kontrol/__main__.py b/src/kontrol/__main__.py index 3fd97c0b2..285f8e851 100644 --- a/src/kontrol/__main__.py +++ b/src/kontrol/__main__.py @@ -92,7 +92,9 @@ def _check_k_version() -> None: actual_k_version = k_version() if not _compare_versions(expected_k_version, actual_k_version): - _LOGGER.warning(f'K version {expected_k_version} was expected but K version {actual_k_version} is being used.') + _LOGGER.warning( + f'K version {expected_k_version.text} was expected but K version {actual_k_version.text} is being used.' + ) def _compare_versions(ver1: KVersion, ver2: KVersion) -> bool: diff --git a/src/kontrol/foundry.py b/src/kontrol/foundry.py index 5c2d519a9..7259120db 100644 --- a/src/kontrol/foundry.py +++ b/src/kontrol/foundry.py @@ -229,6 +229,9 @@ def custom_view(self, contract_name: str, element: KCFGElem) -> Iterable[str]: def build(self) -> None: try: run_process(['forge', 'build', '--root', str(self._root)], logger=_LOGGER) + except FileNotFoundError: + print("Error: 'forge' command not found. Please ensure that 'forge' is installed and added to your PATH.") + sys.exit(1) except CalledProcessError as err: raise RuntimeError("Couldn't forge build!") from err @@ -347,7 +350,7 @@ def help_info() -> list[str]: res_lines.append('') res_lines.append('See `foundry_success` predicate for more information:') res_lines.append( - 'https://github.com/runtimeverification/evm-semantics/blob/master/include/kframework/foundry.md#foundry-success-predicate' + 'https://github.com/runtimeverification/kontrol/blob/master/src/kontrol/kdist/foundry.md#foundry-success-predicate' ) res_lines.append('') res_lines.append( diff --git a/src/kontrol/kdist/cheatcodes.md b/src/kontrol/kdist/cheatcodes.md index 9ea2c500a..663d0cfd5 100644 --- a/src/kontrol/kdist/cheatcodes.md +++ b/src/kontrol/kdist/cheatcodes.md @@ -1,5 +1,6 @@ -Foundry Cheat Codes +Kontrol Cheat Codes ------------------- +This file contains the implementation of both Foundry and proprietary cheat codes supported by Kontrol. The configuration of the Foundry Cheat Codes is defined as follwing: 1. The `` subconfiguration stores values which are used during the execution of any kind of `prank` cheat code: