srlabs / ziggy

A multi-fuzzer management utility for all of your Rust fuzzing needs 🧑‍🎤
Apache License 2.0
59 stars 6 forks source link

Respect the workspace if it exists #38

Open brunoproduit opened 1 year ago

brunoproduit commented 1 year ago

When ziggy builds his targets, the used folder is $PWD/target. When in a workspace, the target directory will be at the root of the workspace. This makes that we cannot use things like cargo clean -p to clean a single crate instead of recompiling everything.

The idea is either to implement cargo ziggy clean or use the same target directory as the workspace

louismerlin commented 11 months ago

Started working on this in https://github.com/srlabs/ziggy/tree/respect-workspace.

There are multiple problems when doing this:

  1. By default, AFL++ and our runner both build a binary file in ${target}/debug/${name}. This means that they will overwrite themselves. I have not yet found a workaround. On the positive side: both react in the correct way to cargo clean -p package_name, so once this is solved, we're good to go.

  2. honggfuzz-rs does build-directory shenanigans of it's own, and cargo clean -p package_name does not work. TBD whether we can fix this.

brunoproduit commented 11 months ago

Couldn't we follow the same idea as cargo targets with multiples "bin" targets. Runner, afl, honggfuzz? Kind of same as now, but in the workspace target directory? The only incompatible thing would be that those targets are not included in the Cargo.toml. Or does that break cargo clean -p as its not canonical?

Or we could add ourselves as binary targets in the workspace, but that would imply changing the targeted codebase. That is not too much of an issue IMO