From 6e1c16c1442ab30694a3668b45af5bfd532f1e12 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Wed, 25 May 2022 11:40:51 -0400 Subject: [PATCH 1/2] multiprocess build fix: ipc/capnp/init.capnp.h: No such file or directory Error was reported by SatoriHoshiAiko in https://github.com/bitcoin/bitcoin/issues/25207 and happens unpredictably because make doesn't always build dependencies in the same order. The source file src/ipc/capnp/protocol.cpp includes some generated headers so needs to have an explicit dependency specified in the makefile so the headers will be generated before the file is compiled. #19160 added the explicit dependency, but it was incorrect because it referred to an old file path from before the source file was renamed (ipc.cpp -> protocol.cpp) --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 7f82d188f0..0f72182f23 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -330,7 +330,7 @@ obj/build.h: FORCE "$(abs_top_srcdir)" libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h -ipc/capnp/libbitcoin_ipc_a-ipc.$(OBJEXT): $(libbitcoin_ipc_mpgen_input:=.h) +ipc/capnp/libbitcoin_ipc_a-protocol.$(OBJEXT): $(libbitcoin_ipc_mpgen_input:=.h) # server: shared between bitcoind and bitcoin-qt # Contains code accessing mempool and chain state that is meant to be separated From 44904aa632cbe0722a52f1907ae015f1c6338ddf Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Wed, 25 May 2022 18:01:22 -0400 Subject: [PATCH 2/2] multiprocess build cleanup: comment on manual dependencies Also move manual dependency closer to actual build target --- src/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0f72182f23..96934bde7a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -330,7 +330,6 @@ obj/build.h: FORCE "$(abs_top_srcdir)" libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h -ipc/capnp/libbitcoin_ipc_a-protocol.$(OBJEXT): $(libbitcoin_ipc_mpgen_input:=.h) # server: shared between bitcoind and bitcoin-qt # Contains code accessing mempool and chain state that is meant to be separated @@ -1012,6 +1011,10 @@ libbitcoin_ipc_mpgen_input = \ EXTRA_DIST += $(libbitcoin_ipc_mpgen_input) %.capnp: +# Explicitly list dependencies on generated headers as described in +# https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually +ipc/capnp/libbitcoin_ipc_a-protocol.$(OBJEXT): $(libbitcoin_ipc_mpgen_input:=.h) + if BUILD_MULTIPROCESS LIBBITCOIN_IPC=libbitcoin_ipc.a libbitcoin_ipc_a_SOURCES = \