-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "Add --cfg fuzzing_repro
when reproducing a crash"
#362
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also been annoyed by recompilations ever since #344 landed.
I think requiring a recompile of the whole fuzz target is perhaps not the right default. I'd be open to changing cfg(fuzzing_repro)
from the default to an option. But I'd like to hear what @Manishearth and @mgeisler think about that.
(Basically, I didn't fully think through the recompilation repercussions when reviewing #344, so I think it is worth revisiting that choice now that we are aware of them.) |
I see what you mean: turning the flag off by default would be less invasive. However, @alexcrichton, don't you have the same problem with the |
Ah that's not an issue for me since I personally rarely test when using When fuzzing though i do very frequently switch between "run the fuzzer for a bit" and then "rerun each failing test case to debug" |
I agree, I was a little worried about this when the original thing landed and I think it's better to go back to the original default. |
Ah, smart 😄 Does this not suggest another work-around for you: use Of course, this is just a silly way of getting Cargo to cache the build output across all three kinds of invocations. From a quick skim of Build cache, it seems using a separate Cargo profile for the reproducing run would be useful for you?
Taking this out again is of course an option — but it suggests that the I do see a good reason for keeping |
Personally this PR is not going to be a great solution for me. I'll probably always forget to pass That being said, I'm happy to defer whwat y'all feel is best. I don't want to presume one way's the best over another. I'll figure out how to make this manageable in my workflow no matter what the end solution is. As-is today works find if I set a different target directory.
Alas I don't believe this works because fuzzing only works on nightly, not on beta.
Indeed! It's what I'm doing now. Personally I'd rather not have to do this either.
I've personally used this before and found it useful, but I also use it very rarely as I typically don't want the code I'm testing/running to be that different from what I'm fuzzing. |
Just to be clear, I'm fine with removing the flag again since it has poor interaction with a typical workflow.
Makes sense! My experience has been the opposite, as in I typically don't have logging available in my crates — but this is a good approach which I could adapt. |
Yeah I think we should move forward with changing the default back to what it was and adding an opt in flag for this mode. |
This reverts commit 08c23e0.
18138bd
to
84b1c63
Compare
--cfg fuzzing_repro
--cfg fuzzing_repro
when reproducing a crash"
Ok I've updated this PR to being a revert of #344 instead of adding a new CLI flag. (under the assumption that this is still possible with
Oh I do also want to be clear I'm not necessarily advocating that this is the "one true way" to do so. I've also use things like |
Thanks for the discussion everyone. |
Sounds great, I'll be trying out using a cargo profile for this next time I run into this — I don't think I knew that I could make my own profiles back when I made the PR 😄
Thanks, makes a lot of sense! It's good that you mentioned logging — I think I should look into using it more for my own projects... since it is a very good tool 🙂 |
Hello, should the Rust Fuzz Book be updated to remove the mention of the config flag? https://rust-fuzz.github.io/book/cargo-fuzz/guide.html |
@emaxx-google good catch! Would you be up for sending a PR to https://github.com/rust-fuzz/book ? |
Sure. I'm just unsure if the discussions settled on any specific alternative that'd supersede this deleted functionality, or if anyone is working on one. |
No one is working on anything, AFAIK. |
Since that functionality was reverted in rust-fuzz/cargo-fuzz#362
Updated Description
This PR now reverts #344 to avoid build cache thrashing when switching between reproducing a fuzz test case and when fuzzing in general.
Original Description
Changing
RUSTFLAGS
causes a recompile of the entire project so for projects that are expensive to build this option being enabled by default means that workflows which switch back-and-forth between fuzzing and running individual tests generate a full rebuild every time. This adds a--no-cfg-fuzzing-repro
option on thecargo fuzz run
CLI to disable this--cfg
argument from being passed.