Skip to content

Commit 7ac4c3b

Browse files
authored
Merge pull request #1316 from TheBlueMatt/2022-02-no-fuzztarget
Drop `fuzztarget` feature entirely
2 parents 84c3f51 + b0cb558 commit 7ac4c3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+197
-83
lines changed

fuzz/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Automatically generated"]
55
publish = false
66
# Because the function is unused it gets dropped before we link lightning, so
77
# we have to duplicate build.rs here. Note that this is only required for
8-
# fuzztarget mode.
8+
# fuzzing mode.
99

1010
[package.metadata]
1111
cargo-fuzz = true
@@ -18,7 +18,7 @@ stdin_fuzz = []
1818

1919
[dependencies]
2020
afl = { version = "0.4", optional = true }
21-
lightning = { path = "../lightning", features = ["fuzztarget"] }
21+
lightning = { path = "../lightning", features = ["regex"] }
2222
bitcoin = { version = "0.27", features = ["fuzztarget", "secp-lowmemory"] }
2323
hex = "0.3"
2424
honggfuzz = { version = "0.5", optional = true }

fuzz/src/bin/chanmon_consistency_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::chanmon_consistency::*;
1720

fuzz/src/bin/chanmon_deser_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::chanmon_deser::*;
1720

fuzz/src/bin/full_stack_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::full_stack::*;
1720

fuzz/src/bin/msg_accept_channel_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::msg_targets::msg_accept_channel::*;
1720

fuzz/src/bin/msg_announcement_signatures_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::msg_targets::msg_announcement_signatures::*;
1720

fuzz/src/bin/msg_channel_announcement_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::msg_targets::msg_channel_announcement::*;
1720

fuzz/src/bin/msg_channel_reestablish_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::msg_targets::msg_channel_reestablish::*;
1720

fuzz/src/bin/msg_channel_update_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::msg_targets::msg_channel_update::*;
1720

fuzz/src/bin/msg_closing_signed_target.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
1414

15+
#[cfg(not(fuzzing))]
16+
compile_error!("Fuzz targets need cfg=fuzzing");
17+
1518
extern crate lightning_fuzz;
1619
use lightning_fuzz::msg_targets::msg_closing_signed::*;
1720

0 commit comments

Comments
 (0)