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

Add the installation of cbindgen to the Makefile #2887

Closed
wants to merge 2 commits into from
Closed
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
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ FROM wasm-base AS wasm-libs-builder
# clang / lld used by soft-float wasm
RUN apt-get update && \
apt-get install -y clang=1:14.0-55.7~deb12u1 lld=1:14.0-55.7~deb12u1 wabt
# pinned rust 1.80.1
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.80.1 --target x86_64-unknown-linux-gnu wasm32-unknown-unknown wasm32-wasi
# pinned rust 1.80.1
RUN curl --proto '=https' --tlsv1.2 -sSf \
https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.80.1 \
--target x86_64-unknown-linux-gnu wasm32-unknown-unknown wasm32-wasi
COPY ./Makefile ./
COPY arbitrator/Cargo.* arbitrator/
COPY arbitrator/arbutil arbitrator/arbutil
Expand Down Expand Up @@ -231,6 +233,10 @@ ENV NITRO_MODIFIED=$modified
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y wabt
# pinned rust 1.80.1
RUN curl --proto '=https' --tlsv1.2 -sSf \
https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.80.1 \
--target x86_64-unknown-linux-gnu wasm32-unknown-unknown wasm32-wasi
COPY go.mod go.sum ./
COPY go-ethereum/go.mod go-ethereum/go.sum go-ethereum/
COPY fastcache/go.mod fastcache/go.sum fastcache/
Expand All @@ -247,7 +253,7 @@ COPY --from=brotli-library-export / target/
COPY --from=prover-export / target/
RUN mkdir -p target/bin
COPY .nitro-tag.txt /nitro-tag.txt
RUN NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build
RUN . ~/.cargo/env && NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build

FROM node-builder AS fuzz-builder
RUN mkdir fuzzers/
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ build-wasm-bin: $(replay_wasm)
.PHONY: build-solidity
build-solidity: .make/solidity

.PHONY: ensure-cbindgen
ensure-cbindgen:
@if ! command -v cbindgen >/dev/null 2>&1; then \
echo "cbindgen not found. Installing..."; \
cargo install --force cbindgen; \
else \
echo "cbindgen already installed."; \
fi

.PHONY: contracts
contracts: .make/solgen
@printf $(done)
Expand Down Expand Up @@ -355,7 +364,7 @@ $(arbitrator_cases)/rust/$(wasm32_wasi)/%.wasm: $(arbitrator_cases)/rust/src/bin
$(arbitrator_cases)/go/testcase.wasm: $(arbitrator_cases)/go/*.go .make/solgen
cd $(arbitrator_cases)/go && GOOS=wasip1 GOARCH=wasm go build -o testcase.wasm

$(arbitrator_generated_header): $(DEP_PREDICATE) $(stylus_files)
$(arbitrator_generated_header): $(DEP_PREDICATE) $(stylus_files) ensure-cbindgen
@echo creating ${PWD}/$(arbitrator_generated_header)
mkdir -p `dirname $(arbitrator_generated_header)`
cd arbitrator/stylus && cbindgen --config cbindgen.toml --crate stylus --output ../../$(arbitrator_generated_header)
Expand Down
Loading