Skip to content

Commit c5a58e5

Browse files
committed
fix(validity): scope cargo chef prepare to the actual binaries
Without --bin, cargo chef prepare captures a recipe for the entire workspace (all 12 members), including unrelated scripts/test crates that pin much newer alloy-* versions (up to 2.0.4, requiring rustc 1.91-1.94). cook then tries to compile that whole graph against rust:1.85 and fails. --bin validity --bin clear-stuck-txs makes cargo-chef ignore workspace members not needed to build those two binaries, matching what the final cargo build step actually needs.
1 parent 8603287 commit c5a58e5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

validity/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ FROM lukemathwalker/cargo-chef:latest-rust-1.85 AS chef
88
WORKDIR /build
99

1010
# Planner stage: compute a dependency-only recipe from the workspace
11-
# Cargo.toml/Cargo.lock, independent of the rest of the source tree
11+
# Cargo.toml/Cargo.lock, independent of the rest of the source tree.
12+
# --bin scopes the recipe to only what validity/clear-stuck-txs actually need —
13+
# without it, cargo-chef pulls in every workspace member (including unrelated
14+
# scripts/test crates that depend on much newer alloy-* versions requiring
15+
# rustc up to 1.94), and `cook` fails trying to compile those against 1.85.
1216
FROM chef AS planner
1317
COPY . .
14-
RUN cargo chef prepare --recipe-path recipe.json
18+
RUN cargo chef prepare --bin validity --bin clear-stuck-txs --recipe-path recipe.json
1519

1620
# Build stage
1721
FROM chef AS builder

0 commit comments

Comments
 (0)