Skip to content

Commit

Permalink
build: depends makes libmultiprocess by default
Browse files Browse the repository at this point in the history
Except for Windows and OpenBSD.
  • Loading branch information
Sjors committed Feb 27, 2025
1 parent 7e05d88 commit 7b632b7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_i686_no_multiprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export CONTAINER_NAME=ci_i686_no_multiprocess
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
export CI_IMAGE_PLATFORM="linux/amd64"
export PACKAGES="llvm clang g++-multilib"
export DEP_OPTS="DEBUG=1"
export DEP_OPTS="DEBUG=1 NO_MULTIPROCESS=1"
export GOAL="install"
export TEST_RUNNER_EXTRA="--v2transport"
export BITCOIN_CONFIG="\
Expand Down
11 changes: 7 additions & 4 deletions depends/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ NO_SQLITE ?=
NO_WALLET ?=
NO_ZMQ ?=
NO_USDT ?=
MULTIPROCESS ?=
# Default NO_MULTIPROCESS value is 1 on unsupported host platforms:
# - Windows
# - OpenBSD: https://github.com/capnproto/capnproto/pull/1907
NO_MULTIPROCESS ?= $(if $(findstring mingw32,$(HOST))$(findstring openbsd,$(HOST)),1,)
LTO ?=
NO_HARDEN ?=
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
Expand Down Expand Up @@ -165,7 +168,7 @@ sqlite_packages_$(NO_SQLITE) = $(sqlite_packages)
wallet_packages_$(NO_WALLET) = $(bdb_packages_) $(sqlite_packages_)

zmq_packages_$(NO_ZMQ) = $(zmq_packages)
multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages)
multiprocess_packages_$(NO_MULTIPROCESS) = $(multiprocess_packages)
usdt_packages_$(NO_USDT) = $(usdt_$(host_os)_packages)

packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(boost_packages_) $(libevent_packages_) $(qt_packages_) $(wallet_packages_) $(usdt_packages_)
Expand All @@ -175,7 +178,7 @@ ifneq ($(zmq_packages_),)
packages += $(zmq_packages)
endif

ifeq ($(multiprocess_packages_),)
ifneq ($(multiprocess_packages_),)
packages += $(multiprocess_packages)
native_packages += $(multiprocess_native_packages)
endif
Expand Down Expand Up @@ -237,7 +240,7 @@ $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(fina
-e 's|@sqlite_packages@|$(sqlite_packages_)|' \
-e 's|@usdt_packages@|$(usdt_packages_)|' \
-e 's|@no_harden@|$(NO_HARDEN)|' \
-e 's|@multiprocess@|$(MULTIPROCESS)|' \
-e 's|@multiprocess_packages@|$(multiprocess_packages_)|' \
$< > $@
touch $@

Expand Down
2 changes: 1 addition & 1 deletion depends/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ The following can be set when running make: `make FOO=bar`
- `NO_BDB`: Don't download/build/cache BerkeleyDB
- `NO_SQLITE`: Don't download/build/cache SQLite
- `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints
- `MULTIPROCESS`: Build libmultiprocess (experimental)
- `NO_MULTIPROCESS`: Don't build experimental libmultiprocess (default on Windows and OpenBSD)
- `DEBUG`: Disable some optimizations and enable more runtime checking
- `HOST_ID_SALT`: Optional salt to use when generating host package ids
- `BUILD_ID_SALT`: Optional salt to use when generating build package ids
Expand Down
7 changes: 4 additions & 3 deletions depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ else()
set(ENABLE_HARDENING ON CACHE BOOL "")
endif()

if("@multiprocess@" STREQUAL "1")
set(multiprocess_packages @multiprocess_packages@)
if("${multiprocess_packages}" STREQUAL "")
set(ENABLE_IPC OFF CACHE BOOL "")
else()
set(ENABLE_IPC ON CACHE BOOL "")
set(MPGEN_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/mpgen" CACHE FILEPATH "")
set(CAPNP_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/capnp" CACHE FILEPATH "")
set(CAPNPC_CXX_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/capnpc-c++" CACHE FILEPATH "")
else()
set(ENABLE_IPC OFF CACHE BOOL "")
endif()
6 changes: 3 additions & 3 deletions doc/multiprocess.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Specifying `-DENABLE_IPC=ON` requires [Cap'n Proto](https://capnproto.org/) to b

### Depends installation

Alternately the [depends system](../depends) can be used to avoid need to install local dependencies. A simple way to get started is to pass the `MULTIPROCESS=1` [dependency option](../depends#dependency-options) to make:
Alternatively the [depends system](../depends) can be used to avoid needing to local install dependencies:

```
cd <BITCOIN_SOURCE_DIRECTORY>
make -C depends NO_QT=1 MULTIPROCESS=1
make -C depends NO_QT=1
# Set host platform to output of gcc -dumpmachine or clang -dumpmachine or check the depends/ directory for the generated subdirectory name
HOST_PLATFORM="x86_64-pc-linux-gnu"
cmake -B build --toolchain=depends/$HOST_PLATFORM/toolchain.cmake
Expand All @@ -29,7 +29,7 @@ build/src/bitcoin-node -regtest -printtoconsole -debug=ipc
BITCOIND=$(pwd)/build/src/bitcoin-node build/test/functional/test_runner.py
```

The `cmake` build will pick up settings and library locations from the depends directory, so there is no need to pass `-DENABLE_IPC=ON` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option).
The `cmake` build will pick up settings and library locations from the depends directory, so there is no need to pass `-DENABLE_IPC=ON` as a separate flag when using the depends system (it's controlled by the `NO_MULTIPROCESS=1` option).

### Cross-compiling

Expand Down

0 comments on commit 7b632b7

Please sign in to comment.