You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mkRustProject: tests/fixtures/ dropped from source silently fails cargo-nextest with 'fixture missing' #2095
Found while adopting devkit 1.19.2 (e934209) into an existing Rust-flake repo (nerdmachines/ee, ee#25). The repo's Rust workspace lives at crates/, with integration-test fixtures under crates/ee-route/tests/fixtures/ (cyberphone JCS vectors, pinned-input traces, zones_vectors, generated tables).
Problem
lib.mkRustProject's cleanSrc wraps crane's commonCargoSources, which filters a crate's directory down to Cargo.{toml,lock} + *.rs + *.toml. Non-Rust files under tests/fixtures/ are silently dropped from the pack's source — the pack's wellKnownConfigFiles list (deny.toml, rustfmt.toml, clippy.toml, …) only covers the repo-root tool configs, not per-crate fixture data.
Result: the pack's nextest and the build-as-check derivations compile cleanly, then at runtime every test that reads a fixture panics with its own missing: re-copy from … message. In this repo:
thread 'cyberphone_vectors_match_rfc_8785' panicked at ee-route/tests/energy.rs:783:5:
jcs fixture root "/build/source/ee-route/tests/fixtures/jcs" missing: re-copy the cyberphone vectors from <repo>/tests/fixtures/jcs/ and `git add` them; see the module docstring.
The pack documents extraSrcFiles as the seam, and setting
extraSrcFiles=["ee-route/tests/fixtures"];
fixes it. So the mechanism is there — but nothing in the message trail points you at it, and a repo that follows the current docs lands on the pack with a green build and a red check it cannot explain.
Impact
Any Rust repo with integration-test fixtures (parity vectors, golden files, snapshot inputs) hits this on first adoption. If the test code happens to short-circuit on MISSING_FIXTURE instead of panicking, the pack reports GREEN with the fixture-dependent assertions silently never run — the worse failure mode.
Suggested
mkRustProject could default extraSrcFiles to [\"<crate>/tests/fixtures\"] and [\"<crate>/tests/data\"] per crates = [ … ] entry (opt-out, not opt-in).
Alternatively: document the extraSrcFiles need next to the crates arg in the module docstring, with the exact error you'll see when a fixture goes missing.
Not blocking (one-line fix once you know), but it bit on adoption and the error "fixture missing" from inside a Nix sandbox is not a place to be debugging a flake.nix.
Same failure in a second adopter (devkit 1.19.2, 2026-12-01), a private Rust workspace. The integration tests there include_str! JSON vectors from crates/<crate>/tests/vectors/*.json. mkRustProject's source filter drops them, so the nextest check can't compile the tests. A reviewer caught it before CI did.
The workaround that works: extraSrcFiles = [ "crates/<crate>/tests/vectors" ];. Directories are accepted. Verified with nix eval .#checks.<system>.nextest.src --apply 's: builtins.attrNames (builtins.readDir "${s}/crates/<crate>/tests/vectors")'.
+1 to making tests/** non-Rust files part of the default source, or to failing the build loudly naming the missing path instead of a confusing compile error.
Activity
gerchowl commentedon Dec 1, 2026
Same failure in a second adopter (devkit 1.19.2, 2026-12-01), a private Rust workspace. The integration tests there
include_str!JSON vectors fromcrates/<crate>/tests/vectors/*.json.mkRustProject's source filter drops them, so the nextest check can't compile the tests. A reviewer caught it before CI did.The workaround that works:
extraSrcFiles = [ "crates/<crate>/tests/vectors" ];. Directories are accepted. Verified withnix eval .#checks.<system>.nextest.src --apply 's: builtins.attrNames (builtins.readDir "${s}/crates/<crate>/tests/vectors")'.+1 to making
tests/**non-Rust files part of the default source, or to failing the build loudly naming the missing path instead of a confusing compile error.