rust-fuzz / cargo-fuzz

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

Confusing error when Cargo.toml includes 'cargo-fuzz = true' #350

Open cameronelliott opened 6 months ago

cameronelliott commented 6 months ago

Hi, I'm new to cargo-fuzz, so that's probably part of the issue.

I tried following an issue on fuzzing, and so rather than starting with cargo fuzz init I started editing my Cargo.toml to match the article.

I added this section (and the dir fuzz_targets, with a .rs inside)

[package.metadata]
cargo-fuzz = true

Unbeknownst to me, that caused my fuzz commands to always print: Error: could not find a cargo project

c@macmini > cargo fuzz run xx
Error: could not find a cargo project
c@macmini > cargo fuzz init
Error: could not find a cargo project

It seems like this could be clearer, it was difficult to figure out what was the cause of confusion.