File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44* .md
55! README * .md
66.github /
7- benches /
8- examples /
97scripts /
8+ # NB: benches/ and examples/ are intentionally NOT ignored. Cargo.toml declares
9+ # explicit [[bench]] and [[example]] targets, and cargo validates that every
10+ # declared target's source file exists when it parses the manifest — even for a
11+ # lib-only build. Excluding these dirs makes `cargo build` fail at manifest
12+ # parse with "can't find <name> example/bench". They are not compiled by the
13+ # default build, so the cost of shipping them in the context is just their size.
Original file line number Diff line number Diff line change @@ -34,6 +34,16 @@ COPY crates/ crates/
3434COPY src/ src/
3535COPY ndarray-rand/src/ ndarray-rand/src/
3636
37+ # Cargo.toml (root) and ndarray-rand/Cargo.toml (a workspace member) declare
38+ # explicit [[example]]/[[bench]] targets. Cargo validates that every declared
39+ # target's source file exists while parsing the manifest — even for a lib-only
40+ # build — so these dirs must be in the context or `cargo build` fails at parse
41+ # with "can't find <name> example/bench". They are NOT compiled here (the default
42+ # build skips examples/benches), so this only adds source bytes, not build time.
43+ COPY examples/ examples/
44+ COPY benches/ benches/
45+ COPY ndarray-rand/benches/ ndarray-rand/benches/
46+
3747# Default target: x86-64-v3 (AVX2) — runs on GitHub CI and most servers.
3848# Use Dockerfile.avx512 for x86-64-v4 (AVX-512). ndarray's simd.rs polyfill
3949# detects AVX-512 at runtime via LazyLock<Tier> even when compiled for v3;
Original file line number Diff line number Diff line change @@ -32,6 +32,16 @@ COPY crates/ crates/
3232COPY src/ src/
3333COPY ndarray-rand/src/ ndarray-rand/src/
3434
35+ # Cargo.toml (root) and ndarray-rand/Cargo.toml (a workspace member) declare
36+ # explicit [[example]]/[[bench]] targets. Cargo validates that every declared
37+ # target's source file exists while parsing the manifest — even for a lib-only
38+ # build — so these dirs must be in the context or `cargo build` fails at parse
39+ # with "can't find <name> example/bench". They are NOT compiled here (the default
40+ # build skips examples/benches), so this only adds source bytes, not build time.
41+ COPY examples/ examples/
42+ COPY benches/ benches/
43+ COPY ndarray-rand/benches/ ndarray-rand/benches/
44+
3545# AVX-512 pinned: compile-time dispatch, everything inlined
3646ENV RUSTFLAGS="-C target-cpu=x86-64-v4"
3747
You can’t perform that action at this time.
0 commit comments