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

`--build-std` cannot be negated or the documentation is incorrect #371

Open ruuda opened 5 months ago

ruuda commented 5 months ago

In cargo-fuzz 0.12.0, there is an option --build-std which has the following help text:

      --build-std
          Pass -Zbuild-std to Cargo, which will build the standard library with all the build settings for the fuzz target, including debug assertions, and a sanitizer if requested. Currently this conflicts with coverage instrumentation but -Zbuild-std enables detecting more bugs so this option defaults to true, but when using `cargo fuzz coverage` it defaults to false

However, there is no negated --no-build-std option, and it doesn’t take an argument, so that would mean it is always turned on (except in cargo fuzz coverage, where the option is useless), with no way to turn it off, which would make this option useless.

I think that this is a mistake in the help text though, because without --build-std, I don’t see Cargo printing that it’s building any of the std crates and then the fuzzer works, but with --build-std it does build those crates. (And then it fails to build them, but that might just be a problem with the nightly version I’m using.)