rust-fuzz / cargo-fuzz

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

Do not list dependency packages by MetadataCommand #356

Closed kdarkhan closed 8 months ago

kdarkhan commented 9 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 9 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.