From 5cd06227d7ec15084f1c61e0c3031a6ecdb7ea22 Mon Sep 17 00:00:00 2001 From: niftynei Date: Wed, 9 Sep 2020 19:40:29 +0930 Subject: [PATCH] build: exclude dualopend from non-experimental builds --- Makefile | 8 ++++++-- channeld/Makefile | 5 ++++- closingd/Makefile | 5 ++++- common/Makefile | 11 +++++------ common/test/Makefile | 5 +++++ common/test/{run-psbt_diff.c => exp-run-psbt_diff.c} | 0 connectd/Makefile | 5 ++++- devtools/Makefile | 5 ++++- gossipd/Makefile | 5 ++++- hsmd/Makefile | 4 +++- lightningd/Makefile | 12 ++++++++++-- lightningd/dual_open_control.c | 2 -- lightningd/test/run-find_my_abspath.c | 1 - lightningd/test/run-invoice-select-inchan.c | 1 - lightningd/test/run-jsonrpc.c | 1 - lightningd/test/run-log-pruning.c | 1 - onchaind/Makefile | 5 ++++- openingd/Makefile | 12 ++++++++++-- wallet/reservation.c | 1 - 19 files changed, 63 insertions(+), 26 deletions(-) rename common/test/{run-psbt_diff.c => exp-run-psbt_diff.c} (100%) diff --git a/Makefile b/Makefile index bcd6b68d2..2616def09 100644 --- a/Makefile +++ b/Makefile @@ -580,8 +580,12 @@ PKGLIBEXEC_PROGRAMS = \ lightningd/lightning_gossipd \ lightningd/lightning_hsmd \ lightningd/lightning_onchaind \ - lightningd/lightning_openingd \ - lightningd/lightning_dualopend + lightningd/lightning_openingd + +# Only build dualopend if experimental features is on +ifeq ($(EXPERIMENTAL_FEATURES),1) +PKGLIBEXEC_PROGRAMS += lightningd/lightning_dualopend +endif # $(PLUGINS) is defined in plugins/Makefile. diff --git a/channeld/Makefile b/channeld/Makefile index 2d5ecd45b..d5c06a474 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -70,7 +70,6 @@ CHANNELD_COMMON_OBJS := \ common/per_peer_state.o \ common/permute_tx.o \ common/ping.o \ - common/psbt_open.o \ common/pseudorand.o \ common/read_peer_msg.o \ common/setup.o \ @@ -90,6 +89,10 @@ CHANNELD_COMMON_OBJS := \ wire/fromwire.o \ wire/towire.o +ifeq ($(EXPERIMENTAL_FEATURES),1) +CHANNELD_COMMON_OBJS += common/psbt_open.o +endif + channeld/gen_full_channel_error_names.h: channeld/full_channel_error.h ccan/ccan/cdump/tools/cdump-enumstr ccan/ccan/cdump/tools/cdump-enumstr channeld/full_channel_error.h > $@ diff --git a/closingd/Makefile b/closingd/Makefile index 6e9ee1417..43591d79d 100644 --- a/closingd/Makefile +++ b/closingd/Makefile @@ -46,7 +46,6 @@ CLOSINGD_COMMON_OBJS := \ common/peer_failed.o \ common/per_peer_state.o \ common/permute_tx.o \ - common/psbt_open.o \ common/pseudorand.o \ common/read_peer_msg.o \ common/setup.o \ @@ -62,6 +61,10 @@ CLOSINGD_COMMON_OBJS := \ common/wireaddr.o \ gossipd/gossipd_peerd_wiregen.o +ifeq ($(EXPERIMENTAL_FEATURES),1) +CLOSINGD_COMMON_OBJS += common/psbt_open.o +endif + lightningd/lightning_closingd: $(CLOSINGD_OBJS) $(WIRE_ONION_OBJS) $(CLOSINGD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(HSMD_CLIENT_OBJS) -include closingd/test/Makefile diff --git a/common/Makefile b/common/Makefile index c7139afc1..33f2caf68 100644 --- a/common/Makefile +++ b/common/Makefile @@ -56,7 +56,6 @@ COMMON_SRC_NOGEN := \ common/peer_failed.c \ common/permute_tx.c \ common/ping.c \ - common/psbt_open.c \ common/pseudorand.c \ common/random_select.c \ common/read_peer_msg.c \ @@ -76,6 +75,11 @@ COMMON_SRC_NOGEN := \ common/wireaddr.c \ common/wire_error.c + +ifeq ($(EXPERIMENTAL_FEATURES),1) +COMMON_SRC_NOGEN += common/psbt_open.c +endif + COMMON_SRC_GEN := common/status_wiregen.c common/peer_status_wiregen.c COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \ @@ -109,11 +113,6 @@ common/gen_htlc_state_names.h: common/htlc_state.h ccan/ccan/cdump/tools/cdump-e common/gossip_store.o: gossipd/gossip_store_wiregen.h -check-makefile: check-common-makefile - -check-common-makefile: - if [ x"`LC_ALL=C ls common/*.h | grep -v ^common/gen_ | grep -v '^common/.*wiregen'`" != x"`echo $(COMMON_HEADERS_NOGEN) | tr ' ' '\n' | LC_ALL=C sort`" ]; then echo COMMON_HEADERS_NOGEN incorrect; exit 1; fi - check-source-bolt: $(COMMON_SRC_NOGEN:%=bolt-check/%) $(COMMON_HEADERS:%=bolt-check/%) check-whitespace: $(COMMON_SRC_NOGEN:%=check-whitespace/%) $(COMMON_HEADERS:%=check-whitespace/%) diff --git a/common/test/Makefile b/common/test/Makefile index 42065c669..507e4e5fc 100644 --- a/common/test/Makefile +++ b/common/test/Makefile @@ -1,4 +1,9 @@ COMMON_TEST_SRC := $(wildcard common/test/run-*.c) + +ifeq ($(EXPERIMENTAL_FEATURES),1) +COMMON_TEST_SRC += $(wildcard common/test/exp-run-*.c) +endif + COMMON_TEST_OBJS := $(COMMON_TEST_SRC:.c=.o) COMMON_TEST_PROGRAMS := $(COMMON_TEST_OBJS:.o=) diff --git a/common/test/run-psbt_diff.c b/common/test/exp-run-psbt_diff.c similarity index 100% rename from common/test/run-psbt_diff.c rename to common/test/exp-run-psbt_diff.c diff --git a/connectd/Makefile b/connectd/Makefile index 397558128..5636deb1d 100644 --- a/connectd/Makefile +++ b/connectd/Makefile @@ -49,7 +49,6 @@ CONNECTD_COMMON_OBJS := \ common/node_id.o \ common/onionreply.o \ common/per_peer_state.o \ - common/psbt_open.o \ common/pseudorand.o \ common/setup.o \ common/status.o \ @@ -66,6 +65,10 @@ CONNECTD_COMMON_OBJS := \ lightningd/gossip_msg.o \ wire/onion$(EXP)_wiregen.o +ifeq ($(EXPERIMENTAL_FEATURES),1) +CONNECTD_COMMON_OBJS += common/psbt_open.o +endif + lightningd/lightning_connectd: $(CONNECTD_OBJS) $(CONNECTD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(HSMD_CLIENT_OBJS) include connectd/test/Makefile diff --git a/devtools/Makefile b/devtools/Makefile index 988eb8a06..e541a8c35 100644 --- a/devtools/Makefile +++ b/devtools/Makefile @@ -33,7 +33,6 @@ DEVTOOLS_COMMON_OBJS := \ common/memleak.o \ common/node_id.o \ common/per_peer_state.o \ - common/psbt_open.o \ common/pseudorand.o \ common/json.o \ common/json_helpers.o \ @@ -45,6 +44,10 @@ DEVTOOLS_COMMON_OBJS := \ wire/onion$(EXP)_wiregen.o \ wire/peer$(EXP)_wiregen.o +ifeq ($(EXPERIMENTAL_FEATURES),1) +DEVTOOLS_COMMON_OBJS += common/psbt_open.o +endif + devtools/bolt11-cli: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/bolt11-cli.o devtools/decodemsg: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_PRINT_OBJS) wire/fromwire.o wire/towire.o devtools/print_wire.o devtools/decodemsg.o diff --git a/gossipd/Makefile b/gossipd/Makefile index c50a490d8..5e819c062 100644 --- a/gossipd/Makefile +++ b/gossipd/Makefile @@ -51,7 +51,6 @@ GOSSIPD_COMMON_OBJS := \ common/onionreply.o \ common/per_peer_state.o \ common/ping.o \ - common/psbt_open.o \ common/pseudorand.o \ common/random_select.o \ common/setup.o \ @@ -69,6 +68,10 @@ GOSSIPD_COMMON_OBJS := \ lightningd/gossip_msg.o \ wire/onion$(EXP)_wiregen.o +ifeq ($(EXPERIMENTAL_FEATURES),1) +GOSSIPD_COMMON_OBJS += common/psbt_open.o +endif + lightningd/lightning_gossipd: $(GOSSIPD_OBJS) $(GOSSIPD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(HSMD_CLIENT_OBJS) include gossipd/test/Makefile diff --git a/hsmd/Makefile b/hsmd/Makefile index 9feab88c7..b4acf20c7 100644 --- a/hsmd/Makefile +++ b/hsmd/Makefile @@ -31,7 +31,6 @@ HSMD_COMMON_OBJS := \ common/msg_queue.o \ common/node_id.o \ common/permute_tx.o \ - common/psbt_open.o \ common/setup.o \ common/status.o \ common/status_wire.o \ @@ -41,6 +40,9 @@ HSMD_COMMON_OBJS := \ common/utxo.o \ common/version.o +ifeq ($(EXPERIMENTAL_FEATURES),1) +HSMD_COMMON_OBJS += common/psbt_open.o +endif lightningd/lightning_hsmd: $(HSMD_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) diff --git a/lightningd/Makefile b/lightningd/Makefile index 93b75471a..b82935563 100644 --- a/lightningd/Makefile +++ b/lightningd/Makefile @@ -8,7 +8,6 @@ LIGHTNINGD_SRC := \ lightningd/closing_control.c \ lightningd/coin_mvts.c \ lightningd/connect_control.c \ - lightningd/dual_open_control.c \ lightningd/onion_message.c \ lightningd/gossip_control.c \ lightningd/gossip_msg.c \ @@ -39,6 +38,12 @@ LIGHTNINGD_SRC := \ lightningd/subd.c \ lightningd/watch.c + +# Only build dualopend if experimental features is on +ifeq ($(EXPERIMENTAL_FEATURES),1) +LIGHTNINGD_SRC += lightningd/dual_open_control.c +endif + LIGHTNINGD_SRC_NOHDR := \ lightningd/signmessage.c @@ -101,7 +106,6 @@ LIGHTNINGD_COMMON_OBJS := \ common/penalty_base.o \ common/per_peer_state.o \ common/permute_tx.o \ - common/psbt_open.o \ common/pseudorand.o \ common/random_select.o \ common/setup.o \ @@ -116,6 +120,10 @@ LIGHTNINGD_COMMON_OBJS := \ common/wire_error.o \ common/wireaddr.o \ +ifeq ($(EXPERIMENTAL_FEATURES),1) +LIGHTNINGD_COMMON_OBJS += common/psbt_open.o +endif + include wallet/Makefile # All together in one convenient var diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index 63a7a6805..d1a85f494 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -30,7 +30,6 @@ #include #include -#if EXPERIMENTAL_FEATURES struct commit_rcvd { struct channel *channel; struct channel_id cid; @@ -1016,4 +1015,3 @@ void peer_start_dualopend(struct peer *peer, send_msg); subd_send_msg(uc->open_daemon, take(msg)); } -#endif /* EXPERIMENTAL_FEATURES */ diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index 8d76647bf..d19df9f77 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -6,7 +6,6 @@ int unused_main(int argc, char *argv[]); #include "../lightningd.c" #include "../subd.c" #include -#include /* AUTOGENERATED MOCKS START */ /* Generated stub for activate_peers */ diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 49660b73d..61efe48e7 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -3,7 +3,6 @@ #include "../routehint.c" #include #include -#include bool deprecated_apis = false; diff --git a/lightningd/test/run-jsonrpc.c b/lightningd/test/run-jsonrpc.c index 10a2014fd..19d95c540 100644 --- a/lightningd/test/run-jsonrpc.c +++ b/lightningd/test/run-jsonrpc.c @@ -1,7 +1,6 @@ #include "../../common/json_stream.c" #include "../jsonrpc.c" #include "../json.c" -#include /* AUTOGENERATED MOCKS START */ /* Generated stub for db_begin_transaction_ */ diff --git a/lightningd/test/run-log-pruning.c b/lightningd/test/run-log-pruning.c index 9215412f6..f55266ab3 100644 --- a/lightningd/test/run-log-pruning.c +++ b/lightningd/test/run-log-pruning.c @@ -1,5 +1,4 @@ #include "../log.c" -#include #include /* AUTOGENERATED MOCKS START */ diff --git a/onchaind/Makefile b/onchaind/Makefile index 04cdefd66..42a6e523b 100644 --- a/onchaind/Makefile +++ b/onchaind/Makefile @@ -53,7 +53,6 @@ ONCHAIND_COMMON_OBJS := \ common/onionreply.o \ common/peer_billboard.o \ common/permute_tx.o \ - common/psbt_open.o \ common/setup.o \ common/status.o \ common/status_wire.o \ @@ -64,6 +63,10 @@ ONCHAIND_COMMON_OBJS := \ common/version.o \ common/wallet.o +ifeq ($(EXPERIMENTAL_FEATURES),1) +ONCHAIND_COMMON_OBJS += common/psbt_open.o +endif + lightningd/lightning_onchaind: $(ONCHAIND_OBJS) $(WIRE_ONION_OBJS) $(ONCHAIND_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(HSMD_CLIENT_OBJS) include onchaind/test/Makefile diff --git a/openingd/Makefile b/openingd/Makefile index 2632c4c16..5c1db703f 100644 --- a/openingd/Makefile +++ b/openingd/Makefile @@ -23,7 +23,12 @@ $(DUALOPEND_OBJS): $(DUALOPEND_HEADERS) # Make sure these depend on everything. ALL_C_SOURCES += $(OPENINGD_SRC) $(DUALOPEND_SRC) ALL_C_HEADERS += $(OPENINGD_HEADERS) $(DUALOPEND_HEADERS) -ALL_PROGRAMS += lightningd/lightning_openingd lightningd/lightning_dualopend +ALL_PROGRAMS += lightningd/lightning_openingd + +# Only build dualopend if experimental features is on +ifeq ($(EXPERIMENTAL_FEATURES),1) +ALL_PROGRAMS += lightningd/lightning_dualopend +endif # Here's what lightningd depends on LIGHTNINGD_CONTROL_HEADERS += openingd/openingd_wiregen.h openingd/dualopend_wiregen.h @@ -65,7 +70,6 @@ OPENINGD_COMMON_OBJS := \ common/peer_billboard.o \ common/peer_failed.o \ common/permute_tx.o \ - common/psbt_open.o \ common/pseudorand.o \ common/read_peer_msg.o \ common/setup.o \ @@ -81,6 +85,10 @@ OPENINGD_COMMON_OBJS := \ gossipd/gossipd_peerd_wiregen.o \ lightningd/gossip_msg.o +ifeq ($(EXPERIMENTAL_FEATURES),1) +OPENINGD_COMMON_OBJS += common/psbt_open.o +endif + lightningd/lightning_openingd: $(OPENINGD_OBJS) $(OPENINGD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(HSMD_CLIENT_OBJS) lightningd/lightning_dualopend: $(DUALOPEND_OBJS) $(OPENINGD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(HSMD_CLIENT_OBJS) diff --git a/wallet/reservation.c b/wallet/reservation.c index 6d581908e..867e3735a 100644 --- a/wallet/reservation.c +++ b/wallet/reservation.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include