Skip to content

Commit

Permalink
fix(ci-builder): Build foundry from source (#10180)
Browse files Browse the repository at this point in the history
* attempt `ci-builder` fix

* `ci-builder` fix
  • Loading branch information
clabby authored Apr 16, 2024
1 parent e6f2793 commit 126bb3f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
9 changes: 4 additions & 5 deletions ops/docker/ci-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ COPY ./versions.json ./versions.json
COPY ./ops/scripts/install-foundry.sh ./install-foundry.sh

RUN curl -L https://foundry.paradigm.xyz | bash
RUN source $HOME/.profile && \
./install-foundry.sh && \
cargo install svm-rs
RUN source $HOME/.profile && ./install-foundry.sh

RUN strip /root/.foundry/bin/forge && \
strip /root/.foundry/bin/cast && \
strip /root/.foundry/bin/anvil && \
strip /root/.cargo/bin/svm
strip /root/.cargo/bin/svm && \
strip /root/.cargo/bin/just

FROM --platform=linux/amd64 debian:bullseye-slim as go-build

Expand Down Expand Up @@ -100,7 +99,7 @@ ENV NODE_MAJOR=20

RUN /bin/sh -c set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends bash curl openssh-client git build-essential ca-certificates jq gnupg binutils-mips-linux-gnu python3 python3-pip; \
apt-get install -y --no-install-recommends bash curl openssh-client git build-essential ca-certificates jq gnupg binutils-mips-linux-gnu python3 python3-pip python3-setuptools; \
mkdir -p /etc/apt/keyrings; \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
Expand Down
14 changes: 11 additions & 3 deletions ops/scripts/install-foundry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@ if git rev-parse "$TAG" >/dev/null 2>&1; then
foundryup -v "$TAG"
else
echo "Nightly tag doesn't exist! Building from source..."
foundryup -C "$SHA"
git checkout "$SHA"

# Use native `cargo` build to avoid any rustc environment variables `foundryup` sets. We explicitly
# ignore chisel, as it is not a part of `ci-builder`.
cargo build --bin forge --release
cargo build --bin cast --release
cargo build --bin anvil --release
mkdir -p ~/.foundry/bin
mv target/release/forge ~/.foundry/bin
mv target/release/cast ~/.foundry/bin
mv target/release/anvil ~/.foundry/bin
fi

# Remove the temporary foundry repo; Used just for checking the nightly tag's existence.
rm -rf "$TMP_DIR"
echo "Removed tempdir @ $TMP_DIR"


2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"abigen": "v1.10.25",
"foundry": "bdc04c278f8ac716ed5fd3994bc0da841807b5cf",
"foundry": "8513f619ca6781fe62d59b1bf2a8bb1bbab19927",
"geth": "v1.13.14",
"nvm": "v20.9.0",
"slither": "0.10.0",
Expand Down

0 comments on commit 126bb3f

Please sign in to comment.