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 110 forks source link

Enable use of cargo-fuzz without a separate workspace #357

Closed kdarkhan closed 10 months ago

kdarkhan commented 10 months ago

This addresses https://github.com/rust-fuzz/cargo-fuzz/issues/345. Currently, cargo-fuzz defines an independent workspace

[workspace]
members = ["."]

which introduces some issues like caching setup, separate linting configs, etc.

The main reason for this seems to be a custom config for profile.release.debug which is allowed to be changed only at the root Cargo.toml of the workspace. This commit adds a workaround for that by supplying --config profile.release.debug=true.

In order to not break workflows of the existing users I introduced a new flag which allows to fallback to the old behavior.

kpcyrd commented 10 months ago

I'm excited for the next release, having them in the same workspace would allow me to delete my fuzz/Cargo.lock file that I keep getting security alerts for. :)

fitzgen commented 10 months ago

I can cut a release in a little bit, but FWIW nothing is stopping you from manually removing the workspace declaration in fuzz/Cargo.toml and adding the crate to your existing workspace.

kdarkhan commented 10 months ago

Thanks for releasing the new version @fitzgen

About changing the workspace structure without the new release - that would probably not work with the older version of cargo-fuzz due to missing flag --config profile.release.debug=true.

I don't know about the reason for setting the flag but it will be ignored in child workspace.

warning: profiles for the non root package will be ignored, specify profiles at the workspace root