fix(docker): restore benches/ copy after stub removal in builder stage

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.
This commit is contained in:
Cemal Y. Dalar 2026-02-18 07:02:29 +01:00 committed by Chummy
parent a3eedfdc78
commit 7f15627f8c

View file

@ -26,6 +26,7 @@ RUN rm -rf src benches
# 2. Copy only build-relevant source paths (avoid cache-busting on docs/tests/scripts) # 2. Copy only build-relevant source paths (avoid cache-busting on docs/tests/scripts)
COPY src/ src/ COPY src/ src/
COPY benches/ benches/
COPY firmware/ firmware/ COPY firmware/ firmware/
RUN --mount=type=cache,id=zeroclaw-cargo-registry,target=/usr/local/cargo/registry,sharing=locked \ 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 \ --mount=type=cache,id=zeroclaw-cargo-git,target=/usr/local/cargo/git,sharing=locked \