Skip to content

Conversation

@lucasbalieiro
Copy link

closes #161

updates the outdated fuzz target compile_parse_tree.
It was still using named::to_commit_node, which has since been replaced by named::forget_names (see this commit)

Also (as suggested in the issue discussion):

  • removed fuzz from the exclude list in Cargo.toml and add to workspace members
  • added a CI job to cargo check the fuzz crate

@lucasbalieiro lucasbalieiro marked this pull request as ready for review November 6, 2025 03:29
@apoelstra
Copy link
Contributor

Nice, thanks!! Code review ACK -- running through my local CI and also Github CI will run. Hopefully it passes. Stuff like this is often really annoying to get right..

@apoelstra
Copy link
Contributor

@lucasbalieiro ok, this isn't working for me with my local crate2nix setup, because when I run cargo test ignoring the test = false lines in Cargo.toml, this runs the fuzzer indefinitely without end. (The fact that this happens is probably a bug in crate2nix, but okay.)

I would like you to remove all the test = false etc lines from Cargo.toml and make sure you can run cargo test and have it terminate in finite time.

The most straightforward thing might be to just copy all the boilerplate from rust-simplicity. e.g. https://github.com/BlockstreamResearch/rust-simplicity/blob/master/fuzz/fuzz_targets/c_rust_merkle.rs

In particular the actual fuzz target should be gated on cfg(fuzzing), and we need to add

[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(fuzzing)'] }

to fuzz/Cargo.toml.

@lucasbalieiro
Copy link
Author

@apoelstra sorry for the delay, I’m traveling at the moment.

In 881f454, I applied the same style you suggested in rust-simplicity to all our fuzz_targets.

Now, when you ignore test = false, cargo test should no longer run indefinitely.

@apoelstra
Copy link
Contributor

No worries. I have been traveling too.

Can you re-arrange these commits (using git rebase -i is easiest) so that the "add fuzz to the workspace members table" commit comes last? That way each individual commit will work for me.

@lucasbalieiro
Copy link
Author

lucasbalieiro commented Nov 11, 2025

No worries. I have been traveling too.

Can you re-arrange these commits (using git rebase -i is easiest) so that the "add fuzz to the workspace members table" commit comes last? That way each individual commit will work for me.

done! commits re-arranged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fuzz target compile_parse_tree not working

2 participants