mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-11 08:07:33 +02:00
Squashed 'src/ipc/libmultiprocess/' changes from 1868a84451f..70f632bda8f
70f632bda8f Merge bitcoin-core/libmultiprocess#265: ci: set LC_ALL in shell scripts 8e8e564259a Merge bitcoin-core/libmultiprocess#249: fixes for race conditions on disconnects 05d34cc2ec3 ci: set LC_ALL in shell scripts e606fd84a8c Merge bitcoin-core/libmultiprocess#264: ci: reduce nproc multipliers ff0eed1bf18 refactor: Use loop variable in type-context.h ff1d8ba172a refactor: Move type-context.h getParams() call closer to use 1dbc59a4aa3 race fix: m_on_cancel called after request finishes 1643d05ba07 test: m_on_cancel called after request finishes f5509a31fcc race fix: getParams() called after request cancel 4a60c39f24a test: getParams() called after request cancel f11ec29ed20 race fix: worker thread destroyed before it is initialized a1d643348f4 test: worker thread destroyed before it is initialized 336023382c4 ci: reduce nproc multipliers b090beb9651 Merge bitcoin-core/libmultiprocess#256: ci: cache gnu32 nix store be8622816da ci: cache gnu32 nix store 975270b619c Merge bitcoin-core/libmultiprocess#263: ci: bump timeout factor to 40 09f10e5a598 ci: bump timeout factor to 40 db8f76ad290 Merge bitcoin-core/libmultiprocess#253: ci: run some Bitcoin Core CI jobs 55a9b557b19 ci: set Bitcoin Core CI test repetition fb0fc84d556 ci: add TSan job with instrumented libc++ 0f29c38725b ci: add Bitcoin Core IPC tests (ASan + macOS) 3f64320315d Merge bitcoin-core/libmultiprocess#262: ci: enable clang-tidy in macOS job, use nullptr cd9f8bdc9f0 Merge bitcoin-core/libmultiprocess#258: log: add socket connected info message and demote destroy logs to debug b5d6258a42f Merge bitcoin-core/libmultiprocess#255: fix: use unsigned char cast and sizeof in LogEscape escape sequence d94688e2c32 Merge bitcoin-core/libmultiprocess#251: Improved CustomBuildField for std::optional in IPC/libmultiprocess a9499fad755 mp: use nullptr with pthread_threadid_np f499e37850f ci: enable clang-tidy in macOS job 98f1352159d log: add socket connected info message and demote destroy logs to debug 554a481ea73 fix: use unsigned char cast and sizeof in LogEscape escape sequence 1977b9f3f65 Use std::forward in CustomBuildField for std::optional to allow move semantics, resolves FIXME 22bec918c97 Merge bitcoin-core/libmultiprocess#247: type-map: Work around LLVM 22 "out of bounds index" error 8a5e3ae6ed2 Merge bitcoin-core/libmultiprocess#242: proxy-types: add CustomHasField hook to map Cap'n Proto values to null C++ values e8d35246918 Merge bitcoin-core/libmultiprocess#246: doc: Bump version 8 > 9 97d877053b6 proxy-types: add CustomHasField hook for nullable decode paths 8c2f10252c9 refactor: add missing includes to mp/type-data.h b1638aceb40 doc: Bump version 8 > 9 f61af487217 type-map: Work around LLVM 22 "out of bounds index" error git-subtree-dir: src/ipc/libmultiprocess git-subtree-split: 70f632bda8f80449b6240f98da768206a535a04e
This commit is contained in:
300
.github/workflows/bitcoin-core-ci.yml
vendored
Normal file
300
.github/workflows/bitcoin-core-ci.yml
vendored
Normal file
@@ -0,0 +1,300 @@
|
||||
# Copyright (c) The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or https://opensource.org/license/mit.
|
||||
|
||||
# Test libmultiprocess inside Bitcoin Core by replacing the subtree copy
|
||||
# with the version from this PR, then building and running IPC-related
|
||||
# unit & functional tests.
|
||||
|
||||
name: Bitcoin Core CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
BITCOIN_REPO: bitcoin/bitcoin
|
||||
LLVM_VERSION: 22
|
||||
LIBCXX_DIR: /tmp/libcxx-build/
|
||||
|
||||
jobs:
|
||||
bitcoin-core:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 120
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: 'ASan + UBSan'
|
||||
unit_test_runs: 15
|
||||
functional_test_runs: 20
|
||||
nproc_multiplier: 2
|
||||
functional_timeout_factor: 40
|
||||
runner: ubuntu-24.04
|
||||
apt-llvm: true
|
||||
packages: >-
|
||||
ccache
|
||||
clang-22
|
||||
llvm-22
|
||||
libclang-rt-22-dev
|
||||
libevent-dev
|
||||
libboost-dev
|
||||
libsqlite3-dev
|
||||
libcapnp-dev
|
||||
capnproto
|
||||
ninja-build
|
||||
pkgconf
|
||||
python3-pip
|
||||
pip-packages: --break-system-packages pycapnp
|
||||
cmake-args: |-
|
||||
-DSANITIZERS=address,float-divide-by-zero,integer,undefined
|
||||
-DCMAKE_C_COMPILER=clang
|
||||
-DCMAKE_CXX_COMPILER=clang++
|
||||
-DCMAKE_C_FLAGS=-ftrivial-auto-var-init=pattern
|
||||
-DCMAKE_CXX_FLAGS=-ftrivial-auto-var-init=pattern
|
||||
|
||||
- name: 'macOS'
|
||||
unit_test_runs: 50
|
||||
functional_test_runs: 20
|
||||
nproc_multiplier: 2
|
||||
functional_timeout_factor: 40
|
||||
runner: macos-15
|
||||
brew-packages: ccache capnp boost libevent sqlite pkgconf ninja
|
||||
pip-packages: --break-system-packages pycapnp
|
||||
cmake-args: |-
|
||||
-DREDUCE_EXPORTS=ON
|
||||
|
||||
env:
|
||||
CCACHE_MAXSIZE: 400M
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
steps:
|
||||
- name: Checkout Bitcoin Core
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ env.BITCOIN_REPO }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Checkout libmultiprocess
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: _libmultiprocess
|
||||
|
||||
- name: Replace libmultiprocess subtree
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh replace_subtree
|
||||
|
||||
- name: Add LLVM apt repository
|
||||
if: matrix.apt-llvm
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh add_llvm_apt_repository
|
||||
|
||||
- name: Install APT packages
|
||||
if: matrix.packages
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh install_apt_packages ${{ matrix.packages }}
|
||||
|
||||
- name: Configure LLVM alternatives
|
||||
if: matrix.packages
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh install_llvm_alternatives
|
||||
|
||||
- name: Install Homebrew packages
|
||||
if: matrix.brew-packages
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh install_homebrew_packages ${{ matrix.brew-packages }}
|
||||
|
||||
- name: Install pip packages
|
||||
if: matrix.pip-packages
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh install_pip_packages ${{ matrix.pip-packages }}
|
||||
|
||||
- name: Determine parallelism
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh determine_parallelism "${{ matrix.nproc_multiplier }}"
|
||||
|
||||
- name: Restore ccache
|
||||
id: ccache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ccache-${{ matrix.name }}-${{ github.ref }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ matrix.name }}-${{ github.ref }}-
|
||||
ccache-${{ matrix.name }}-
|
||||
|
||||
- name: Reset ccache stats
|
||||
if: matrix.packages || matrix.brew-packages
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh reset_ccache_stats
|
||||
|
||||
- name: CMake configure
|
||||
env:
|
||||
BITCOIN_CORE_CMAKE_ARGS: ${{ matrix.cmake-args }}
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh configure_bitcoin_core
|
||||
|
||||
- name: Build
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_bitcoin_core
|
||||
|
||||
- name: Show ccache stats
|
||||
if: matrix.packages || matrix.brew-packages
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh show_ccache_stats
|
||||
|
||||
- name: Run IPC unit tests
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
|
||||
LSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/lsan
|
||||
UBSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh run_ipc_unit_tests "${{ matrix.unit_test_runs }}"
|
||||
|
||||
- name: Run IPC functional tests
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
|
||||
LSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/lsan
|
||||
UBSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1
|
||||
CI_FAILFAST_TEST_LEAVE_DANGLING: 1
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh run_ipc_functional_tests "${{ matrix.functional_test_runs }}" "${{ matrix.functional_timeout_factor }}"
|
||||
|
||||
- name: Save ccache
|
||||
uses: actions/cache/save@v4
|
||||
if: github.ref == 'refs/heads/master' || steps.ccache-restore.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ccache-${{ matrix.name }}-${{ github.ref }}-${{ github.sha }}
|
||||
|
||||
bitcoin-core-tsan:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 180
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- name: TSan
|
||||
unit_test_runs: 8
|
||||
functional_test_runs: 25
|
||||
nproc_multiplier: 2
|
||||
functional_timeout_factor: 40
|
||||
|
||||
env:
|
||||
CCACHE_MAXSIZE: 400M
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
LIBCXX_FLAGS: >-
|
||||
-fsanitize=thread
|
||||
-nostdinc++
|
||||
-nostdlib++
|
||||
-isystem /tmp/libcxx-build/include/c++/v1
|
||||
-L/tmp/libcxx-build/lib
|
||||
-Wl,-rpath,/tmp/libcxx-build/lib
|
||||
-lc++
|
||||
-lc++abi
|
||||
-lpthread
|
||||
-Wno-unused-command-line-argument
|
||||
TSAN_OPTIONS: suppressions=${{ github.workspace }}/test/sanitizer_suppressions/tsan:halt_on_error=1:second_deadlock_stack=1
|
||||
|
||||
steps:
|
||||
- name: Checkout Bitcoin Core
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ env.BITCOIN_REPO }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Checkout libmultiprocess
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: _libmultiprocess
|
||||
|
||||
- name: Add LLVM apt repository
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh add_llvm_apt_repository
|
||||
|
||||
- name: Install packages
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh install_tsan_packages
|
||||
|
||||
- name: Determine parallelism
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh determine_parallelism "${{ matrix.nproc_multiplier }}"
|
||||
|
||||
- name: Restore instrumented libc++ cache
|
||||
id: libcxx-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.LIBCXX_DIR }}
|
||||
key: libcxx-Thread-llvmorg-${{ env.LLVM_VERSION }}.1.0
|
||||
|
||||
- name: Build instrumented libc++
|
||||
if: steps.libcxx-cache.outputs.cache-hit != 'true'
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_instrumented_libcxx
|
||||
|
||||
- name: Determine host
|
||||
id: host
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh determine_host
|
||||
|
||||
- name: Restore depends cache
|
||||
id: depends-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
depends/built
|
||||
depends/${{ steps.host.outputs.host }}
|
||||
key: depends-tsan-${{ hashFiles('depends/packages/*.mk') }}-${{ env.LLVM_VERSION }}
|
||||
|
||||
- name: Build depends (stage 1, without IPC)
|
||||
if: steps.depends-cache.outputs.cache-hit != 'true'
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_depends_without_ipc
|
||||
|
||||
- name: Save depends cache
|
||||
uses: actions/cache/save@v4
|
||||
if: steps.depends-cache.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: |
|
||||
depends/built
|
||||
depends/${{ steps.host.outputs.host }}
|
||||
key: depends-tsan-${{ hashFiles('depends/packages/*.mk') }}-${{ env.LLVM_VERSION }}
|
||||
|
||||
- name: Replace libmultiprocess subtree
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh replace_subtree
|
||||
|
||||
- name: Build depends (stage 2, IPC packages including libmultiprocess)
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_depends_with_ipc
|
||||
|
||||
- name: Restore ccache
|
||||
id: ccache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ccache-TSan-${{ github.ref }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-TSan-${{ github.ref }}-
|
||||
ccache-TSan-
|
||||
|
||||
- name: Reset ccache stats
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh reset_ccache_stats
|
||||
|
||||
- name: CMake configure
|
||||
env:
|
||||
BITCOIN_CORE_CMAKE_ARGS: |-
|
||||
-DSANITIZERS=thread
|
||||
-DAPPEND_CPPFLAGS=-DARENA_DEBUG -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
|
||||
-DCMAKE_TOOLCHAIN_FILE=depends/${{ steps.host.outputs.host }}/toolchain.cmake
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh configure_bitcoin_core
|
||||
|
||||
- name: Build
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh build_bitcoin_core
|
||||
|
||||
- name: Show ccache stats
|
||||
run: _libmultiprocess/ci/scripts/ci_helpers.sh show_ccache_stats
|
||||
|
||||
- name: Run IPC unit tests
|
||||
env:
|
||||
LD_LIBRARY_PATH: depends/${{ steps.host.outputs.host }}/lib
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh run_ipc_unit_tests "${{ matrix.unit_test_runs }}"
|
||||
|
||||
- name: Run IPC functional tests
|
||||
env:
|
||||
LD_LIBRARY_PATH: depends/${{ steps.host.outputs.host }}/lib
|
||||
CI_FAILFAST_TEST_LEAVE_DANGLING: 1
|
||||
run: _libmultiprocess/ci/scripts/bitcoin_core_ci.sh run_ipc_functional_tests "${{ matrix.functional_test_runs }}" "${{ matrix.functional_timeout_factor }}"
|
||||
|
||||
- name: Save ccache
|
||||
uses: actions/cache/save@v4
|
||||
if: github.ref == 'refs/heads/master' || steps.ccache-restore.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ccache-TSan-${{ github.ref }}-${{ github.sha }}
|
||||
30
.github/workflows/ci.yml
vendored
30
.github/workflows/ci.yml
vendored
@@ -120,16 +120,21 @@ jobs:
|
||||
env:
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
|
||||
run: |
|
||||
brew install --quiet ninja capnp
|
||||
brew install --quiet ninja capnp llvm
|
||||
|
||||
- name: Run CI script
|
||||
run: |
|
||||
export PATH="$(brew --prefix llvm)/bin:$PATH"
|
||||
CI_CONFIG="ci/configs/macos.bash" bash ci/scripts/ci.sh
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
NIXPKGS_CHANNEL: nixos-25.05
|
||||
NIX_EXTRA_CONFIG: |
|
||||
keep-env-derivations = true
|
||||
keep-outputs = true
|
||||
NIX_EXTRA_CONFIG_ACT: |
|
||||
sandbox = false
|
||||
filter-syscalls = false
|
||||
@@ -144,14 +149,33 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Determine CI configuration
|
||||
id: config
|
||||
env:
|
||||
CI_CONFIG: ci/configs/${{ matrix.config }}.bash
|
||||
run: ci/scripts/config.sh
|
||||
|
||||
- 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=channel:nixos-25.05 # latest release
|
||||
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: ${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}
|
||||
extra_nix_config: |
|
||||
${{ env.NIX_EXTRA_CONFIG }}
|
||||
${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}
|
||||
|
||||
- name: Cache Nix store
|
||||
if: steps.config.outputs.cache_nix_store == 'true'
|
||||
uses: nix-community/cache-nix-action@v7
|
||||
with:
|
||||
primary-key: nix-${{ runner.os }}-${{ matrix.config }}-${{ steps.config.outputs.nixpkgs_rev }}-${{ hashFiles('shell.nix', 'ci/patches/*.patch', format('ci/configs/{0}.bash', matrix.config)) }}
|
||||
restore-prefixes-first-match: |
|
||||
nix-${{ runner.os }}-${{ matrix.config }}-${{ steps.config.outputs.nixpkgs_rev }}-
|
||||
nix-${{ runner.os }}-${{ matrix.config }}-
|
||||
nix-${{ runner.os }}-
|
||||
gc-max-store-size-linux: 10G
|
||||
|
||||
- name: Run CI script
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user