Skip to content

Commit

Permalink
Distribute kelrond with kmultiversx (#232)
Browse files Browse the repository at this point in the history
* Remove `kbuild` step

* Remove `kwasm`

* Move `kelrond` into Python package

* Set Version: 0.1.32

* Set Version: 0.1.33

---------

Co-authored-by: devops <[email protected]>
  • Loading branch information
tothtamas28 and devops authored Apr 16, 2024
1 parent f5286f5 commit b518fb3
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 175 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ test: test-simple mandos-test test-elrond-contracts test-custom-contracts
# Unit Tests
# ----------

TEST := ./kelrond
TEST := $(POETRY) run -- kelrond
CHECK := git --no-pager diff --no-index --ignore-all-space -R

TEST_CONCRETE_BACKEND:= llvm
Expand Down
8 changes: 4 additions & 4 deletions generate-claims.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ poetry -C kmultiversx install

sc-meta all build --path deps/mx-sdk-rs/contracts/examples/adder --wasm-symbols --no-wasm-opt
sc-meta all build --path tests/contracts/foundrylike --wasm-symbols --no-wasm-opt
K_OPTS="-Xmx8192m" kbuild kompile llvm-kasmer && poetry -C kmultiversx run -- kasmer --directory "tests/contracts/foundrylike" --gen-claims 2>&1 | tee kasmer.log
poetry -C kmultiversx run -- kasmer --directory "tests/contracts/foundrylike" --gen-claims 2>&1 | tee kasmer.log

# Coindrip

Expand All @@ -19,13 +19,13 @@ do
done
sc-meta all build --path deps/coindrip-protocol-sc --wasm-symbols --no-wasm-opt
sc-meta all build --path tests/contracts/test_coindrip --wasm-symbols --no-wasm-opt
K_OPTS="-Xmx8192m" kbuild kompile llvm-kasmer && poetry -C kmultiversx run -- kasmer --directory "tests/contracts/test_coindrip" --gen-claims 2>&1 | tee kasmer.log
poetry -C kmultiversx run -- kasmer --directory "tests/contracts/test_coindrip" --gen-claims 2>&1 | tee kasmer.log

# Crowdfunding

sc-meta all build --path deps/mx-sdk-rs/contracts/examples/crowdfunding-esdt --wasm-symbols --no-wasm-opt
sc-meta all build --path tests/contracts/test_crowdfunding-esdt --wasm-symbols --no-wasm-opt
K_OPTS="-Xmx8192m" kbuild kompile llvm-kasmer && poetry -C kmultiversx run -- kasmer --directory "tests/contracts/test_crowdfunding-esdt" --gen-claims 2>&1 | tee kasmer.log
poetry -C kmultiversx run -- kasmer --directory "tests/contracts/test_crowdfunding-esdt" --gen-claims 2>&1 | tee kasmer.log

# Pair

Expand All @@ -37,4 +37,4 @@ K_OPTS="-Xmx8192m" kbuild kompile llvm-kasmer && poetry -C kmultiversx run -- ka

sc-meta all build --path deps/mx-sdk-rs/contracts/examples/multisig --wasm-symbols --no-wasm-opt
sc-meta all build --path tests/contracts/test_multisig --wasm-symbols --no-wasm-opt
K_OPTS="-Xmx8192m" kbuild kompile llvm-kasmer && poetry -C kmultiversx run -- kasmer --directory "tests/contracts/test_multisig" --gen-claims 2>&1 | tee kasmer.log
poetry -C kmultiversx run -- kasmer --directory "tests/contracts/test_multisig" --gen-claims 2>&1 | tee kasmer.log
11 changes: 6 additions & 5 deletions kmultiversx/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kmultiversx"
version = "0.1.32"
version = "0.1.33"
description = "Python tools for Elrond semantics"
authors = [
"Runtime Verification, Inc. <[email protected]>",
]

[tool.poetry.scripts]
mandos = "kmultiversx.scenario:run_tests"
kasmer = "kmultiversx.kasmer:main"
kelrond = "kmultiversx.scripts.kelrond:main"

[tool.poetry.plugins.kdist]
mx-semantics = "kmultiversx.kdist.plugin"

Expand Down Expand Up @@ -54,7 +59,3 @@ skip-string-normalization = true

[tool.mypy]
disallow_untyped_defs = true

[tool.poetry.scripts]
mandos = "kmultiversx.scenario:run_tests"
kasmer = "kmultiversx.kasmer:main"
15 changes: 15 additions & 0 deletions kmultiversx/src/kmultiversx/scripts/kelrond.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import sys
from pathlib import Path

from pyk.utils import run_process

SCRIPT_FILE = Path(__file__).parent / 'kelrond.sh'


def main() -> None:
proc_res = run_process(['bash', str(SCRIPT_FILE)] + sys.argv[1:], pipe_stdout=False, check=False)
sys.exit(proc_res.returncode)


if __name__ == '__main__':
main()
10 changes: 2 additions & 8 deletions kelrond → ...iversx/src/kmultiversx/scripts/kelrond.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
#!/usr/bin/env bash

set -euo pipefail
shopt -s extglob

notif() { echo "== $@" >&2 ; }
fatal() { echo "[FATAL] $@" ; exit 1 ; }

kelrond_dir="${KELROND_DIR:-$(dirname $0)}"
build_dir="$kelrond_dir/.build"
kdist_dir="$(poetry -C kmultiversx run -- kdist which)"
kdist_dir="$(kdist which)"
defn_dir="${KELROND_DEFN_DIR:-$kdist_dir}/mx-semantics"

kwasm_dir=$kelrond_dir/deps/wasm-semantics

export K_OPTS="${K_OPTS:--Xmx16G -Xss512m}"

# Utilities
Expand All @@ -24,7 +18,7 @@ preprocess() {
tmp_dir="$(mktemp -d)"
tmp_input="$tmp_dir/$(basename $run_file))"
touch "$tmp_input"
poetry -C kmultiversx run kwasm-preprocess "$run_file" > "$tmp_input"
kwasm-preprocess "$run_file" > "$tmp_input"
run_file="$tmp_input"
}

Expand Down
156 changes: 0 additions & 156 deletions kwasm

This file was deleted.

2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.32
0.1.33

0 comments on commit b518fb3

Please sign in to comment.