rust-fuzz / cargo-fuzz

Command line helpers for fuzzing
https://rust-fuzz.github.io/book/cargo-fuzz.html
Apache License 2.0
1.55k stars 109 forks source link

Do not list dependency packages by MetadataCommand #356

Closed kdarkhan closed 10 months ago

kdarkhan commented 10 months ago

When following cargo-fuzz tutorial at https://rust-fuzz.github.io/book/cargo-fuzz/tutorial.html, after executing cargo fuzz init, fuzz/Cargo.toml contains entry [dependencies.matches] instead of [dependencies.url]. This is caused by MetadataCommand listing dependency packages in addition to main packages which is not desired.

Current implementation does work as expected if result of MetadataCommand contains the first package as the non-dep package but that does not seem to work all the time.

kdarkhan commented 10 months ago

I don't really follow what is going on here -- to calm my nerves, would you mind adding a regression test that fails without this change and passes after it is introduced?

@fitzgen, just pushed a commit with a failing test case that is fixed by my change.