cargo-fuzz icon indicating copy to clipboard operation
cargo-fuzz copied to clipboard

Initialization fails in workspaced directories

Open mgattozzi opened this issue 7 years ago • 7 comments

If I have a directory like this:

my_first_binary
my_second_binary
Cargo.toml

Where Cargo.toml only contains something like this:

[workspace]
members = [
    "my_first_binary",
    "my_second_binary"
]

Then initialization fails on an unwrap of None on an Option (though it doesn't say which one). It would be nice if cargo-fuzz could worked with workspaced projects so that it has one folder with targets for all binaries in the workspace.

mgattozzi avatar Feb 27 '17 22:02 mgattozzi

Yeah, you have to cd into a crate to do it for now.

Manishearth avatar Feb 27 '17 22:02 Manishearth

Seems similar to #15.

whitequark avatar Oct 05 '17 08:10 whitequark

FWIW, in have a workspace that looks like this, cargo fuzz list also fails

[workspace]
members = [ "smtp-message", "smtp-message/fuzz",
            "smtp-server", "smtp-server/fuzz",
            "smtp-queue", "smtp-queue-fs",
            "benches" ]

It fails with error: could not read the manifest file: "[...]/yuubind/fuzz/Cargo.toml" caused by: No such file or directory (os error 2), which isn't the same error message as the one reported above, but I just wanted to send this message so that this issue could track the “cargo fuzz basically doesn't work with workspaces” issue :)

Ekleog avatar May 31 '20 00:05 Ekleog

I'm not sure if this should still be open, I was able to get a fuzz target working with the rest of my workspace. (Although due to https://github.com/rust-lang/cargo/issues/4897 I have to pass RUSTFLAGS='-C debuginfo=1'.)

casey avatar Jan 19 '23 01:01 casey

Can this be reviewed as cargo fuzz init still does not work with workspaced projects

joshua-auchincloss avatar Jun 05 '23 12:06 joshua-auchincloss

Can confirm that cargo fuzz init does not work in workspaced projects.

iqdecay avatar Nov 22 '23 20:11 iqdecay

For anyone getting here, after the merge of https://github.com/rust-fuzz/cargo-fuzz/pull/349 this is solved. There isn't still a release available with this change, but you can workaround building cargo-fuzz locally.

jonboh avatar Dec 29 '23 12:12 jonboh