Skip to content

Commit f0e8290

Browse files
committed
Merge bitcoin#28967: build: disable external-signer for Windows
308aec3 build: disable external-signer for Windows (fanquake) 3553731 ci: remove --enable-external-signer from win64 job (fanquake) Pull request description: It's come to light that Boost ASIO (a Boost Process sub dep) has in some instances, been quietly 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 run any sanity checks, and before we call our own code to setup networking. Note that ASIO also calls WSAStartup with version `2.0`, whereas we call with `2.2`. 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. See also the discussion in bitcoin#24907. Note that the maintaince of Boost Process in general, has not really improved. For example, rather than fixing bugs like boostorg/process#111, i.e, boostorg/process#317, the maintainer chooses to just wrap exception causing overflows in try-catch blocks: boostorg/process@0c42a58. These changes get merged in large, unreviewed PRs, i.e boostorg/process#319. This PR disables external-signer on Windows for now. If, in future, someone changes how Boost Process works, or replaces it entirely with some properly reviewed and maintained code, we could reenable this feature on Windows. ACKs for top commit: hebasto: re-ACK 308aec3. TheCharlatan: ACK 308aec3 Tree-SHA512: 7405f7fc9833eeaacd6836c4e5b1c1a7845a40c1fdd55c1060152f8d8189e4777464fde650e11eb1539556a75dddf49667105987078b1457493ee772945da66e
2 parents 8431a19 + 308aec3 commit f0e8290

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
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",

ci/test/00_setup_env_win64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ export GOAL="deploy"
1616
# Prior to 11.0.0, the mingw-w64 headers were missing noreturn attributes, causing warnings when
1717
# cross-compiling for Windows. https://sourceforge.net/p/mingw-w64/bugs/306/
1818
# https://github.com/mingw-w64/mingw-w64/commit/1690994f515910a31b9fb7c7bd3a52d4ba987abe
19-
export BITCOIN_CONFIG="--enable-reduce-exports --enable-external-signer --disable-gui-tests CXXFLAGS=-Wno-return-type"
19+
export BITCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests CXXFLAGS=-Wno-return-type"

configure.ac

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,9 +1505,19 @@ if test "$use_external_signer" != "no"; then
15051505
CXXFLAGS="$TEMP_CXXFLAGS"
15061506
AC_MSG_RESULT([$have_boost_process])
15071507
if test "$have_boost_process" = "yes"; then
1508-
use_external_signer="yes"
1509-
AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled])
1510-
AC_DEFINE([BOOST_PROCESS_USE_STD_FS], [1], [Defined to avoid Boost::Process trying to use Boost Filesystem])
1508+
case $host in
1509+
dnl Boost Process for Windows uses Boost ASIO. Boost ASIO performs
1510+
dnl pre-main init of Windows networking libraries, which we do not
1511+
dnl want.
1512+
*mingw*)
1513+
use_external_signer="no"
1514+
;;
1515+
*)
1516+
use_external_signer="yes"
1517+
AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled])
1518+
AC_DEFINE([BOOST_PROCESS_USE_STD_FS], [1], [Defined to avoid Boost::Process trying to use Boost Filesystem])
1519+
;;
1520+
esac
15111521
else
15121522
if test "$use_external_signer" = "yes"; then
15131523
AC_MSG_ERROR([External signing is not supported for this Boost version])

0 commit comments

Comments
 (0)