Skip to content

Commit

Permalink
common/autodata: use instead of ccan/autodata
Browse files Browse the repository at this point in the history
This means it needs to be linked ~everywhere.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Sep 21, 2021
1 parent b594c53 commit 24536c5
Show file tree
Hide file tree
Showing 26 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bitcoin/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BITCOIN_TEST_SRC := $(wildcard bitcoin/test/run-*.c)
BITCOIN_TEST_OBJS := $(BITCOIN_TEST_SRC:.c=.o)
BITCOIN_TEST_PROGRAMS := $(BITCOIN_TEST_OBJS:.o=)

BITCOIN_TEST_COMMON_OBJS := common/utils.o common/setup.o
BITCOIN_TEST_COMMON_OBJS := common/utils.o common/setup.o common/autodata.o

$(BITCOIN_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_TEST_COMMON_OBJS) bitcoin/chainparams.o
$(BITCOIN_TEST_OBJS): $(CCAN_HEADERS) $(BITCOIN_HEADERS) $(BITCOIN_SRC)
Expand Down
1 change: 1 addition & 0 deletions channeld/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ LIGHTNINGD_CONTROL_OBJS += channeld/channeld_wiregen.o
# Common source we use.
CHANNELD_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/base32.o \
common/bigsize.o \
common/billboard.o \
Expand Down
1 change: 1 addition & 0 deletions channeld/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ALL_TEST_PROGRAMS += $(CHANNELD_TEST_PROGRAMS)

CHANNELD_TEST_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/channel_type.o \
common/daemon_conn.o \
common/features.o \
Expand Down
1 change: 1 addition & 0 deletions cli/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ALL_C_SOURCES += $(CLI_TEST_SRC)
ALL_TEST_PROGRAMS += $(CLI_TEST_PROGRAMS)

CLI_TEST_COMMON_OBJS := \
common/autodata.o \
common/configdir.o \
common/daemon_conn.o \
common/htlc_state.o \
Expand Down
1 change: 1 addition & 0 deletions closingd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ LIGHTNINGD_CONTROL_OBJS += closingd/closingd_wiregen.o
# Common source we use.
CLOSINGD_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/base32.o \
common/bigsize.o \
common/bip32.o \
Expand Down
1 change: 1 addition & 0 deletions common/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COMMON_TEST_OBJS := $(COMMON_TEST_SRC:.c=.o)
COMMON_TEST_PROGRAMS := $(COMMON_TEST_OBJS:.o=)

COMMON_TEST_COMMON_OBJS := \
common/autodata.o \
common/setup.o \
common/utils.o

Expand Down
2 changes: 1 addition & 1 deletion common/type_to_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define LIGHTNING_COMMON_TYPE_TO_STRING_H
#include "config.h"
#include "utils.h"
#include <ccan/autodata/autodata.h>
#include <common/autodata.h>

/* This must match the type_to_string_ cases. */
union printable_types {
Expand Down
1 change: 1 addition & 0 deletions connectd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ LIGHTNINGD_CONTROL_OBJS += connectd/connectd_wiregen.o
# Common source we use.
CONNECTD_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/base32.o \
common/base64.o \
common/bech32.o \
Expand Down
1 change: 1 addition & 0 deletions connectd/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CONNECTD_TEST_OBJS := $(CONNECTD_TEST_SRC:.c=.o)
CONNECTD_TEST_PROGRAMS := $(CONNECTD_TEST_OBJS:.o=)

CONNECTD_TEST_COMMON_OBJS := \
common/autodata.o \
common/features.o \
common/pseudorand.o \
common/setup.o \
Expand Down
1 change: 0 additions & 1 deletion contrib/sanitizer_suppressions/lsan
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Clang would detect false positive here, due to padding. See https://github.com/ElementsProject/lightning/pull/2285
leak:ccan/ccan/autodata/autodata.c
leak:ccan/ccan/htable/htable.c
1 change: 1 addition & 0 deletions devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ALL_PROGRAMS += $(DEVTOOLS)

DEVTOOLS_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/base32.o \
common/bech32.o \
common/bech32_util.o \
Expand Down
1 change: 1 addition & 0 deletions gossipd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ LIGHTNINGD_CONTROL_OBJS += gossipd/gossipd_wiregen.o
GOSSIPD_COMMON_OBJS := \
bitcoin/chainparams.o \
common/amount.o \
common/autodata.o \
common/base32.o \
common/bech32.o \
common/bech32_util.o \
Expand Down
1 change: 1 addition & 0 deletions gossipd/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ GOSSIPD_TEST_PROGRAMS := $(GOSSIPD_TEST_OBJS:.o=)

GOSSIPD_TEST_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/bigsize.o \
common/channel_id.o \
common/features.o \
Expand Down
1 change: 1 addition & 0 deletions hsmd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ALL_PROGRAMS += lightningd/lightning_hsmd
# Common source we use.
HSMD_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/bigsize.o \
common/bip32.o \
common/bolt12_merkle.o \
Expand Down
1 change: 1 addition & 0 deletions lightningd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ ALL_PROGRAMS += lightningd/lightningd
LIGHTNINGD_COMMON_OBJS := \
common/addr.o \
common/amount.o \
common/autodata.o \
common/base32.o \
common/base64.o \
common/bech32.o \
Expand Down
2 changes: 1 addition & 1 deletion lightningd/jsonrpc.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef LIGHTNING_LIGHTNINGD_JSONRPC_H
#define LIGHTNING_LIGHTNINGD_JSONRPC_H
#include "config.h"
#include <ccan/autodata/autodata.h>
#include <ccan/list/list.h>
#include <common/autodata.h>
#include <common/json.h>
#include <common/json_stream.h>
#include <common/status_levels.h>
Expand Down
1 change: 1 addition & 0 deletions lightningd/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ALL_TEST_PROGRAMS += $(LIGHTNINGD_TEST_PROGRAMS)

LIGHTNINGD_TEST_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/bech32.o \
common/daemon_conn.o \
common/htlc_state.o \
Expand Down
1 change: 1 addition & 0 deletions onchaind/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ LIGHTNINGD_CONTROL_OBJS += \
# Common source we use.
ONCHAIND_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/bigsize.o \
common/bip32.o \
common/coin_mvt.o \
Expand Down
1 change: 1 addition & 0 deletions onchaind/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ALL_TEST_PROGRAMS += $(ONCHAIND_TEST_PROGRAMS)

ONCHAIND_TEST_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/features.o \
common/pseudorand.o \
common/setup.o \
Expand Down
1 change: 1 addition & 0 deletions openingd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ LIGHTNINGD_CONTROL_OBJS += openingd/openingd_wiregen.o openingd/dualopend_wirege
# Common source we use.
OPENINGD_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/base32.o \
common/bigsize.o \
common/billboard.o \
Expand Down
1 change: 1 addition & 0 deletions plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ PLUGIN_COMMON_OBJS := \
bitcoin/tx.o \
bitcoin/varint.o \
common/amount.o \
common/autodata.o \
common/base32.o \
common/bech32.o \
common/bech32_util.o \
Expand Down
1 change: 1 addition & 0 deletions plugins/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ALL_TEST_PROGRAMS += $(PLUGIN_TEST_PROGRAMS)

PLUGIN_TEST_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/pseudorand.o \
common/setup.o \
common/type_to_string.o \
Expand Down
2 changes: 1 addition & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tools/headerversions: $(FORCE) tools/headerversions.o $(CCAN_OBJS)

tools/check-bolt: tools/check-bolt.o $(CCAN_OBJS) $(TOOLS_COMMON_OBJS)

tools/hsmtool: tools/hsmtool.o $(CCAN_OBJS) $(TOOLS_COMMON_OBJS) $(BITCOIN_OBJS) common/amount.o common/bech32.o common/bigsize.o common/configdir.o common/derive_basepoints.o common/descriptor_checksum.o common/hsm_encryption.o common/node_id.o common/type_to_string.o common/version.o wire/fromwire.o wire/towire.o
tools/hsmtool: tools/hsmtool.o $(CCAN_OBJS) $(TOOLS_COMMON_OBJS) $(BITCOIN_OBJS) common/amount.o common/autodata.o common/bech32.o common/bigsize.o common/configdir.o common/derive_basepoints.o common/descriptor_checksum.o common/hsm_encryption.o common/node_id.o common/type_to_string.o common/version.o wire/fromwire.o wire/towire.o

tools/lightning-hsmtool: tools/hsmtool
cp $< $@
Expand Down
2 changes: 1 addition & 1 deletion wallet/db_common.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef LIGHTNING_WALLET_DB_COMMON_H
#define LIGHTNING_WALLET_DB_COMMON_H
#include "config.h"
#include <ccan/autodata/autodata.h>
#include <ccan/list/list.h>
#include <ccan/short_types/short_types.h>
#include <common/autodata.h>

/* For testing, we want to catch fatal messages. */
#ifndef db_fatal
Expand Down
1 change: 1 addition & 0 deletions wallet/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ALL_TEST_PROGRAMS += $(WALLET_TEST_PROGRAMS)

WALLET_TEST_COMMON_OBJS := \
common/amount.o \
common/autodata.o \
common/base32.o \
common/blockheight_states.o \
common/channel_type.o \
Expand Down
1 change: 1 addition & 0 deletions wire/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ALL_C_SOURCES += $(WIRE_TEST_SRC)
ALL_TEST_PROGRAMS += $(WIRE_TEST_PROGRAMS)

WIRE_TEST_COMMON_OBJS := \
common/autodata.o \
common/pseudorand.o \
common/setup.o \
common/utils.o
Expand Down

0 comments on commit 24536c5

Please sign in to comment.