Skip to content

Commit

Permalink
build: don't generate experimental variants of wire files.
Browse files Browse the repository at this point in the history
We no longer have any experimental-only wire definitions.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed May 23, 2023
1 parent 45ef168 commit 4deb552
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 147 deletions.
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,6 @@ config.vars:
%.o: %.c
@$(call VERBOSE, "cc $<", $(CC) $(CFLAGS) -c -o $@ $<)

# '_exp' inserted before _wiregen.[ch] to demark experimental
# spec-derived headers, which are *not* committed into git.
ifeq ($(EXPERIMENTAL_FEATURES),1)
EXP := _exp
else
EXP :=
endif

# tools/update-mocks.sh does nasty recursive make, must not do this!
ifeq ($(SUPPRESS_GENERATION),1)
SHA256STAMP_CHANGED = false
Expand Down
4 changes: 0 additions & 4 deletions common/bolt12.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#ifndef LIGHTNING_COMMON_BOLT12_H
#define LIGHTNING_COMMON_BOLT12_H
#include "config.h"
#if EXPERIMENTAL_FEATURES
#include <wire/bolt12_exp_wiregen.h>
#else
#include <wire/bolt12_wiregen.h>
#endif

struct feature_set;

Expand Down
24 changes: 12 additions & 12 deletions common/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ ALL_C_SOURCES += $(COMMON_TEST_SRC)
ALL_TEST_PROGRAMS += $(COMMON_TEST_PROGRAMS)

# Sphinx test wants to decode TLVs.
common/test/run-sphinx: wire/onion$(EXP)_wiregen.o wire/towire.o wire/fromwire.o
common/test/run-blindedpath_enctlv common/test/run-blindedpath_onion: common/base32.o common/wireaddr.o wire/onion$(EXP)_wiregen.o wire/peer$(EXP)_wiregen.o wire/towire.o wire/fromwire.o wire/tlvstream.o
common/test/run-route_blinding_test: wire/onion$(EXP)_wiregen.o wire/peer$(EXP)_wiregen.o wire/towire.o wire/fromwire.o wire/tlvstream.o common/coin_mvt.o
common/test/run-route_blinding_override_test: common/base32.o common/wireaddr.o wire/onion$(EXP)_wiregen.o wire/peer$(EXP)_wiregen.o wire/towire.o wire/fromwire.o wire/tlvstream.o common/coin_mvt.o
common/test/run-sphinx: wire/onion_wiregen.o wire/towire.o wire/fromwire.o
common/test/run-blindedpath_enctlv common/test/run-blindedpath_onion: common/base32.o common/wireaddr.o wire/onion_wiregen.o wire/peer_wiregen.o wire/towire.o wire/fromwire.o wire/tlvstream.o
common/test/run-route_blinding_test: wire/onion_wiregen.o wire/peer_wiregen.o wire/towire.o wire/fromwire.o wire/tlvstream.o common/coin_mvt.o
common/test/run-route_blinding_override_test: common/base32.o common/wireaddr.o wire/onion_wiregen.o wire/peer_wiregen.o wire/towire.o wire/fromwire.o wire/tlvstream.o common/coin_mvt.o

common/test/run-param \
common/test/run-json: \
Expand All @@ -38,35 +38,35 @@ common/test/run-json: \
common/type_to_string.o \
common/wireaddr.o \
wire/fromwire.o \
wire/onion$(EXP)_wiregen.o \
wire/peer$(EXP)_wiregen.o \
wire/onion_wiregen.o \
wire/peer_wiregen.o \
wire/towire.o

common/test/run-route common/test/run-route-specific: \
common/amount.o \
common/dijkstra.o \
common/fp16.o \
common/fp16.o \
common/gossmap.o \
common/node_id.o \
common/pseudorand.o \
common/route.o \
wire/fromwire.o \
wire/peer$(EXP)_wiregen.o \
wire/peer_wiregen.o \
wire/towire.o

common/test/run-gossmap_local: \
common/base32.o \
common/wireaddr.o \
wire/fromwire.o \
wire/peer$(EXP)_wiregen.o \
wire/peer_wiregen.o \
wire/tlvstream.o \
wire/towire.o

common/test/run-gossmap_canned: \
common/base32.o \
common/wireaddr.o \
wire/fromwire.o \
wire/peer$(EXP)_wiregen.o \
wire/peer_wiregen.o \
wire/tlvstream.o \
wire/towire.o

Expand All @@ -80,10 +80,10 @@ common/test/run-bolt12_merkle: \
common/node_id.o \
common/type_to_string.o \
common/wireaddr.o \
wire/bolt12$(EXP)_wiregen.o \
wire/bolt12_wiregen.o \
wire/fromwire.o \
wire/tlvstream.o \
wire/peer$(EXP)_wiregen.o \
wire/peer_wiregen.o \
wire/towire.o

common/test/run-bolt12_merkle-json: \
Expand Down
9 changes: 2 additions & 7 deletions common/test/run-bolt12_merkle-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
#include "../bolt12_merkle.c"
#include "../json_parse.c"
#include "../json_parse_simple.c"
#include "../../wire/bolt12_wiregen.c"
#include "../../wire/fromwire.c"
#include "../../wire/peer_wiregen.c"
#include "../../wire/tlvstream.c"
#if EXPERIMENTAL_FEATURES
#include "../../wire/peer_exp_wiregen.c"
#include "../../wire/bolt12_exp_wiregen.c"
#else
#include "../../wire/peer_wiregen.c"
#include "../../wire/bolt12_wiregen.c"
#endif
#include <ccan/tal/grab_file/grab_file.h>
#include <ccan/tal/path/path.h>
#include <common/channel_type.h>
Expand Down
9 changes: 2 additions & 7 deletions common/test/run-onion-message-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ static void maybe_print(const char *fmt, ...);
#include "../onion_message_parse.c"
#include "../sphinx.c"
#include "../type_to_string.c"
#if EXPERIMENTAL_FEATURES
#include "../../wire/onion_exp_wiregen.c"
#include "../../wire/peer_exp_wiregen.c"
#else
#include "../../wire/onion_wiregen.c"
#include "../../wire/peer_wiregen.c"
#endif
#include "../../wire/onion_wiregen.c"
#include "../../wire/peer_wiregen.c"
#include <common/ecdh.h>
#include <common/setup.h>
#include <stdio.h>
Expand Down
4 changes: 0 additions & 4 deletions common/test/run-onion-test-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
#include "../type_to_string.c"
#include "../../wire/towire.c"
#include "../../wire/fromwire.c"
#if EXPERIMENTAL_FEATURES
#include "../../wire/onion_exp_wiregen.c"
#else
#include "../../wire/onion_wiregen.c"
#endif
#include <ccan/tal/grab_file/grab_file.h>
#include <ccan/tal/path/path.h>
#include <common/channel_id.h>
Expand Down
6 changes: 1 addition & 5 deletions common/test/run-route_blinding_onion_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
#include "../onion_encode.c"
#include "../sphinx.c"
#include "../type_to_string.c"
#if EXPERIMENTAL_FEATURES
#include "../../wire/onion_exp_wiregen.c"
#else
#include "../../wire/onion_wiregen.c"
#endif
#include "../../wire/onion_wiregen.c"
#include <ccan/tal/grab_file/grab_file.h>
#include <ccan/tal/path/path.h>
#include <common/bolt12.h>
Expand Down
8 changes: 4 additions & 4 deletions devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ DEVTOOLS_COMMON_OBJS := \
common/utils.o \
common/version.o \
common/wireaddr.o \
wire/onion$(EXP)_wiregen.o \
wire/peer$(EXP)_wiregen.o \
wire/onion_wiregen.o \
wire/peer_wiregen.o \
wire/channel_type_wiregen.o \
wire/tlvstream.o

Expand All @@ -58,7 +58,7 @@ devtools/bolt11-cli: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(BITCOIN_OBJS) wire/f

devtools/encodeaddr: common/utils.o common/bech32.o devtools/encodeaddr.o

devtools/bolt12-cli: $(DEVTOOLS_COMMON_OBJS) $(BITCOIN_OBJS) wire/bolt12$(EXP)_wiregen.o wire/fromwire.o wire/towire.o common/bolt12.o common/bolt12_merkle.o devtools/bolt12-cli.o common/setup.o common/iso4217.o
devtools/bolt12-cli: $(DEVTOOLS_COMMON_OBJS) $(BITCOIN_OBJS) wire/bolt12_wiregen.o wire/fromwire.o wire/towire.o common/bolt12.o common/bolt12_merkle.o devtools/bolt12-cli.o common/setup.o common/iso4217.o

devtools/decodemsg: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(BITCOIN_OBJS) $(WIRE_PRINT_OBJS) wire/fromwire.o wire/towire.o devtools/print_wire.o devtools/decodemsg.o

Expand All @@ -73,7 +73,7 @@ devtools/onion.c: ccan/config.h

devtools/onion: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(BITCOIN_OBJS) common/onion_decode.o common/onion_encode.o common/onionreply.o wire/fromwire.o wire/towire.o devtools/onion.o common/sphinx.o

devtools/gossipwith: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o wire/peer$(EXP)_wiregen.o devtools/gossipwith.o common/cryptomsg.o common/cryptomsg.o
devtools/gossipwith: $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o wire/peer_wiregen.o devtools/gossipwith.o common/cryptomsg.o common/cryptomsg.o

$(DEVTOOLS_OBJS) $(DEVTOOLS_TOOL_OBJS): wire/wire.h

Expand Down
9 changes: 2 additions & 7 deletions devtools/decodemsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
#include <ccan/opt/opt.h>
#include <ccan/tal/grab_file/grab_file.h>
#include <unistd.h>
#if EXPERIMENTAL_FEATURES
#include <wire/onion_exp_printgen.h>
#include <wire/peer_exp_printgen.h>
#else
#include <wire/onion_printgen.h>
#include <wire/peer_printgen.h>
#endif
#include <wire/onion_printgen.h>
#include <wire/peer_printgen.h>

static char *opt_set_tlvname(const char *arg,
bool (**printwire)(const char *fieldname,
Expand Down
2 changes: 1 addition & 1 deletion gossipd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ GOSSIPD_COMMON_OBJS := \
common/wireaddr.o \
common/wire_error.o \
connectd/connectd_gossipd_wiregen.o \
wire/onion$(EXP)_wiregen.o
wire/onion_wiregen.o

lightningd/lightning_gossipd: $(GOSSIPD_OBJS) $(GOSSIPD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(HSMD_CLIENT_OBJS)

Expand Down
10 changes: 5 additions & 5 deletions plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ PLUGIN_COMMON_OBJS := \
common/wireaddr.o \
wire/channel_type_wiregen.o \
wire/fromwire.o \
wire/onion$(EXP)_wiregen.o \
wire/peer$(EXP)_wiregen.o \
wire/onion_wiregen.o \
wire/peer_wiregen.o \
wire/tlvstream.o \
wire/towire.o

Expand All @@ -182,7 +182,7 @@ ALL_PROGRAMS += $(C_PLUGINS)
# Make all plugins depend on all plugin headers, for simplicity.
$(PLUGIN_ALL_OBJS): $(PLUGIN_ALL_HEADER)

plugins/pay: $(PLUGIN_PAY_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_PAY_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) common/gossmap.o common/fp16.o common/route.o common/dijkstra.o common/bolt12.o common/bolt12_merkle.o wire/bolt12$(EXP)_wiregen.o bitcoin/block.o common/blindedpay.o common/blindedpath.o common/hmac.o common/blinding.o common/onion_encode.o
plugins/pay: $(PLUGIN_PAY_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_PAY_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) common/gossmap.o common/fp16.o common/route.o common/dijkstra.o common/bolt12.o common/bolt12_merkle.o wire/bolt12_wiregen.o bitcoin/block.o common/blindedpay.o common/blindedpath.o common/hmac.o common/blinding.o common/onion_encode.o

plugins/autoclean: $(PLUGIN_AUTOCLEAN_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)

Expand All @@ -192,13 +192,13 @@ plugins/commando: $(PLUGIN_COMMANDO_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJ

# Topology wants to decode node_announcement, and peer_wiregen which
# pulls in some of bitcoin/.
plugins/topology: common/route.o common/dijkstra.o common/gossmap.o common/fp16.o wire/peer$(EXP)_wiregen.o wire/channel_type_wiregen.o bitcoin/block.o bitcoin/preimage.o $(PLUGIN_TOPOLOGY_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
plugins/topology: common/route.o common/dijkstra.o common/gossmap.o common/fp16.o wire/peer_wiregen.o wire/channel_type_wiregen.o bitcoin/block.o bitcoin/preimage.o $(PLUGIN_TOPOLOGY_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)

plugins/txprepare: $(PLUGIN_TXPREPARE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)

plugins/bcli: $(PLUGIN_BCLI_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)

plugins/keysend: wire/tlvstream.o wire/onion$(EXP)_wiregen.o $(PLUGIN_KEYSEND_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_PAY_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) common/gossmap.o common/fp16.o common/route.o common/dijkstra.o common/blindedpay.o common/blindedpath.o common/hmac.o common/blinding.o common/onion_encode.o
plugins/keysend: wire/tlvstream.o wire/onion_wiregen.o $(PLUGIN_KEYSEND_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_PAY_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) common/gossmap.o common/fp16.o common/route.o common/dijkstra.o common/blindedpay.o common/blindedpath.o common/hmac.o common/blinding.o common/onion_encode.o
$(PLUGIN_KEYSEND_OBJS): $(PLUGIN_PAY_LIB_HEADER)

plugins/spenderp: bitcoin/block.o bitcoin/preimage.o bitcoin/psbt.o common/psbt_open.o wire/peer${EXP}_wiregen.o $(PLUGIN_SPENDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS)
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ FUZZ_COMMON_OBJS := \
wire/fromwire.o \
wire/onion_wiregen.o \
wire/peer_wire.o \
wire/peer$(EXP)_wiregen.o \
wire/peer_wiregen.o \
wire/channel_type_wiregen.o \
wire/tlvstream.o \
wire/towire.o \
Expand Down
2 changes: 1 addition & 1 deletion tools/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tools/test/test_gen.h: $(TOOLS_WIRE_DEPS) tools/test/Makefile
tools/test/test_gen.c: $(TOOLS_WIRE_DEPS) tools/test/Makefile
$(BOLT_GEN) --page impl tools/test/test_gen.h test_type < tools/test/test_cases > $@

tools/test/print_gen.h: wire/onion$(EXP)_wiregen.h $(TOOLS_WIRE_DEPS)
tools/test/print_gen.h: wire/onion_wiregen.h $(TOOLS_WIRE_DEPS)
$(BOLT_GEN) -P --page header $@ test_type < tools/test/test_cases > $@

tools/test/print_gen.c: $(TOOLS_WIRE_DEPS)
Expand Down
Loading

0 comments on commit 4deb552

Please sign in to comment.