From 9ee95e5c0506e52ae04737160f7b157ebf8d95dd Mon Sep 17 00:00:00 2001 From: Jost Berthold Date: Mon, 25 Mar 2024 10:33:58 +1100 Subject: [PATCH] integrate plugin changes to blake2 build --- kevm-pyk/src/kevm_pyk/kdist/plugin.py | 5 ++--- kevm-pyk/src/kevm_pyk/kompile.py | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kevm-pyk/src/kevm_pyk/kdist/plugin.py b/kevm-pyk/src/kevm_pyk/kdist/plugin.py index 065b8e1977..601ac5be89 100644 --- a/kevm-pyk/src/kevm_pyk/kdist/plugin.py +++ b/kevm-pyk/src/kevm_pyk/kdist/plugin.py @@ -1,6 +1,5 @@ from __future__ import annotations -import shutil import sys from distutils.dir_util import copy_tree from typing import TYPE_CHECKING @@ -65,13 +64,13 @@ def build(self, output_dir: Path, deps: dict[str, Any], args: dict[str, Any], ve copy_tree(str(config.PLUGIN_DIR), '.') run_process( - ['make', 'libcryptopp', 'libff', 'plugin-c/blake2.a', '-j8'], + ['make', 'libcryptopp', 'libff', 'blake2', '-j8'], pipe_stdout=not verbose, ) copy_tree('./build/libcryptopp', str(output_dir / 'libcryptopp')) copy_tree('./build/libff', str(output_dir / 'libff')) - shutil.copy2('./plugin-c/blake2.a', output_dir / 'plugin-c' / 'blake2.a') + copy_tree('./build/blake2', str(output_dir / 'blake2')) def source(self) -> tuple[Path]: return (config.PLUGIN_DIR,) diff --git a/kevm-pyk/src/kevm_pyk/kompile.py b/kevm-pyk/src/kevm_pyk/kompile.py index a060a2ec56..3166695c07 100644 --- a/kevm-pyk/src/kevm_pyk/kompile.py +++ b/kevm-pyk/src/kevm_pyk/kompile.py @@ -219,11 +219,13 @@ def lib_ccopts(plugin_dir: Path, debug_build: bool = False) -> list[str]: libcryptopp_dir = plugin_dir / 'libcryptopp' ccopts += [f'{libcryptopp_dir}/lib/libcryptopp.a', f'-I{libcryptopp_dir}/include'] + blake2_dir = plugin_dir / 'blake2' + ccopts += [f'{blake2_dir}/lib/blake2.a'] + plugin_include = plugin_dir / 'plugin-c' ccopts += [ f'{plugin_include}/plugin_util.cpp', f'{plugin_include}/crypto.cpp', - f'{plugin_include}/blake2.a', ] if kernel == 'darwin':