Commit 11745dc
committed
fix(docker): ship declared example/bench sources in build context
The Railway/Docker build aborted at manifest parse:
error: failed to parse manifest at `/app/Cargo.toml`
Caused by:
can't find `amx_gemm_bench` example at `examples/amx_gemm_bench.rs` ...
Root cause: `.dockerignore` excluded `examples/` and `benches/` from the
build context, but Cargo.toml declares explicit [[example]]/[[bench]]
targets. Cargo validates that every explicitly-declared target's source
file exists while *parsing* the manifest — even for a lib-only build — so
`cargo build` aborts before compiling anything when those files are absent.
`amx_gemm_bench` was just the first missing target reported; all 18
examples and 13 root benches were stripped, and the ndarray-rand workspace
member's [[bench]] "bench" was also missing (its benches/ dir was never
copied — only Cargo.toml + src/).
Fix:
- .dockerignore: stop excluding examples/ and benches/ so they are present
in the build context (kept an NB comment explaining why).
- Dockerfile + Dockerfile.avx512: COPY examples/, benches/, and
ndarray-rand/benches/ before the build. These are NOT compiled by the
default `cargo build` (examples/benches require --examples/--benches), so
this adds only source bytes, not build time.
Verified by staging the exact Docker COPY set locally: without the dirs,
`cargo build` reproduces the parse error; with them, parse succeeds and the
build advances past target validation into dependency/lib compilation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kq2xzjPj9p2eoP64uy3Btg1 parent f22a28b commit 11745dc
3 files changed
Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
37 | 47 | | |
38 | 48 | | |
39 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
| |||
0 commit comments