Skip to content

Commit

Permalink
build: disable external-signer for Windows
Browse files Browse the repository at this point in the history
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 #28486 and discussion in #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.
  • Loading branch information
fanquake authored and janus committed Apr 1, 2024
1 parent d9f79cb commit 3e514e3
Show file tree
Hide file tree
Showing 4 changed files with 622 additions and 7 deletions.
3 changes: 0 additions & 3 deletions build_msvc/BGL_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
/* Define this symbol to enable ZMQ functions */
#define ENABLE_ZMQ 1

/* define if external signer support is enabled (requires Boost::Process) */
#define ENABLE_EXTERNAL_SIGNER /**/

/* Define to 1 if you have the declaration of `be16toh', and to 0 if you
don't. */
#define HAVE_DECL_BE16TOH 0
Expand Down
1 change: 0 additions & 1 deletion build_msvc/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"berkeleydb",
"boost-date-time",
"boost-multi-index",
"boost-process",
"boost-signals2",
"boost-test",
"libevent",
Expand Down
16 changes: 13 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1531,9 +1531,19 @@ if test "$use_external_signer" != "no"; then
CXXFLAGS="$TEMP_CXXFLAGS"
AC_MSG_RESULT([$have_boost_process])
if test "$have_boost_process" = "yes"; then
use_external_signer="yes"
AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled])
AC_DEFINE([BOOST_PROCESS_USE_STD_FS], [1], [Defined to avoid Boost::Process trying to use Boost Filesystem])
case $host in
dnl Boost Process for Windows uses Boost ASIO. Boost ASIO performs
dnl pre-main init of Windows networking libraries, which we do not
dnl want.
*mingw*)
use_external_signer="no"
;;
*)
use_external_signer="yes"
AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled])
AC_DEFINE([BOOST_PROCESS_USE_STD_FS], [1], [Defined to avoid Boost::Process trying to use Boost Filesystem])
;;
esac
else
if test "$use_external_signer" = "yes"; then
AC_MSG_ERROR([External signing is not supported for this Boost version])
Expand Down
Loading

0 comments on commit 3e514e3

Please sign in to comment.