Makefile: check that hsm_version.h changes if wire/hsmd_wire.csv contents does

Otherwise I know we'll miss it.  Simply check for a mention: we could well
change things multiple times within a single release.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-10-17 11:05:01 +10:30
parent fee9a7ce04
commit 987adb9718
2 changed files with 14 additions and 0 deletions

View File

@@ -4,6 +4,14 @@
/* We give a maximum and minimum compatibility version to HSM, to allow
* some API adaptation. */
/* wire/hsmd_wire.csv contents version:
* 409cffa355ab6cc76bd298910adca9936a68223267ddc4815ba16aeac5d0acc3
*/
#define HSM_MIN_VERSION 1
/* wire/hsmd_wire.csv contents version:
* 409cffa355ab6cc76bd298910adca9936a68223267ddc4815ba16aeac5d0acc3
*/
#define HSM_MAX_VERSION 1
#endif /* LIGHTNING_COMMON_HSM_VERSION_H */

View File

@@ -56,4 +56,10 @@ HSMD_COMMON_OBJS := \
lightningd/lightning_hsmd: $(HSMD_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS)
check-source: check-hsm-versions
# common/hsm_version.h should at least *mention* this!
check-hsm-versions: hsmd/hsmd_wire.csv common/hsm_version.h
@SUM=`grep -vE '^(#| *$$)' hsmd/hsmd_wire.csv | sha256sum | cut -c1-64`; if ! grep -q "$$SUM" common/hsm_version.h; then echo "*** hsmd_wire.csv changed to $$SUM without update to common/hsm_version.h">&2; exit 1; fi
-include hsmd/test/Makefile