From aef55d2f1d8c1379f86e21e27a9d5f08aa07cec8 Mon Sep 17 00:00:00 2001 From: IlyasRidhuan Date: Thu, 7 Mar 2024 17:22:43 +0000 Subject: [PATCH] fix: wrangle python --- barretenberg/acir_tests/Dockerfile.bb.sol | 1 - l1-contracts/Dockerfile | 15 +++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/barretenberg/acir_tests/Dockerfile.bb.sol b/barretenberg/acir_tests/Dockerfile.bb.sol index 0883035bb4b..ddeb4fb774a 100644 --- a/barretenberg/acir_tests/Dockerfile.bb.sol +++ b/barretenberg/acir_tests/Dockerfile.bb.sol @@ -7,7 +7,6 @@ RUN apt update && apt install git bash curl jq -y COPY --from=0 /usr/src/barretenberg/cpp/build /usr/src/barretenberg/cpp/build COPY --from=1 /usr/src/barretenberg/sol/src/ultra/BaseUltraVerifier.sol /usr/src/barretenberg/sol/src/ultra/BaseUltraVerifier.sol COPY --from=noir-acir-tests /usr/src/noir/noir-repo/test_programs /usr/src/noir/noir-repo/test_programs -# COPY --from=ghcr.io/foundry-rs/foundry:latest /usr/local/bin/anvil /usr/local/bin/anvil RUN curl -L https://foundry.paradigm.xyz | bash ENV PATH="${PATH}:/root/.foundry/bin" diff --git a/l1-contracts/Dockerfile b/l1-contracts/Dockerfile index 0d0baf7e8e6..48064e89441 100644 --- a/l1-contracts/Dockerfile +++ b/l1-contracts/Dockerfile @@ -1,18 +1,25 @@ # Building requires foundry. -# FROM ghcr.io/foundry-rs/foundry:nightly-4a643801d0b3855934cdec778e33e79c79971783 FROM ubuntu:lunar -RUN apt update && apt install git jq bash nodejs npm yarn python3 python3-pip -y && pip3 install slither-analyzer==0.10.0 slitherin==0.5.0 +RUN apt update && apt install curl git jq bash nodejs npm python3.11-full python3-pip -y + +# Use virtualenv, do not try to use pipx, it's not working. +RUN python3 -m venv /root/.venv +RUN /root/.venv/bin/pip3 install slither-analyzer==0.10.0 slitherin==0.5.0 RUN curl -L https://foundry.paradigm.xyz | bash -RUN source ~/.bashrc -ENV PATH="~/.foundry/bin:${PATH}" + +# Set env variables for foundry and venv +ENV PATH="${PATH}:/root/.foundry/bin:/root/.venv/bin" RUN foundryup WORKDIR /usr/src/l1-contracts COPY . . RUN git init RUN forge clean && forge fmt --check && forge build && forge test + +RUN npm install --global yarn RUN yarn && yarn lint + RUN git add . && yarn slither && yarn slither-has-diff RUN forge build