Skip to content

Commit

Permalink
fix regression -- inspect module uses compile_
Browse files Browse the repository at this point in the history
add a wrapper for use by multiprocessing which discards the result.
  • Loading branch information
charles-cooper committed Nov 19, 2024
1 parent 42b24aa commit 97182ed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions moccasin/commands/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def compile_project(
with multiprocessing.Pool(n_cpus) as pool:
for contract_path in contracts_to_compile:
res = pool.apply_async(
compile_,
compile_noret,
(contract_path, build_folder),
dict(is_zksync=is_zksync, write_data=write_data),
)
Expand Down Expand Up @@ -144,7 +144,7 @@ def compile_(
compiler_args: dict | None = None,
is_zksync: bool = False,
write_data: bool = False,
) -> None:
) -> VyperDeployer | VVMDeployer:
logger.debug(f"Compiling contract {contract_path}")

# Getting the compiler Data
Expand Down Expand Up @@ -201,3 +201,10 @@ def compile_(
logger.debug(f"Compilation data saved to {build_file}")

logger.debug(f"Done compiling {contract_name}")

return deployer

# discard the result of the compilation so that we don't need to pickle it
# between processes
def compile_noret(*args, **kwargs) -> None:
compile_(*args, **kwargs)

0 comments on commit 97182ed

Please sign in to comment.