Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/module/AddBoostIfNeeded.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function(add_boost_if_needed)
endif()
endif()

find_package(Boost 1.73.0 REQUIRED CONFIG)
find_package(Boost 1.74.0 REQUIRED CONFIG)
mark_as_advanced(Boost_INCLUDE_DIR boost_headers_DIR)
# Workaround for a bug in NetBSD pkgsrc.
# See: https://github.com/NetBSD/pkgsrc/issues/167.
Expand Down
11 changes: 4 additions & 7 deletions depends/packages/boost.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package=boost
$(package)_version = 1.88.0
$(package)_version = 1.90.0
$(package)_download_path = https://github.com/boostorg/boost/releases/download/boost-$($(package)_version)
$(package)_file_name = boost-$($(package)_version)-cmake.tar.gz
$(package)_sha256_hash = dcea50f40ba1ecfc448fdf886c0165cf3e525fef2c9e3e080b9804e8117b9694
$(package)_patches = skip_compiled_targets.patch
$(package)_sha256_hash = 913ca43d49e93d1b158c9862009add1518a4c665e7853b349a6492d158b036d4
$(package)_build_subdir = build

define $(package)_set_vars
Expand All @@ -14,10 +13,8 @@ define $(package)_set_vars
$(package)_config_opts += -DBOOST_INSTALL_LAYOUT=system
$(package)_config_opts += -DBUILD_TESTING=OFF
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_ICU=ON
endef

define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/skip_compiled_targets.patch
# Install to a unique path to prevent accidental inclusion via other dependencies' -I flags.
$(package)_config_opts += -DCMAKE_INSTALL_INCLUDEDIR=$(package)/include
endef

define $(package)_config_cmds
Expand Down
4 changes: 2 additions & 2 deletions depends/packages/native_capnp.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package=native_capnp
$(package)_version=1.2.0
$(package)_version=1.3.0
$(package)_download_path=https://capnproto.org/
$(package)_download_file=capnproto-c++-$($(package)_version).tar.gz
$(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz
$(package)_sha256_hash=ed00e44ecbbda5186bc78a41ba64a8dc4a861b5f8d4e822959b0144ae6fd42ef
$(package)_sha256_hash=098f824a495a1a837d56ae17e07b3f721ac86f8dbaf58896a389923458522108

define $(package)_set_vars
$(package)_config_opts := -DBUILD_TESTING=OFF
Expand Down
136 changes: 0 additions & 136 deletions depends/patches/boost/skip_compiled_targets.patch

This file was deleted.

2 changes: 1 addition & 1 deletion doc/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Bitcoin Core requires one of the following compilers.

| Dependency | Releases | Minimum required |
| --- | --- | --- |
| [Boost](../depends/packages/boost.mk) | [link](https://www.boost.org/users/download/) | [1.73.0](https://github.com/bitcoin/bitcoin/pull/29066) |
| [Boost](../depends/packages/boost.mk) | [link](https://www.boost.org/users/download/) | [1.74.0](https://github.com/bitcoin/bitcoin/pull/34107) |
| CMake | [link](https://cmake.org/) | [3.22](https://github.com/bitcoin/bitcoin/pull/30454) |

### Runtime
Expand Down
78 changes: 70 additions & 8 deletions src/ipc/libmultiprocess/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,66 @@ on:
pull_request:

jobs:
build-netbsd:
runs-on: ubuntu-latest
name: build • netbsd ${{ matrix.release }}
defaults:
run:
shell: netbsd {0}
strategy:
fail-fast: false
matrix:
# Test all supported releases.
# See https://www.netbsd.org/releases/.
include:
- release: 9.4
capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0 -DKJ_USE_KQUEUE=0"'
- release: 10.1
capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0"'
steps:
- uses: actions/checkout@v6

- name: Start NetBSD VM
uses: vmactions/netbsd-vm@v1
with:
release: ${{ matrix.release }}
# The installed compiler version must match the CXX variable
# defined in `ci/configs/netbsd.bash`.
prepare: |
pkg_add cmake ninja-build gcc14
# capnproto prerequisites.
# See the following "Install capnproto" step.
run: |
set -e
pkg_add digest libtool-base mktools pkgconf cwrappers
pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities
cd /usr
cvs -danoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P \
pkgsrc/devel/capnproto \
pkgsrc/devel/libtool-base \
pkgsrc/devel/pkgconf \
pkgsrc/devel/zlib \
`# gcc15 is referenced here because the pkgsrc framework requires lang/gcc15/version.mk to exist` \
`# during the "make install" step below, even though we compile our project with gcc14.` \
pkgsrc/lang/gcc15 \
pkgsrc/mk \
pkgsrc/pkgtools \
pkgsrc/security/openssl \
pkgsrc/sysutils/install-sh/files
sync: 'rsync'
copyback: false

- name: Install capnproto
run: |
cd /usr/pkgsrc/devel/capnproto/
unset PKG_PATH
make ${{ matrix.capnproto-cppflags }} install

- name: Run CI script
run: |
cd ${{ github.workspace }}
CI_CONFIG="ci/configs/netbsd.bash" bash ci/scripts/ci.sh

build-openbsd:
runs-on: ubuntu-latest
name: build • openbsd
Expand All @@ -18,17 +78,10 @@ jobs:
uses: vmactions/openbsd-vm@v1
with:
prepare: |
pkg_add -v cmake ninja git bash
run: |
git clone --depth=1 https://codeberg.org/OpenBSD/ports.git /usr/ports
pkg_add -v cmake ninja bash capnproto
sync: 'rsync'
copyback: false

- name: Install capnproto
run: |
cd /usr/ports/devel/capnproto/
make install

- name: Run CI script
run: |
cd ${{ github.workspace }}
Expand Down Expand Up @@ -76,6 +129,11 @@ jobs:
build:
runs-on: ubuntu-latest

env:
NIX_EXTRA_CONFIG_ACT: |
sandbox = false
filter-syscalls = false

strategy:
fail-fast: false
matrix:
Expand All @@ -90,6 +148,10 @@ jobs:
uses: cachix/install-nix-action@v31 # 2025-05-27, from https://github.com/cachix/install-nix-action/tags
with:
nix_path: nixpkgs=channel:nixos-25.05 # latest release
# Act executes inside an unprivileged container (Docker or Podman),
# so KVM support isn't available.
enable_kvm: "${{ github.actor != 'nektos/act' }}"
extra_nix_config: ${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}

- name: Run CI script
env:
Expand Down
26 changes: 26 additions & 0 deletions src/ipc/libmultiprocess/ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,29 @@ CI_CONFIG=ci/configs/olddeps.bash ci/scripts/run.sh
```

By default CI jobs will reuse their build directories. `CI_CLEAN=1` can be specified to delete them before running instead.

### Running workflows with `act`

You can run either the entire workflow or a single matrix entry locally. On
macOS or Linux:

1. Install [`act`](https://github.com/nektos/act) and either Docker or
Podman.
2. Inside the Podman VM, create a named volume for the Nix store (ext4,
case-sensitive) so builds persist across runs. Recreate it any time you want
a clean cache:
```bash
podman volume create libmultiprocess-nix
```
3. From the repo root, launch the workflow. The example below targets the
sanitize matrix entry; drop the `--matrix` flag to run every configuration.
```bash
act \
--reuse \
-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-24.04 \
--container-options "-v libmultiprocess-nix:/nix" \
-j build \
--matrix config:sanitize
```


11 changes: 11 additions & 0 deletions src/ipc/libmultiprocess/ci/configs/netbsd.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CI_DESC="CI config for NetBSD"
CI_DIR=build-netbsd
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
# Hardcode GCC 14, since default GCC versions installed by NetBSD are older
# and may not be compatible with libmultiprocess. GCC 14 was chosen because
# it's the latest compiler available on all versions of NetBSD that we test.
# Note that the GCC version specified here must match the version specified
# in pkg_add in ci.yml.
export CXX="/usr/pkg/gcc14/bin/g++"
CMAKE_ARGS=(-G Ninja)
BUILD_ARGS=(-k 0)
2 changes: 1 addition & 1 deletion src/ipc/libmultiprocess/ci/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ set -o errexit -o nounset -o pipefail -o xtrace

[ "${CI_CONFIG+x}" ] && source "$CI_CONFIG"

nix-shell --pure --keep CI_CONFIG --keep CI_CLEAN "${NIX_ARGS[@]+"${NIX_ARGS[@]}"}" --run ci/scripts/ci.sh shell.nix
nix develop --ignore-environment --keep CI_CONFIG --keep CI_CLEAN "${NIX_ARGS[@]+"${NIX_ARGS[@]}"}" -f shell.nix --command ci/scripts/ci.sh
17 changes: 11 additions & 6 deletions src/ipc/libmultiprocess/cmake/TargetCapnpSources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Example:
function(target_capnp_sources target include_prefix)
cmake_parse_arguments(PARSE_ARGV 2
"TCS" # prefix
"" # options
"ONLY_CAPNP" # options
"" # one_value_keywords
"IMPORT_PATHS" # multi_value_keywords
)
Expand Down Expand Up @@ -85,11 +85,14 @@ function(target_capnp_sources target include_prefix)
set_source_files_properties(${capnp_file}.c++ PROPERTIES SKIP_LINTING TRUE) # Ignored before cmake 3.27
target_sources(${target} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/${capnp_file}.c++
${CMAKE_CURRENT_BINARY_DIR}/${capnp_file}.proxy-client.c++
${CMAKE_CURRENT_BINARY_DIR}/${capnp_file}.proxy-server.c++
${CMAKE_CURRENT_BINARY_DIR}/${capnp_file}.proxy-types.c++
)

if(NOT TCS_ONLY_CAPNP)
target_sources(${target} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/${capnp_file}.proxy-client.c++
${CMAKE_CURRENT_BINARY_DIR}/${capnp_file}.proxy-server.c++
${CMAKE_CURRENT_BINARY_DIR}/${capnp_file}.proxy-types.c++
)
endif()
list(APPEND generated_headers ${capnp_file}.h)
endforeach()

Expand All @@ -111,5 +114,7 @@ function(target_capnp_sources target include_prefix)
# dependencies explicitly because while cmake detect dependencies of non
# generated files on generated headers, it does not reliably detect
# dependencies of generated headers on other generated headers.
add_custom_target("${target}_headers" DEPENDS ${generated_headers})
if(NOT TARGET "${target}_headers")
add_custom_target("${target}_headers" DEPENDS ${generated_headers})
endif()
endfunction()
Loading
Loading