Skip to content

Commit 308aec3

Browse files
committed
build: disable external-signer for Windows
It's come to light that Boost ASIO (a Boost Process sub dep) has in some instances, been queitly initialising our network stack on Windows (see PR bitcoin#28486 and discussion in bitcoin#28940). This has been shielding a bug in our own code, but the larger issue is that Boost Process/ASIO is running code before main, and doing things like setting up networking. This undermines our own assumptions about how our binary works, happens before we get to run any sanity checks, and also runs before we call our own code to setup networking. It's also not clear why a feature like external signer would have a dependency that would be doing anything network/socket related, given it only exists to spawn a local process.
1 parent 3553731 commit 308aec3

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

build_msvc/bitcoin_config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
/* Define this symbol to enable ZMQ functions */
4242
#define ENABLE_ZMQ 1
4343

44-
/* define if external signer support is enabled (requires Boost::Process) */
45-
#define ENABLE_EXTERNAL_SIGNER /**/
46-
4744
/* Define to 1 if you have the declaration of `be16toh', and to 0 if you
4845
don't. */
4946
#define HAVE_DECL_BE16TOH 0

build_msvc/vcpkg.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"berkeleydb",
66
"boost-date-time",
77
"boost-multi-index",
8-
"boost-process",
98
"boost-signals2",
109
"boost-test",
1110
"libevent",

configure.ac

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,9 +1515,19 @@ if test "$use_external_signer" != "no"; then
15151515
CXXFLAGS="$TEMP_CXXFLAGS"
15161516
AC_MSG_RESULT([$have_boost_process])
15171517
if test "$have_boost_process" = "yes"; then
1518-
use_external_signer="yes"
1519-
AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled])
1520-
AC_DEFINE([BOOST_PROCESS_USE_STD_FS], [1], [Defined to avoid Boost::Process trying to use Boost Filesystem])
1518+
case $host in
1519+
dnl Boost Process for Windows uses Boost ASIO. Boost ASIO performs
1520+
dnl pre-main init of Windows networking libraries, which we do not
1521+
dnl want.
1522+
*mingw*)
1523+
use_external_signer="no"
1524+
;;
1525+
*)
1526+
use_external_signer="yes"
1527+
AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled])
1528+
AC_DEFINE([BOOST_PROCESS_USE_STD_FS], [1], [Defined to avoid Boost::Process trying to use Boost Filesystem])
1529+
;;
1530+
esac
15211531
else
15221532
if test "$use_external_signer" = "yes"; then
15231533
AC_MSG_ERROR([External signing is not supported for this Boost version])

0 commit comments

Comments
 (0)