looks like the rustflags = ["--cfg", "fuzzing"] in fuzz crate is not applied correctly when first time running cargo build --workspace.
➜ quinn git:(dev) cargo build --workspace
Compiling fuzz v0.1.0 (/Users/xxx/quinn/fuzz)
Compiling perf v0.1.0 (/Users/xxx/quinn/perf)
Compiling bench v0.1.0 (/Users/xxx/quinn/bench)
error[E0432]: unresolved import proto::fuzzing
--> fuzz/fuzz_targets/packet.rs:7:5
|
7 | fuzzing::{PacketParams, PartialDecode},
| ^^^^^^^ could not find fuzzing in proto
error[E0432]: unresolved import proto::fuzzing
--> fuzz/fuzz_targets/streams.rs:7:12
|
7 | use proto::fuzzing::{
| ^^^^^^^ could not find fuzzing in proto
For more information about this error, try rustc --explain E0432.
error: could not compile fuzz due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
Odd; I guess cargo-fuzz's conditional compilation stuff just doesn't work with build --workspace. Not sure there's much we can do about that. cargo build still works fine ran directly inside fuzz.
looks like the rustflags = ["--cfg", "fuzzing"] in fuzz crate is not applied correctly when first time running cargo build --workspace.
➜ quinn git:(dev) cargo build --workspace Compiling fuzz v0.1.0 (/Users/xxx/quinn/fuzz) Compiling perf v0.1.0 (/Users/xxx/quinn/perf) Compiling bench v0.1.0 (/Users/xxx/quinn/bench) error[E0432]: unresolved import
proto::fuzzing
--> fuzz/fuzz_targets/packet.rs:7:5 | 7 | fuzzing::{PacketParams, PartialDecode}, | ^^^^^^^ could not findfuzzing
inproto
error[E0432]: unresolved import
proto::fuzzing
--> fuzz/fuzz_targets/streams.rs:7:12 | 7 | use proto::fuzzing::{ | ^^^^^^^ could not findfuzzing
inproto
For more information about this error, try
rustc --explain E0432
. error: could not compilefuzz
due to previous error warning: build failed, waiting for other jobs to finish... error: build failed