From 25a60f51208efd846fd5b74d865ad5b0747a7781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20T=C3=B3th?= Date: Fri, 24 May 2024 09:09:41 +0000 Subject: [PATCH 1/3] Revert "Reorder targets" This reverts commit 34146a1a5a068a9170608394ea2ccfb40a328f41. --- kevm-pyk/src/kevm_pyk/kompile.py | 45 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/kevm-pyk/src/kevm_pyk/kompile.py b/kevm-pyk/src/kevm_pyk/kompile.py index db8a45a6b6..f691f0faff 100644 --- a/kevm-pyk/src/kevm_pyk/kompile.py +++ b/kevm-pyk/src/kevm_pyk/kompile.py @@ -141,29 +141,6 @@ def run_kompile( output_dir=output_dir, debug=debug, verbose=verbose, type_inference_mode=type_inference_mode ) - case KompileTarget.HASKELL: - return pyk_kompile( - backend=PykBackend.BOOSTER, - output_dir=output_dir, - debug=debug, - verbose=verbose, - type_inference_mode=type_inference_mode, - # --- - main_file=main_file, - main_module=main_module, - syntax_module=syntax_module, - include_dirs=include_dirs, - md_selector=KompileTarget.LLVM.md_selector, - hook_namespaces=HOOK_NAMESPACES, - emit_json=emit_json, - read_only=read_only, - # --- LLVM --- - ccopts=ccopts, - opt_level=optimization, - # --- Haskell --- - haskell_binary=haskell_binary, - ) - case KompileTarget.MAUDE: kompile_maude = MaudeKompile( base_args=base_args, @@ -191,6 +168,28 @@ def _kompile_haskell() -> None: return output_dir + case KompileTarget.HASKELL: + return pyk_kompile( + backend=PykBackend.BOOSTER, + output_dir=output_dir, + debug=debug, + verbose=verbose, + type_inference_mode=type_inference_mode, + # --- + main_file=main_file, + main_module=main_module, + syntax_module=syntax_module, + include_dirs=include_dirs, + md_selector=KompileTarget.LLVM.md_selector, + hook_namespaces=HOOK_NAMESPACES, + emit_json=emit_json, + read_only=read_only, + # --- LLVM --- + ccopts=ccopts, + opt_level=optimization, + # --- Haskell --- + haskell_binary=haskell_binary, + ) case _: raise ValueError(f'Unsupported target: {target.value}') From e81a0b4c47a57c1162f922acfc8a9f0fda24bab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20T=C3=B3th?= Date: Fri, 24 May 2024 09:10:02 +0000 Subject: [PATCH 2/3] Revert "Use `kompile` for the `HASKELL` target" This reverts commit 5bf3c15d2209c25a22c3f6f706e2c6431c963602. --- kevm-pyk/src/kevm_pyk/kompile.py | 45 +++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/kevm-pyk/src/kevm_pyk/kompile.py b/kevm-pyk/src/kevm_pyk/kompile.py index f691f0faff..23c5570fba 100644 --- a/kevm-pyk/src/kevm_pyk/kompile.py +++ b/kevm-pyk/src/kevm_pyk/kompile.py @@ -8,8 +8,7 @@ from pyk.kdist import kdist from pyk.ktool import TypeInferenceMode -from pyk.ktool.kompile import HaskellKompile, KompileArgs, LLVMKompile, MaudeKompile, PykBackend -from pyk.ktool.kompile import kompile as pyk_kompile +from pyk.ktool.kompile import HaskellKompile, KompileArgs, LLVMKompile, LLVMKompileType, MaudeKompile from pyk.utils import run_process from . import config @@ -19,7 +18,7 @@ from pathlib import Path from typing import Final - from pyk.ktool.kompile import Kompile, LLVMKompileType + from pyk.ktool.kompile import Kompile _LOGGER: Final = logging.getLogger(__name__) @@ -169,13 +168,7 @@ def _kompile_haskell() -> None: return output_dir case KompileTarget.HASKELL: - return pyk_kompile( - backend=PykBackend.BOOSTER, - output_dir=output_dir, - debug=debug, - verbose=verbose, - type_inference_mode=type_inference_mode, - # --- + base_args_llvm = KompileArgs( main_file=main_file, main_module=main_module, syntax_module=syntax_module, @@ -184,12 +177,34 @@ def _kompile_haskell() -> None: hook_namespaces=HOOK_NAMESPACES, emit_json=emit_json, read_only=read_only, - # --- LLVM --- - ccopts=ccopts, - opt_level=optimization, - # --- Haskell --- - haskell_binary=haskell_binary, ) + kompile_llvm = LLVMKompile( + base_args=base_args_llvm, ccopts=ccopts, opt_level=optimization, llvm_kompile_type=LLVMKompileType.C + ) + kompile_haskell = HaskellKompile(base_args=base_args, haskell_binary=haskell_binary) + + def _kompile_llvm() -> None: + kompile_llvm( + output_dir=output_dir / 'llvm-library', + debug=debug, + verbose=verbose, + type_inference_mode=type_inference_mode, + ) + + def _kompile_haskell() -> None: + kompile_haskell( + output_dir=output_dir, debug=debug, verbose=verbose, type_inference_mode=type_inference_mode + ) + + with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor: + futures = [ + executor.submit(_kompile_llvm), + executor.submit(_kompile_haskell), + ] + [future.result() for future in futures] + + return output_dir + case _: raise ValueError(f'Unsupported target: {target.value}') From 9346891723e3410cd356de4bd33afd7a6dbfc8ec Mon Sep 17 00:00:00 2001 From: devops Date: Fri, 24 May 2024 09:13:27 +0000 Subject: [PATCH 3/3] Set Version: 1.0.571 --- kevm-pyk/pyproject.toml | 2 +- kevm-pyk/src/kevm_pyk/__init__.py | 2 +- package/version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kevm-pyk/pyproject.toml b/kevm-pyk/pyproject.toml index 264ab6ac68..04d0a0cea7 100644 --- a/kevm-pyk/pyproject.toml +++ b/kevm-pyk/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "kevm-pyk" -version = "1.0.570" +version = "1.0.571" description = "" authors = [ "Runtime Verification, Inc. ", diff --git a/kevm-pyk/src/kevm_pyk/__init__.py b/kevm-pyk/src/kevm_pyk/__init__.py index 118be94bc7..3ab25b869c 100644 --- a/kevm-pyk/src/kevm_pyk/__init__.py +++ b/kevm-pyk/src/kevm_pyk/__init__.py @@ -5,4 +5,4 @@ if TYPE_CHECKING: from typing import Final -VERSION: Final = '1.0.570' +VERSION: Final = '1.0.571' diff --git a/package/version b/package/version index 6b3a5db7f1..b6135cfd2d 100644 --- a/package/version +++ b/package/version @@ -1 +1 @@ -1.0.570 +1.0.571