Skip to content

Commit

Permalink
build: fix race where channeld_fakenet doesn't depend on external mod…
Browse files Browse the repository at this point in the history
…ules.

Because it wasn't in ALL_OBJS.  Copy the Makefile pattern!

```
Submodule 'src/secp256k1' (https://github.com/ElementsProject/secp256k1-zkp.git) registered for path 'external/libwally-core/src/secp256k1'
Cloning into '/home/runner/work/lightning/lightning/external/libwally-core/src/secp256k1'...
cc tests/plugins/channeld_fakenet.c
In file included from ./bitcoin/script.h:4,
                 from tests/plugins/channeld_fakenet.c:14:
./bitcoin/signature.h:6:10: fatal error: secp256k1.h: No such file or directory
    6 | #include <secp256k1.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:301: tests/plugins/channeld_fakenet.o] Error 1
make: *** Waiting for unfinished jobs....
Submodule path 'external/libwally-core/src/secp256k1': checked out
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Nov 14, 2024
1 parent b62e837 commit 7d2a3e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ PLUGIN_TESTSELFDISABLE_AFTER_GETMANIFEST_OBJS := $(PLUGIN_TESTSELFDISABLE_AFTER_

tests/plugins/test_selfdisable_after_getmanifest: bitcoin/chainparams.o $(PLUGIN_TESTSELFDISABLE_AFTER_GETMANIFEST_OBJS) common/autodata.o common/json_parse_simple.o common/setup.o common/utils.o $(JSMN_OBJS)

PLUGIN_CHANNELD_FAKENET_SRC := tests/plugins/channeld_fakenet.c
PLUGIN_CHANNELD_FAKENET_OBJS := $(PLUGIN_CHANNELD_FAKENET_SRC:.c=.o)

tests/plugins/channeld_fakenet: \
tests/plugins/channeld_fakenet.o \
$(PLUGIN_CHANNELD_FAKENET_OBJS) \
channeld/channeld_wiregen.o \
channeld/commit_tx.o \
bitcoin/block.o \
Expand Down Expand Up @@ -96,4 +99,4 @@ tests/plugins/channeld_fakenet: \

# Make sure these depend on everything.
ALL_TEST_PROGRAMS += tests/plugins/test_libplugin tests/plugins/test_selfdisable_after_getmanifest tests/plugins/channeld_fakenet
ALL_C_SOURCES += $(PLUGIN_TESTLIBPLUGIN_SRC) $(PLUGIN_TESTSELFDISABLE_AFTER_GETMANIFEST_SRC) $(PLUGIN_CHANNELD_FAKENET)
ALL_C_SOURCES += $(PLUGIN_TESTLIBPLUGIN_SRC) $(PLUGIN_TESTSELFDISABLE_AFTER_GETMANIFEST_SRC) $(PLUGIN_CHANNELD_FAKENET_SRC)

0 comments on commit 7d2a3e6

Please sign in to comment.