Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker ci fix #371

Merged
merged 2 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile-client
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Image to copy solc compiler from
FROM ethereum/solc:0.8.1-alpine as solc-0.8.1

FROM python:3.8-alpine3.12

LABEL org.opencontainers.image.source https://github.com/clearmatics/zeth

# Image to copy solc compiler from
COPY --from=solc-0.8.1 /usr/local/bin/solc /root/.solcx/solc-v0.8.1

RUN apk --update --no-cache add \
build-base \
linux-headers \
Expand Down
6 changes: 5 additions & 1 deletion client/zeth/core/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from web3.utils.events import get_event_data # type: ignore
from eth_utils import event_abi_to_log_topic # type: ignore
import solcx
import solcx.install # type: ignore
from typing import Dict, List, Iterator, Optional, Union, Iterable, Any

# Avoid trying to read too much data into memory
Expand Down Expand Up @@ -117,7 +118,10 @@ def get_block_number(web3: Any) -> int:


def install_sol() -> None:
solcx.install_solc(SOL_COMPILER_VERSION)
try:
solcx.install_solc(SOL_COMPILER_VERSION)
except solcx.exceptions.SolcInstallationError:
solcx.install.compile_solc(SOL_COMPILER_VERSION)


def compile_files(files: List[str], **kwargs: Any) -> Any:
Expand Down