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

chore: switch to installing published binaries of foundry #9731

Merged
merged 5 commits into from
Nov 5, 2024
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
2 changes: 1 addition & 1 deletion barretenberg/acir_tests/Dockerfile.bb.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY --from=noir-acir-tests /usr/src/noir/noir-repo/test_programs /usr/src/noir/

RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="${PATH}:/root/.foundry/bin"
RUN foundryup
RUN foundryup -v nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc

WORKDIR /usr/src/barretenberg/acir_tests
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/sol/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ COPY ./sol .
# Download and install foundry
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="${PATH}:/root/.foundry/bin"
RUN foundryup
RUN foundryup -v nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc

RUN cd ../cpp/srs_db && ./download_ignition.sh 3 && cd ../../sol

Expand Down
5 changes: 2 additions & 3 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ function check_toolchains {
if ! $tool --version 2> /dev/null | grep 25f24e6 > /dev/null; then
encourage_dev_container
echo "$tool not in PATH or incorrect version (requires 25f24e677a6a32a62512ad4f561995589ac2c7dc)."
echo "Installation: https://book.getfoundry.sh/getting-started/installation (requires rust 1.79+)"
echo " rustup toolchain install 1.79"
echo "Installation: https://book.getfoundry.sh/getting-started/installation"
echo " curl -L https://foundry.paradigm.xyz | bash"
echo " foundryup -b 25f24e677a6a32a62512ad4f561995589ac2c7dc"
echo " foundryup -v nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc"
exit 1
fi
done
Expand Down
33 changes: 11 additions & 22 deletions build-images/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,25 @@ osxcross:

########################################################################################################################
# Build foundry.
foundry-build:
foundry:
LET FOUNDRY_TAG = 25f24e677a6a32a62512ad4f561995589ac2c7dc
FROM +base-build
# We use rustup rather than cargo to manage the cargo version via a tool-chain file
# It is done this way to avoid conflicting with noir builds
# This image should only be rebuilt when our foundry tag changes, so it should be extremely infrequent
RUN apt remove -y cargo
RUN apt update && apt install -y rustup
RUN ulimit -n 65535 \
&& git clone --depth 1 --branch nightly-$FOUNDRY_TAG https://github.com/foundry-rs/foundry.git \
&& cd foundry \
&& echo '[toolchain]\nchannel = "1.80.0"\n' > rust-toolchain.toml \
&& cargo build --release \

LET FOUNDRY_BIN_DIR = "/root/.foundry/bin"

RUN curl -L https://foundry.paradigm.xyz | bash \
&& $FOUNDRY_BIN_DIR/foundryup -v nightly-$FOUNDRY_TAG \
&& mkdir -p /opt/foundry/bin \
&& for t in forge cast anvil chisel; do \
mv ./target/release/$t /opt/foundry/bin/$t; \
mv $FOUNDRY_BIN_DIR/$t /opt/foundry/bin/$t; \
strip /opt/foundry/bin/$t; \
done \
&& rm -rf /foundry
&& rm -rf $FOUNDRY_BIN_DIR

SAVE ARTIFACT /opt/foundry /opt/foundry
ARG TARGETARCH
SAVE IMAGE --push aztecprotocol/cache:foundry-build-$FOUNDRY_TAG-$TARGETARCH
ENV PATH="/opt/foundry/bin:$PATH"

foundry:
BUILD +foundry-build
LET FOUNDRY_TAG = 25f24e677a6a32a62512ad4f561995589ac2c7dc
ARG TARGETARCH
FROM ubuntu:noble
COPY +foundry-build/opt/foundry /opt/foundry
ENV PATH="/opt/foundry/bin:$PATH"
SAVE IMAGE --push aztecprotocol/foundry:$FOUNDRY_TAG-$TARGETARCH

########################################################################################################################
Expand Down Expand Up @@ -160,7 +149,7 @@ build:
COPY +wasi-sdk/opt/wasi-sdk /opt/wasi-sdk

# Install foundry.
COPY +foundry-build/opt/foundry /opt/foundry
COPY +foundry/opt/foundry /opt/foundry
ENV PATH="/opt/foundry/bin:$PATH"

# Install rust and cross-compilers. Noir specifically uses 1.74.1.
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/end-to-end/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN rm -rf /usr/src/noir-projects /usr/src/l1-contracts

# Anvil. Hacky, but can't be bothered handling foundry image as we're moving to earthly.
RUN curl -L https://foundry.paradigm.xyz | bash
RUN /root/.foundry/bin/foundryup --version nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc && mkdir -p /usr/src/foundry/bin && cp /root/.foundry/bin/anvil /usr/src/foundry/bin/anvil
RUN /root/.foundry/bin/foundryup -v nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc && mkdir -p /usr/src/foundry/bin && cp /root/.foundry/bin/anvil /usr/src/foundry/bin/anvil

# Create minimal image.
FROM node:18.19.1-slim
Expand All @@ -52,4 +52,4 @@ RUN apt-get update && apt-get install jq gnupg wget netcat-openbsd -y && \
ENV CHROME_BIN="/usr/bin/google-chrome-stable"
COPY --from=builder /usr/src /usr/src
WORKDIR /usr/src/yarn-project/end-to-end
ENTRYPOINT ["yarn", "test"]
ENTRYPOINT ["yarn", "test"]
Loading