Skip to content

fix(docker): ship declared example/bench sources in build context#224

Merged
AdaWorldAPI merged 1 commit into
masterfrom
claude/keen-curie-grx3jd
Jun 23, 2026
Merged

fix(docker): ship declared example/bench sources in build context#224
AdaWorldAPI merged 1 commit into
masterfrom
claude/keen-curie-grx3jd

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Problem

The Railway/Docker build aborts at manifest parse, before compiling anything:

error: failed to parse manifest at `/app/Cargo.toml`
Caused by:
  can't find `amx_gemm_bench` example at `examples/amx_gemm_bench.rs` or `examples/amx_gemm_bench/main.rs`.

Root cause

This is not a missing file in the repo — it's a Docker build-context mismatch.

.dockerignore excluded examples/ and benches/, while 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 any compilation when those files are absent. amx_gemm_bench was merely the first missing target reported; all 18 examples and 13 root benches were stripped from the context.

A second gap (caught by simulating the exact COPY set): the ndarray-rand workspace member also declares [[bench]] "bench", but the Dockerfile copied only its Cargo.toml + src/, never ndarray-rand/benches/. A root-only patch would have failed on that next. (crates/* members are safe — COPY crates/ crates/ grabs them wholesale.)

Verified that cargo build --lib does not skip this validation, so a Dockerfile flag tweak can't fix it — the declared files must be in the context.

Fix

  • .dockerignore — stop excluding examples//benches/ so they're in the build context (kept an NB comment so they aren't "tidied" back in).
  • Dockerfile + Dockerfile.avx512COPY examples/, COPY benches/, COPY ndarray-rand/benches/ before the build.

These dirs are not compiled by the default cargo build (examples/benches require --examples/--benches), so this adds only source bytes, not build time.

Verification

Staged the exact post-fix Docker COPY set locally:

  • Without the dirs → reproduces the original parse error (amx_gemm_bench, then ndarray-rand bench).
  • With the dirs → manifest parse succeeds and the build advances past target validation into dependency resolution / lib compilation.

(The only residual error in the isolated local test was an --offline rand-resolution artifact of the sandbox staging dir, which does not occur in Railway's networked build.)

Note

The Dockerfile later runs cargo test --release --lib -- hpc::. This PR resolves the manifest-parse failure blocking the very first cargo build step. If the deployment later surfaces a compilation error, that's a separate issue downstream of this one.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kq2xzjPj9p2eoP64uy3Btg


Generated by Claude Code

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_01Kq2xzjPj9p2eoP64uy3Btg
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@AdaWorldAPI, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 37 minutes and 3 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b94afa1e-a26c-4c52-8751-ae5263b94faf

📥 Commits

Reviewing files that changed from the base of the PR and between f22a28b and 11745dc.

📒 Files selected for processing (3)
  • .dockerignore
  • Dockerfile
  • Dockerfile.avx512

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AdaWorldAPI AdaWorldAPI merged commit 72ecee0 into master Jun 23, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants