sourcefrog / cargo-mutants

:zombie: Inject bugs and see if your tests catch them!
https://mutants.rs/
MIT License
585 stars 27 forks source link

support non-crates.io registry #428

Open droundy opened 1 week ago

droundy commented 1 week ago

I'm getting errors like:

FAILED   Unmutated baseline in 0.1s build

*** baseline

*** /Users/davidroundy/.rustup/toolchains/1.81.0-aarch64-apple-darwin/bin/cargo test --no-run --verbose --manifest-path /var/folders/px/x2xgpg_x7bn0l2tjmp3zgc6c0000gp/T/cargo-mutants-sludge-7A248M.tmp/Cargo.toml
error: failed to parse manifest at `/var/folders/px/x2xgpg_x7bn0l2tjmp3zgc6c0000gp/T/cargo-mutants-sludge-7A248M.tmp/Cargo.toml`

Caused by:
  registry index was not found in any configuration: `nextroll`

*** result: Failure(101)

ERROR cargo build failed in an unmutated tree, so no mutants were tested

Maybe the code just needs to copy .cargo/config.toml where the registry is defined?

sourcefrog commented 6 days ago

Can you try with --in-place and see if that fixes it? That would confirm whether it's related to copying.

From memory and from glancing at https://github.com/sourcefrog/cargo-mutants/blob/main/src/copy_tree.rs, we're not excluding .cargo.

Also, is there any open/public alternative registry that I could test against? Or in general, a public reproduction would help.