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:
parent
a3eedfdc78
commit
7f15627f8c
1 changed files with 2 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ WORKDIR /app
|
||||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
apt-get update && apt-get install -y \
|
apt-get update && apt-get install -y \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# 1. Copy manifests and toolchain pin to cache dependencies with the same compiler
|
# 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)
|
# 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 \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue