From 7f15627f8c60e823f72d3adac66c9cf08676163c Mon Sep 17 00:00:00 2001 From: "Cemal Y. Dalar" Date: Wed, 18 Feb 2026 07:02:29 +0100 Subject: [PATCH] fix(docker): restore benches/ copy after stub removal in builder stage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dep-caching layer creates stub files (src/main.rs and benches/agent_benchmarks.rs) to warm the cargo registry cache, then removes them with `rm -rf src benches`. The subsequent real source copy only restored `src/` — leaving `benches/` absent. Cargo's manifest parser then failed to locate `benches/agent_benchmarks.rs` referenced in Cargo.toml, aborting the release build with: error: failed to parse manifest at `/app/Cargo.toml` Caused by: can't find `agent_benchmarks` bench at `benches/agent_benchmarks.rs` Fix: add `COPY benches/ benches/` alongside the `COPY src/ src/` step so the real bench source is present for the incremental release build. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b571799..136397f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /app RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ apt-get update && apt-get install -y \ - pkg-config \ + pkg-config \ && rm -rf /var/lib/apt/lists/* # 1. Copy manifests and toolchain pin to cache dependencies with the same compiler @@ -26,6 +26,7 @@ RUN rm -rf src benches # 2. Copy only build-relevant source paths (avoid cache-busting on docs/tests/scripts) COPY src/ src/ +COPY benches/ benches/ COPY firmware/ firmware/ RUN --mount=type=cache,id=zeroclaw-cargo-registry,target=/usr/local/cargo/registry,sharing=locked \ --mount=type=cache,id=zeroclaw-cargo-git,target=/usr/local/cargo/git,sharing=locked \