-
Notifications
You must be signed in to change notification settings - Fork 12
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
Switch to cargo-fuzz #261
base: master
Are you sure you want to change the base?
Switch to cargo-fuzz #261
Conversation
Can you update the lockfiles as suggested by CI?
What kind of warnings? |
|
8b3c16d
to
410fb6f
Compare
I fixed the normal CI, but the fuzz test CI seems to be disabled. Investigating. |
32591e2
to
3625437
Compare
The file is not executed yet. I upgraded upload-artifact and download-artifact from v3 to v4 because v3 has been deprecated and automatically fails. I upgraded cache from v3 to v4 because v3 is scheduled for deprecation on 2025-02-01.
3625437
to
4837317
Compare
Fuzzing CI works now :) I had to update the upload-artifact and download-artifact actions because of deprecation. I also updated the cache action because it will be deprecated soon. |
Gonna try to run this in my local CI. It may fail because the first two commits need to be squashed (OTOH it might not because I might not be checking that generate-files.sh is correct here..). I hope that the 1.84 MSRV-aware resolver works! Will be nice to be able to cronjob that in rust-bitcoin and elsewhere, so that our "recent" lockfile starts staying reasonably up to date. Would be nice to add some comments saying that utACK 4837317 |
To deal with the [lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(fuzzing)'] } |
`bash fuzz/generate.sh` `cargo update && cp Cargo.lock Cargo-recent.lock` using the MSRV-aware resolver from Rust 1.84.0: https://blog.rust-lang.org/2025/01/09/Rust-1.84.0.html Rewrite each fuzz target to work with cargo-fuzz. Crash seeds are displayed in base 64, so use that inside duplicate_crash() tests. cargo-fuzz has special entry points for its fuzz tests, which is why every fuzz target is prefixed with #![no_main]. However, this breaks our unit tests that live inside the same file, presumably because unit tests need a normal entry point. My solution is conditionally include the fuzzing code when the `fuzzing` flag is set. Meanwhile, clippy needs a main function in each target to work, so I conditionally add that too. The `fuzzing` flag is nonstandard and produces a warning. It needs to be allowed in Cargo.toml
Use cargo-fuzz instead of hongfuzz. Make the scripts more readable.
We switched to cargo-fuzz and no longer need this.
4837317
to
1cccad3
Compare
I fixed all warnings and lints. We can run clippy over the entire workspace without issues: |
It'll be tough for me to compile this. It puts |
Oh, maybe it's just a MSRV thing, not a "needs nightly" thing, and maaybe it applies only to the fuzz workspace. Will need to experiment more. |
For what it's worth, I pinned version 2024-07-01 of the nightly compiler. You can use that version in your local CI. |
It's not worth a lot -- having things in the lockfile that stable Rust can't build is a problem. But having said that, somehow |
Adapt the fuzzing infrastructure to use cargo-fuzz. I keep the existing shell scripts because they turned out to be useful.
Everything should work as before, except that the
fuzzing
flag is producing warnings when the tests are run. Let's discuss solutions here.