Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
fa2c56e
ci: Bump channel to nixos-26.05
Jun 11, 2026
ce865a9
refactor: Directly use value in CustomBuildField
Jul 14, 2026
17eab90
test: Fix typo in listen_tests.cpp
Jul 14, 2026
8550ee6
util, refactor: Add ChildFail helper for post-fork child errors
Sjors Jul 20, 2026
1e0c7ff
util: Clear FD_CLOEXEC in child instead of parent before fork
Sjors Jul 20, 2026
140d9ba
test: allow custom log handler in `ListenSetup`
xyzconstant Jul 20, 2026
a26a084
cmake: Fix mpgen capnp tool path for vcpkg/Windows builds
ryanofsky Jul 21, 2026
eea9c64
cmake: Fix stale codegen when mpgen binary changes
ViniciusCestarii Jul 22, 2026
86b4810
refactor: access ThreadContext through CurrentThread()
Sjors Jul 29, 2026
66298c7
ci: Switch back to Bitcoin Core's master branch
hebasto Jul 29, 2026
f5c15ce
Merge bitcoin-core/libmultiprocess#323: refactor: access ThreadContex…
ryanofsky Jul 30, 2026
3a997e1
Fix startup race in mpexample
xyzconstant Jul 30, 2026
36c6c63
doc: Document reference-counted EventLoop lifetime
xyzconstant Jul 22, 2026
496fb84
test: cover immediate client disconnects for `ListenConnections`
xyzconstant Jul 20, 2026
a6fc80d
Merge bitcoin-core/libmultiprocess#311: bugfix: clear FD_CLOEXEC in c…
ryanofsky Jul 30, 2026
8d6d464
Merge bitcoin-core/libmultiprocess#315: Fix startup race in example
ryanofsky Jul 30, 2026
45f6255
type-number: exclude bool from the integral overload
ryanofsky Jul 30, 2026
45b685c
type-number, type-chrono: Fix static assert signed/unsigned comparisons
ryanofsky Jul 9, 2026
7a72df0
type-chrono: Add CustomBuildField/CustomReadField overloads for std::…
ryanofsky Jun 6, 2026
e1dcc6e
Merge bitcoin-core/libmultiprocess#316: cmake: Fix stale codegen when…
ryanofsky Jul 30, 2026
26452e0
refactor: memcpy -> std::ranges::copy
Jul 14, 2026
a494b76
cmake: Remove `QUIET` option from `find_package(CapnProto ...)`
hebasto Jul 31, 2026
fa47449
cmake: avoid unnecessary capnp-rpc dependency for mpgen
Aug 1, 2026
edf6343
ci: Compile with minimum supported g++-11 in olddeps
Aug 2, 2026
7402aff
ci: Pin oldeps config to older nixpkgs channel to compile older cmake…
Aug 2, 2026
788f17a
Remove code for Cap'n Proto versions before 0.9
hebasto Aug 2, 2026
bd50831
refactor: Drop stray semicolons after function definitions
hebasto Aug 2, 2026
36f7400
ci: Drop NetBSD release 9.4
hebasto Aug 2, 2026
2d33b14
ci: Switch to default compiler on NetBSD 9.4
hebasto Aug 2, 2026
a9e70db
ci: Add NetBSD release 11.0
hebasto Aug 2, 2026
4a56c18
util: report back child error to parent and throw
ViniciusCestarii Jul 30, 2026
3f05b11
util: kill and reap child on SpawnProcess error
ViniciusCestarii Aug 3, 2026
2d67817
Merge bitcoin-core/libmultiprocess#296: ci: Bump channel to nixos-26.05
ryanofsky Aug 3, 2026
f355108
Merge bitcoin-core/libmultiprocess#303: type-chrono: Add CustomBuildF…
ryanofsky Aug 3, 2026
31bff8a
Merge bitcoin-core/libmultiprocess#307: refactor: memcpy -> std::rang…
ryanofsky Aug 3, 2026
c437d7f
Merge bitcoin-core/libmultiprocess#310: test: cover immediate client …
ryanofsky Aug 3, 2026
abf127a
Merge bitcoin-core/libmultiprocess#317: ipc: Fix mpgen capnp tool pat…
ryanofsky Aug 3, 2026
879efea
Merge bitcoin-core/libmultiprocess#321: ci: Roll NetBSD releases to 1…
ryanofsky Aug 3, 2026
e5206e9
Merge bitcoin-core/libmultiprocess#325: cmake: Remove `QUIET` option …
ryanofsky Aug 3, 2026
8e026f6
Merge bitcoin-core/libmultiprocess#327: build: avoid unnecessary capn…
ryanofsky Aug 3, 2026
f13c64a
Merge bitcoin-core/libmultiprocess#330: ci: Compile with minimum supp…
ryanofsky Aug 3, 2026
67302cd
Merge bitcoin-core/libmultiprocess#331: Remove code for Cap'n Proto v…
ryanofsky Aug 3, 2026
ce51d73
ci: Set CMAKE_BUILD_PARALLEL_LEVEL to enable parallism in build jobs …
ryanofsky Jul 20, 2026
62f25af
test: check ReadList return value
ryanofsky Jul 1, 2026
060c1a5
Extract `UnixListener` class to a dedicated file
xyzconstant Jul 8, 2026
231361a
Correct stale UnixListener doc comment
xyzconstant Jul 11, 2026
44d1914
Add test coverage for ConnectStream
xyzconstant Jun 24, 2026
bb47369
Fix error handling when creating clients
xyzconstant Jul 10, 2026
fae9a63
example: Remove unused kj/async.h include
xyzconstant Aug 5, 2026
49834b2
ci: add -Wextra-semi to default config
fanquake Aug 4, 2026
648a185
proxy: Name threads spawned by the event loop
ViniciusCestarii Jul 31, 2026
9f25ffc
test: Cover OS thread names for worker, pool, and async threads
ViniciusCestarii Aug 6, 2026
7e94790
ci: Update `capnproto` prerequisites on NetBSD
hebasto Aug 11, 2026
51defb7
Merge bitcoin-core/libmultiprocess#340: ci: Update `capnproto` prereq…
ryanofsky Aug 11, 2026
2220df6
Merge bitcoin-core/libmultiprocess#298: Fix error handling when creat…
ryanofsky Aug 11, 2026
e5e367e
Merge bitcoin-core/libmultiprocess#312: util: report back child error…
ryanofsky Aug 11, 2026
b540e70
Merge bitcoin-core/libmultiprocess#324: proxy: Name threads spawned b…
ryanofsky Aug 11, 2026
d4d10ff
Merge bitcoin-core/libmultiprocess#332: ci: add -Wextra-semi to defau…
ryanofsky Aug 11, 2026
2d6e863
Merge bitcoin-core/libmultiprocess#334: ci: Set CMAKE_BUILD_PARALLEL_…
ryanofsky Aug 11, 2026
cc11c2b
Merge bitcoin-core/libmultiprocess#338: test: check ReadList return v…
ryanofsky Aug 11, 2026
636aaff
refactor: add missing [[noreturn]] attributes
fanquake Aug 10, 2026
a779a09
ci: add -Wmissing-noreturn
fanquake Aug 12, 2026
bdd0cd6
Merge bitcoin-core/libmultiprocess#339: refactor: add `[[noreturn]]` …
ryanofsky Aug 12, 2026
b3b134e
ci: add -Wextra-semi to llvm config
fanquake Aug 12, 2026
8dab0d4
Merge bitcoin-core/libmultiprocess#341: ci: add -Wextra-semi to llvm …
ryanofsky Aug 12, 2026
137a6e4
test: fix race in connect_tests disconnect-deferred-failure test
ryanofsky Aug 12, 2026
cc260f2
test: replace capnp fix link with upstream PR
xyzconstant Aug 13, 2026
70467c5
test: add m_ prefix to TestSetup members in connect tests
xyzconstant Aug 13, 2026
b54a163
test: drop TestSetup socket members in connect tests
xyzconstant Aug 13, 2026
038d33e
test: share DefaultLogHandler between test files
xyzconstant Aug 13, 2026
44bc463
test: drop mp:: prefixes in connect tests
xyzconstant Aug 13, 2026
113f1d4
test: join server thread unconditionally in connect tests
xyzconstant Aug 13, 2026
7eb741e
test: drop unnecessary KJ_EXPECT(true)
xyzconstant Aug 13, 2026
b9c36c6
test: close sockets unconditionally and check errors with KJ_SYSCALL
xyzconstant Aug 13, 2026
c39c785
doc: note construct() call in valid init interface test
xyzconstant Aug 13, 2026
e18ca52
Merge bitcoin-core/libmultiprocess#343: test: fix race in connect_tes…
ryanofsky Aug 13, 2026
d6f8588
proxy: fix BuildList to use non-const iteration for interface types
ryanofsky Jul 8, 2026
390b5f9
Merge bitcoin-core/libmultiprocess#344: test: listen_tests and connec…
ryanofsky Aug 13, 2026
b3fc922
ci: add newdeps job testing newest versions of cmake and capnproto
ryanofsky Sep 9, 2025
2448d28
cmake: add type-unordered-set.h and version.h to public headers
ryanofsky Jul 30, 2026
2f4be9e
refactor: Remove trailing whitespace
ViniciusCestarii Aug 14, 2026
9b13678
ci: Add -Wtrailing-whitespace to default config
ViniciusCestarii Aug 14, 2026
cd7162f
Merge bitcoin-core/libmultiprocess#304: proxy: fix BuildList to use n…
ryanofsky Aug 14, 2026
275c8ee
Merge bitcoin-core/libmultiprocess#345: Remove trailing whitespace an…
ryanofsky Aug 14, 2026
914dc83
proxy: fix data race between server request threads and disconnect ha…
ryanofsky Aug 19, 2026
fe1b833
ci: do not ignore NIXPKGS_CHANNEL in local ci runs
ryanofsky Aug 20, 2026
7c73cce
ci: rename CI-internal variables to use CI_ prefix
ryanofsky Aug 20, 2026
49f95e2
Merge bitcoin-core/libmultiprocess#212: ci: add newdeps job testing n…
ryanofsky Aug 26, 2026
0e146c0
Merge bitcoin-core/libmultiprocess#349: type-context: fix async disco…
ryanofsky Aug 26, 2026
f2e8df8
Merge bitcoin-core/libmultiprocess#350: cmake: add type-unordered-set…
ryanofsky Aug 26, 2026
a7ff9d5
ci: add cmake debug output
ryanofsky Sep 10, 2025
fa30e20
ci: Remove hard-coded -j4 from sanitize config
Aug 26, 2026
81f824b
doc: Update Cap'n Proto version to match minimum
hebasto Aug 26, 2026
fa10111
refactor: Enable readability-container-contains
Aug 26, 2026
cc36752
ci: bump cmake version to 4.3.4 in newdeps job
ryanofsky Aug 26, 2026
766867f
ci: clarify CAPNP_CHECKOUT=master is the v1.x release branch
ryanofsky Aug 25, 2026
0092392
Merge bitcoin-core/libmultiprocess#356: ci: Remove hard-coded -j4 fro…
ryanofsky Aug 26, 2026
dba9958
Merge bitcoin-core/libmultiprocess#357: doc: Update Cap'n Proto versi…
ryanofsky Aug 26, 2026
4d454a8
Merge bitcoin-core/libmultiprocess#358: refactor: Enable readability-…
ryanofsky Aug 26, 2026
2330fbe
refactor: replace EventLoop::post() with sync() taking kj::FunctionParam
ViniciusCestarii Aug 16, 2026
5c49666
refactor: rename EventLoop::m_post_fn to m_sync_fn
ViniciusCestarii Aug 16, 2026
fa1db7a
pull latest .clang-tidy from downstream
Sep 1, 2026
073ac4f
Merge bitcoin-core/libmultiprocess#347: refactor: Replace EventLoop::…
ryanofsky Sep 8, 2026
bf229bf
Merge bitcoin-core/libmultiprocess#351: ci: do not ignore NIXPKGS_CHA…
ryanofsky Sep 8, 2026
79ddc44
Merge bitcoin-core/libmultiprocess#359: ci: bump cmake version to 4.3…
ryanofsky Sep 8, 2026
7bac69d
Merge bitcoin-core/libmultiprocess#360: pull latest .clang-tidy from …
ryanofsky Sep 8, 2026
fb4ac7e
ci: use LLVM 23 in Bitcoin Core CI
fanquake Sep 9, 2026
161197a
Merge bitcoin-core/libmultiprocess#352: ci: add cmake debug output
ryanofsky Sep 10, 2026
2dba130
Merge bitcoin-core/libmultiprocess#363: ci: use LLVM 23 in Bitcoin Co…
ryanofsky Sep 10, 2026
4a1f400
util: Error out at compile time if KJ_NO_EXCEPTIONS is set
ryanofsky Sep 10, 2026
fa56334
ci: Compile with minimum supported g++-10 in olddeps
Sep 16, 2026
56cfdaa
Change CapnProto library linkage for mpgen
mutatrum Sep 17, 2026
a6ecdc1
Merge bitcoin-core/libmultiprocess#364: util: Error out at compile ti…
ryanofsky Oct 1, 2026
f1042b1
Merge bitcoin-core/libmultiprocess#366: ci: Compile with minimum supp…
ryanofsky Oct 1, 2026
701449c
util: Make SocketError inline constexpr
ryanofsky Oct 1, 2026
a8c64c7
ci: Enable -Wunused-const-variable in GCC jobs
ryanofsky Oct 1, 2026
6fd2a9c
Merge bitcoin-core/libmultiprocess#367: mpgen: Change Cap'n Proto lin…
ryanofsky Oct 1, 2026
debd429
proxy-types: Avoid -Wundef error when KJ_NO_EXCEPTIONS is not defined
ryanofsky Oct 1, 2026
3577d23
ci: Enable -Wundef in default and llvm jobs
ryanofsky Oct 1, 2026
92127a9
cmake: Pass -w to include-what-you-use
ryanofsky Oct 2, 2026
f0a1475
cmake: Show include-what-you-use diagnostics when it fails
ryanofsky Oct 2, 2026
686bccf
Merge bitcoin-core/libmultiprocess#371: cmake: Fix silent include-wha…
ryanofsky Oct 13, 2026
2e7812a
Merge bitcoin-core/libmultiprocess#370: Fix Bitcoin Core build errors…
ryanofsky Oct 13, 2026
04a0465
ci: Compile capnproto with GCC in gnu32 job
xyzconstant Oct 27, 2026
0e96139
proxy: Reject destroy() during active calls and calls after destroy()
xyzconstant Oct 25, 2026
eb74f36
Merge destroy-call regression tests with the i686 toolchain fix
Sjors Oct 28, 2026
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
14 changes: 12 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ bugprone-string-constructor,
bugprone-use-after-move,
bugprone-lambda-function-name,
bugprone-unhandled-self-assignment,
misc-unused-using-decls,
bugprone-unused-return-value,
fuchsia-header-anon-namespaces,
misc-definitions-in-headers,
misc-no-recursion,
misc-unused-using-decls,
modernize-avoid-bind,
modernize-deprecated-headers,
modernize-use-default-member-init,
modernize-use-emplace,
Expand All @@ -22,7 +26,9 @@ performance-*,
-performance-no-int-to-ptr,
-performance-noexcept-move-constructor,
-performance-unnecessary-value-param,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-container-contains,
readability-redundant-declaration,
readability-redundant-string-init,
clang-analyzer-core.*,
Expand All @@ -35,6 +41,10 @@ CheckOptions:
- key: modernize-deprecated-headers.CheckHeaderFile
value: false
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: false
value: false # Disabled, to allow the bugprone-use-after-move rule on trivially copyable types, to catch logic bugs
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
value: false
- key: bugprone-unused-return-value.CheckedReturnTypes
value: '^::std::error_code$;^::std::error_condition$;^::std::errc$;^::std::expected$;^::util::Result$;^::util::Expected$'
- key: bugprone-unused-return-value.AllowCastToVoid
value: true # Can be removed with C++26 once the _ placeholder exists.
13 changes: 6 additions & 7 deletions .github/workflows/bitcoin-core-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ concurrency:

env:
BITCOIN_REPO: bitcoin/bitcoin
# Temporary: use PR #35084 until it merges; revert to refs/heads/master after
BITCOIN_CORE_REF: refs/pull/35084/merge
LLVM_VERSION: 22
BITCOIN_CORE_REF: refs/heads/master
LLVM_VERSION: 23
LIBCXX_DIR: /tmp/libcxx-build/

jobs:
Expand All @@ -38,13 +37,13 @@ jobs:
functional_test_runs: 20
nproc_multiplier: 2
functional_timeout_factor: 40
runner: ubuntu-24.04
runner: ubuntu-26.04
apt-llvm: true
packages: >-
ccache
clang-22
llvm-22
libclang-rt-22-dev
clang-23
llvm-23
libclang-rt-23-dev
libboost-dev
libsqlite3-dev
libcapnp-dev
Expand Down
33 changes: 19 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ jobs:
# 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
# Due to a bug in Cap'n Proto, GCC compilers older
# than 14.x require `-DKJ_NO_EXCEPTIONS=0` when
# processing `capnproto/c++/src/kj/common.h`.
# See https://github.com/capnproto/capnproto/pull/2756/changes/28fa1a6753514d8de56875ec2222fa0e1c3a04f7.
- release: '10.1'
capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0"'
env_vars: 'CXXFLAGS="-DKJ_NO_EXCEPTIONS=0"'
- release: '11.0'
capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0"'
env_vars: 'CXXFLAGS="-DKJ_NO_EXCEPTIONS=0"'
steps:
- uses: actions/checkout@v6

Expand All @@ -44,9 +50,9 @@ jobs:
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` \
`# gcc16 is referenced here because the pkgsrc framework requires lang/gcc16/version.mk to exist` \
`# during the "make install" step below, even though we compile our project with gcc14.` \
pkgsrc/lang/gcc15 \
pkgsrc/lang/gcc16 \
pkgsrc/mk \
pkgsrc/pkgtools \
pkgsrc/security/openssl \
Expand All @@ -63,7 +69,7 @@ jobs:
- name: Run CI script
run: |
cd ${{ github.workspace }}
CI_CONFIG="ci/configs/netbsd.bash" bash ci/scripts/ci.sh
CI_CONFIG="ci/configs/netbsd.bash" ${{ matrix.env_vars }} bash ci/scripts/ci.sh

build-openbsd:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -100,7 +106,7 @@ jobs:
uses: vmactions/freebsd-vm@v1
with:
prepare: |
pkg install -y cmake ninja bash capnproto
pkg install -y cmake ninja bash capnproto git
sync: 'rsync'
copyback: false

Expand Down Expand Up @@ -131,18 +137,18 @@ jobs:
runs-on: ubuntu-latest

env:
NIXPKGS_CHANNEL: nixos-25.05
NIX_EXTRA_CONFIG: |
CI_NIXPKGS_CHANNEL: nixos-26.05
CI_NIX_CONFIG: |
keep-env-derivations = true
keep-outputs = true
NIX_EXTRA_CONFIG_ACT: |
CI_NIX_CONFIG_ACT: |
sandbox = false
filter-syscalls = false

strategy:
fail-fast: false
matrix:
config: [default, llvm, gnu32, sanitize, olddeps]
config: [default, llvm, gnu32, sanitize, olddeps, newdeps]

name: build • ${{ matrix.config }}

Expand All @@ -158,13 +164,12 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@v31 # 2025-05-27, from https://github.com/cachix/install-nix-action/tags
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.config.outputs.nixpkgs_rev }}.tar.gz
# Act executes inside an unprivileged container (Docker or Podman),
# so KVM support isn't available.
enable_kvm: "${{ github.actor != 'nektos/act' }}"
extra_nix_config: |
${{ env.NIX_EXTRA_CONFIG }}
${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}
${{ env.CI_NIX_CONFIG }}
${{ github.actor == 'nektos/act' && env.CI_NIX_CONFIG_ACT || '' }}

- name: Cache Nix store
if: steps.config.outputs.cache_nix_store == 'true'
Expand Down
33 changes: 24 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif()
include("cmake/compat_find.cmake")

find_package(Threads REQUIRED)
find_package(CapnProto 0.9 QUIET NO_MODULE)
find_package(CapnProto 0.9 NO_MODULE)
if(NOT CapnProto_FOUND)
message(FATAL_ERROR
"Cap'n Proto is required but was not found.\n"
Expand All @@ -35,9 +35,7 @@ set(CAPNPROTO_CLANG_INCOMPATIBLE FALSE)
# https://github.com/capnproto/capnproto/blob/master/security-advisories/2022-11-30-0-pointer-list-bounds.md
# https://capnproto.org/news/2022-11-30-CVE-2022-46149-security-advisory.html
# https://dwrensha.github.io/capnproto-rust/2022/11/30/out_of_bounds_memory_access_bug.html
if(CapnProto_VERSION STREQUAL "0.7.0"
OR CapnProto_VERSION STREQUAL "0.8.0"
OR CapnProto_VERSION STREQUAL "0.9.0"
if(CapnProto_VERSION STREQUAL "0.9.0"
OR CapnProto_VERSION STREQUAL "0.9.1"
OR CapnProto_VERSION STREQUAL "0.10.0"
OR CapnProto_VERSION STREQUAL "0.10.1"
Expand Down Expand Up @@ -66,7 +64,7 @@ if(CAPNPROTO_CVE_AFFECTED OR CAPNPROTO_CLANG_INCOMPATIBLE)
string(APPEND RESOLUTION_OPTIONS " - Upgrade to Cap'n Proto version 1.0 or newer (recommended)\n")

if(CAPNPROTO_CVE_AFFECTED AND NOT CAPNPROTO_CLANG_INCOMPATIBLE)
string(APPEND RESOLUTION_OPTIONS " - Upgrade to a patched minor version (0.7.1, 0.8.1, 0.9.2, 0.10.3, or later)\n")
string(APPEND RESOLUTION_OPTIONS " - Upgrade to a patched minor version (0.9.2, 0.10.3, or later)\n")
elseif(CAPNPROTO_CLANG_INCOMPATIBLE AND NOT CAPNPROTO_CVE_AFFECTED)
string(APPEND RESOLUTION_OPTIONS " - Use GCC instead of Clang\n")
endif()
Expand Down Expand Up @@ -98,7 +96,12 @@ if(MP_ENABLE_IWYU)
if(NOT IWYU_EXECUTABLE)
message(FATAL_ERROR "MP_ENABLE_IWYU is ON but include-what-you-use was not found.")
endif()
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${IWYU_EXECUTABLE};-Xiwyu;--error")
# Pass -w so CXXFLAGS meant for the compiler (-Werror -Wpedantic, GCC-only -W
# options) do not turn clang warnings into errors in the IWYU pass. Clang
# stops after 19 errors, and IWYU then exits nonzero without checking includes.
# Run IWYU through a wrapper so its diagnostics are shown when it fails
# without suggesting includes (see cmake/iwyu-wrapper.sh).
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/iwyu-wrapper.sh;${IWYU_EXECUTABLE};-Xiwyu;--error;-w")
if(DEFINED ENV{IWYU_MAPPING_FILE})
list(APPEND CMAKE_CXX_INCLUDE_WHAT_YOU_USE "-Xiwyu" "--mapping_file=$ENV{IWYU_MAPPING_FILE}")
endif()
Expand Down Expand Up @@ -176,9 +179,11 @@ set(MP_PUBLIC_HEADERS
include/mp/type-struct.h
include/mp/type-threadmap.h
include/mp/type-tuple.h
include/mp/type-unordered-set.h
include/mp/type-vector.h
include/mp/type-void.h
include/mp/util.h)
include/mp/util.h
include/mp/version.h)
add_library(multiprocess STATIC
${MP_PROXY_SRCS}
${MP_PUBLIC_HEADERS}
Expand All @@ -204,11 +209,21 @@ add_executable(mpgen src/mp/gen.cpp $<TARGET_OBJECTS:mputil>)
add_executable(Libmultiprocess::mpgen ALIAS mpgen)
target_include_directories(mpgen PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>)
target_include_directories(mpgen PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(mpgen PRIVATE CapnProto::capnp)
target_link_libraries(mpgen PRIVATE CapnProto::capnp-rpc)
target_link_libraries(mpgen PRIVATE CapnProto::capnpc)
target_link_libraries(mpgen PRIVATE CapnProto::capnp)
target_link_libraries(mpgen PRIVATE CapnProto::kj)
target_link_libraries(mpgen PRIVATE CapnProto::kj-async)
target_link_libraries(mpgen PRIVATE Threads::Threads)
# Use CAPNP_EXECUTABLE/CAPNPC_CXX_EXECUTABLE cmake variables set by
# CapnProtoConfig.cmake rather than reading the CapnProto::capnp_tool
# IMPORTED_LOCATION directly. On Debian/Ubuntu, IMPORTED_LOCATION is broken
# by a multiarch cmake packaging bug (see
# https://github.com/bitcoin-core/libmultiprocess/issues/328), but
# CapnProtoConfig.cmake works around it by hardcoding the correct paths. On
# other platforms the variables hold generator expressions that
# target_compile_definitions evaluates correctly at generation time.
target_compile_definitions(mpgen PRIVATE CAPNP_EXECUTABLE=\"${CAPNP_EXECUTABLE}\")
target_compile_definitions(mpgen PRIVATE CAPNPC_CXX_EXECUTABLE=\"${CAPNPC_CXX_EXECUTABLE}\")
set_target_properties(mpgen PROPERTIES
INSTALL_RPATH_USE_LINK_PATH TRUE)
set_target_properties(mpgen PROPERTIES
Expand Down
1 change: 1 addition & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CI_CONFIG=ci/configs/llvm.bash ci/scripts/run.sh
CI_CONFIG=ci/configs/gnu32.bash ci/scripts/run.sh
CI_CONFIG=ci/configs/sanitize.bash ci/scripts/run.sh
CI_CONFIG=ci/configs/olddeps.bash ci/scripts/run.sh
CI_CONFIG=ci/configs/newdeps.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.
Expand Down
2 changes: 1 addition & 1 deletion ci/configs/default.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CI_DESC="CI job using default libraries and tools, and running IWYU"
CI_DIR=build-default
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wundef -Wunused-const-variable -Wno-unused-parameter -Wextra-semi -Wmissing-noreturn -Wtrailing-whitespace"
CMAKE_ARGS=(-DMP_ENABLE_IWYU=ON)
BUILD_ARGS=(-k)
2 changes: 1 addition & 1 deletion ci/configs/freebsd.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CI_DESC="CI config for FreeBSD"
CI_DIR=build-freebsd
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-c++23-lambda-attributes"
CMAKE_ARGS=(-G Ninja)
BUILD_ARGS=(-k 0)
2 changes: 1 addition & 1 deletion ci/configs/gnu32.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ NIX_ARGS=(
--arg minimal true
--arg crossPkgs 'import <nixpkgs> { crossSystem = { config = "i686-unknown-linux-gnu"; }; }'
)
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-const-variable -Wno-unused-parameter"
CMAKE_ARGS=(-G Ninja)
BUILD_ARGS=(-k 0)
2 changes: 1 addition & 1 deletion ci/configs/llvm.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CI_DESC="CI job using LLVM-based libraries and tools (clang, libc++, clang-tidy,
CI_DIR=build-llvm
NIX_ARGS=(--arg enableLibcxx true)
export CXX=clang++
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wthread-safety -Wno-unused-parameter"
export CXXFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wpedantic -Wundef -Wthread-safety -Wno-unused-parameter -Wno-c++23-lambda-attributes"
CMAKE_ARGS=(
-G Ninja
-DMP_ENABLE_CLANG_TIDY=ON
Expand Down
2 changes: 1 addition & 1 deletion ci/configs/macos.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CI_DESC="CI config for macOS"
CI_DIR=build-macos
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-c++23-lambda-attributes"
CMAKE_ARGS=(-G Ninja -DMP_ENABLE_CLANG_TIDY=ON)
BUILD_ARGS=(-k 0)
8 changes: 1 addition & 7 deletions ci/configs/netbsd.bash
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
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++"
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter ${CXXFLAGS:-}"
CMAKE_ARGS=(-G Ninja)
BUILD_ARGS=(-k 0)
6 changes: 6 additions & 0 deletions ci/configs/newdeps.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CI_DESC="CI job using newest Cap'n Proto and cmake versions"
CI_DIR=build-newdeps
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-const-variable -Wno-unused-parameter -Wno-error=array-bounds"
CAPNP_CHECKOUT=master # This is the v1.x release branch
NIX_ARGS=(--argstr capnprotoVersion "none" --argstr cmakeVersion "4.3.4")
BUILD_ARGS=(-k)
7 changes: 5 additions & 2 deletions ci/configs/olddeps.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CI_DESC="CI job using old Cap'n Proto and cmake versions"
CI_DIR=build-olddeps
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-error=array-bounds"
NIX_ARGS=(--argstr capnprotoVersion "0.9.2" --argstr cmakeVersion "3.12.4")
# Pin olddeps to an older Nixpkgs channel, to be able to test an older GCC.
CI_NIXPKGS_CHANNEL=nixos-25.05
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-const-variable -Wno-unused-parameter -Wno-error=array-bounds"
CAPNP_CHECKOUT=v0.9.2 # Use a checkout to compile it with the selected GCC
NIX_ARGS=(--argstr capnprotoVersion "none" --argstr cmakeVersion "3.12.4" --argstr gccVersion "10")
BUILD_ARGS=(-k)
2 changes: 1 addition & 1 deletion ci/configs/openbsd.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CI_DESC="CI config for OpenBSD"
CI_DIR=build-openbsd
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-c++23-lambda-attributes"
CMAKE_ARGS=(-G Ninja)
BUILD_ARGS=(-k 0)
4 changes: 2 additions & 2 deletions ci/configs/sanitize.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CI_DESC="CI job running ThreadSanitizer"
CI_DIR=build-sanitize
NIX_ARGS=(--arg enableLibcxx true --argstr libcxxSanitizers "Thread" --argstr capnprotoSanitizers "thread")
export CXX=clang++
export CXXFLAGS="-ggdb -Werror -Wall -Wextra -Wpedantic -Wthread-safety -Wno-unused-parameter -fsanitize=thread"
export CXXFLAGS="-ggdb -Werror -Wall -Wextra -Wpedantic -Wthread-safety -Wno-unused-parameter -fsanitize=thread -Wno-c++23-lambda-attributes"
CMAKE_ARGS=()
BUILD_ARGS=(-k -j4)
BUILD_ARGS=(-k)
BUILD_TARGETS=(mptest)
35 changes: 34 additions & 1 deletion ci/scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,43 @@ cmake --version
cmake_ver=$(cmake --version | awk '/version/{print $3; exit}')
ver_ge() { [ "$(printf '%s\n' "$2" "$1" | sort -V | head -n1)" = "$2" ]; }

# If CAPNP_CHECKOUT was requested, clone and install requested Cap'n Proto branch or tag
capnp_prefix=
if [ -n "${CAPNP_CHECKOUT-}" ]; then
capnp_prefix="$PWD/capnp-install"
[ -e "capnp" ] || git clone -b "${CAPNP_CHECKOUT}" "https://github.com/capnproto/capnproto" capnp
mkdir -p capnp/build
(
cd capnp/build
git --no-pager log -1 || true
CXXFLAGS="-std=c++20" cmake .. "-DCMAKE_INSTALL_PREFIX=${capnp_prefix}" -DBUILD_TESTING=OFF -DWITH_OPENSSL=OFF -DWITH_ZLIB=OFF
cmake --build .
cmake --build . --target install # Replacement for modern "cmake --install .".
)
export CMAKE_PREFIX_PATH="${capnp_prefix}:${CMAKE_PREFIX_PATH-}"
fi

src_dir=$PWD
mkdir -p "$CI_DIR"
cd "$CI_DIR"
cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}"
export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
git --no-pager log -1 || true
cmake_args=("${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}")
if ! cmake "$src_dir" "${cmake_args[@]}"; then
# If cmake failed, try it again with debug options.
# Could add --trace / --trace-expand here too but they are very verbose.
cmake_args+=(--debug-output --debug-trycompile)
if ver_ge "$cmake_ver" "3.16"; then cmake_args+=(--log-level=DEBUG); fi
if ver_ge "$cmake_ver" "3.17"; then cmake_args+=(--debug-find); fi
cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?"
if ver_ge "$cmake_ver" "3.26"; then
cat CMakeFiles/CMakeConfigureLog.yaml || true
else
cat CMakeFiles/CMakeError.log CMakeFiles/CMakeOutput.log || true
fi
find . -ls || true
false
fi
if ver_ge "$cmake_ver" "3.15"; then
cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
else
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ source "${SCRIPT_DIR}/ci_helpers.sh"
[ "${CI_CONFIG+x}" ] && source "$CI_CONFIG"

# Resolve the nixpkgs channel to a specific revision for use in cache keys.
if [[ -n "${NIXPKGS_CHANNEL:-}" ]]; then
rev="$(curl --fail --location --silent --show-error "https://channels.nixos.org/${NIXPKGS_CHANNEL}/git-revision")"
if [[ -n "${CI_NIXPKGS_CHANNEL:-}" ]]; then
rev="$(curl --fail --location --silent --show-error "https://channels.nixos.org/${CI_NIXPKGS_CHANNEL}/git-revision")"
test -n "${rev}"
write_output_var nixpkgs_rev "${rev}"
fi
Expand Down
Loading
Loading