From ed5f201b7f7e4be6b4ac1b61c6a86d2d07586af3 Mon Sep 17 00:00:00 2001 From: Palina Date: Mon, 6 Jan 2025 20:27:52 +0400 Subject: [PATCH] Update `copytree` function to support Python 3.12 (#2672) * Update `copytree` dependency * Allow copying to an existing dir * Make the copied plugin directory readable and writeable --- kevm-pyk/src/kevm_pyk/kdist/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kevm-pyk/src/kevm_pyk/kdist/plugin.py b/kevm-pyk/src/kevm_pyk/kdist/plugin.py index c16d80bd05..184679b4d4 100644 --- a/kevm-pyk/src/kevm_pyk/kdist/plugin.py +++ b/kevm-pyk/src/kevm_pyk/kdist/plugin.py @@ -1,8 +1,8 @@ from __future__ import annotations import shutil +import subprocess import sys -from distutils.dir_util import copy_tree from typing import TYPE_CHECKING from pyk.kbuild.utils import k_version @@ -52,7 +52,9 @@ def context(self) -> dict[str, str]: class PluginTarget(Target): def build(self, output_dir: Path, deps: dict[str, Any], args: dict[str, Any], verbose: bool) -> None: - copy_tree(str(config.PLUGIN_DIR), '.') + shutil.copytree(str(config.PLUGIN_DIR), '.', dirs_exist_ok=True) + # Making the plugin directory readable and writable for nix + subprocess.run(['chmod', '-R', 'u+rw', '.'], check=True) run_process_2(['make', '-j8']) shutil.copy('./build/krypto/lib/krypto.a', str(output_dir))