quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

cargo build --workspace failed at fuzz #1329

Closed Kiddinglife closed 2 years ago

Kiddinglife commented 2 years ago

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

Ralith commented 2 years ago

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.