From 225fec065a9fac963ea07f2b182b4b9da0306179 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 10 Aug 2021 13:34:57 +0930 Subject: [PATCH] Build race fixes: create ccan/config.h atomically, make tools/test/test_gen.c depend on it Signed-off-by: Rusty Russell --- configure | 11 ++++++----- tools/test/Makefile | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 6282eca29..d9f008e5f 100755 --- a/configure +++ b/configure @@ -274,7 +274,7 @@ fi # Clean up on exit. trap "rm -f $CONFIG_VAR_FILE.$$" 0 -$CONFIGURATOR --extra-tests --autotools-style --var-file=$CONFIG_VAR_FILE.$$ --header-file=$CONFIG_HEADER --configurator-cc="$CONFIGURATOR_CC" --wrapper="$CONFIGURATOR_WRAPPER" "$CC" ${CWARNFLAGS-$BASE_WARNFLAGS} $CDEBUGFLAGS $COPTFLAGS -I/usr/local/include -L/usr/local/lib $SQLITE3_CFLAGS $POSTGRES_INCLUDE <> $CONFIG_HEADER +echo '#include "ccan_compat.h"' >> $CONFIG_HEADER.$$ # Now we set them all and check. while IFS='=' read VAR VAL; do @@ -447,3 +447,4 @@ if [ "$HAVE_SQLITE3" = 0 -a "$HAVE_POSTGRES" = 0 ]; then fi mv $CONFIG_VAR_FILE.$$ $CONFIG_VAR_FILE +mv $CONFIG_HEADER.$$ $CONFIG_HEADER diff --git a/tools/test/Makefile b/tools/test/Makefile index 38f7f1856..c39d3ba0a 100644 --- a/tools/test/Makefile +++ b/tools/test/Makefile @@ -43,7 +43,7 @@ tools/test/test_gen.h: $(TOOLS_WIRE_DEPS) tools/test/Makefile tools/test/test_gen.c.tmp.c: $(TOOLS_WIRE_DEPS) $(BOLT_GEN) --page impl tools/test/test_gen.h test_type < tools/test/test_cases > $@ -tools/test/test_gen.c: tools/test/test_gen.c.tmp.c $(EXTERNAL_HEADERS) tools/test/test_gen.h +tools/test/test_gen.c: tools/test/test_gen.c.tmp.c $(EXTERNAL_HEADERS) tools/test/test_gen.h $(CCAN_HEADERS) @MAKE=$(MAKE) tools/update-mocks.sh "$<" $(SUPPRESS_OUTPUT) && mv "$<" "$@" tools/test/print_gen.h: wire/onion$(EXP)_wiregen.h $(TOOLS_WIRE_DEPS)