Skip to content

NetBSD: Enable bdb package in depends #59

NetBSD: Enable bdb package in depends

NetBSD: Enable bdb package in depends #59

Workflow file for this run

name: NetBSD
on:
pull_request:
paths:
- '.github/actions/**'
- '.github/workflows/netbsd.yml'
schedule:
- cron: '22 02 * * *'
workflow_dispatch:
inputs:
skip_functional_tests:
description: 'Skip functional tests'
required: true
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
cancel-in-progress: true
env:
CCACHE_COMPILERCHECK: content
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXFILES: 1600
# See https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
CI_NCPU: 4
jobs:
netbsd-syslibs:
name: 'NetBSD: system libs, no GUI'
runs-on: ubuntu-latest
defaults:
run:
shell: netbsd {0}
steps:
- name: Checkout Bitcoin Core repo
uses: actions/checkout@v4
with:
repository: bitcoin/bitcoin
- name: Start NetBSD VM
uses: vmactions/netbsd-vm@v1
with:
envs: 'CCACHE_COMPILERCHECK CCACHE_DIR CCACHE_MAXFILES'
prepare: |
/usr/sbin/pkg_info > packages_before
/usr/sbin/pkg_add cmake git-base gcc14 pkg-config ccache boost-headers libevent sqlite3 db4 zeromq python313 py313-zmq
/usr/sbin/pkg_info > packages_after
diff -w packages_before packages_after | grep '^>'
run: git config --global --add safe.directory ${{ github.workspace }}
sync: 'rsync'
copyback: false
- name: Checkout helper actions
uses: actions/checkout@v4
with:
sparse-checkout: .github/actions
path: ci/nightly
- name: Generate buildsystem
run: |
cd ${{ github.workspace }}
# FIXME: The `-Wl,-z,separate-code` flag is incompatible with NetBSD's dynamic linker.
cmake -B build -DCMAKE_C_COMPILER="/usr/pkg/gcc14/bin/gcc" -DCMAKE_CXX_COMPILER="/usr/pkg/gcc14/bin/g++" -DWITH_BDB=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON -DAPPEND_LDFLAGS="-Wl,-z,noseparate-code"
- name: Build
uses: ./ci/nightly/.github/actions/build-with-ccache
with:
vm: netbsd
- name: Check 'bitcoind' executable
run: |
set -e
cd ${{ github.workspace }}
# TODO: Remove this line after https://github.com/bitcoin/bitcoin/pull/31543 is merged.
export LD_LIBRARY_PATH=/usr/pkg/lib
ls -l ./build/src/bitcoind
file ./build/src/bitcoind
ldd ./build/src/bitcoind
./build/src/bitcoind -version
- name: Run test suite
uses: ./ci/nightly/.github/actions/run-test-suite
with:
vm: netbsd
- name: Run functional tests
if: ${{ ! inputs.skip_functional_tests }}
run: |
cd ${{ github.workspace }}
# TODO: Remove this line after https://github.com/bitcoin/bitcoin/pull/31543 is merged.
export LD_LIBRARY_PATH=/usr/pkg/lib
# TODO: Fix and enable the following tests: rpc_signer.py, wallet_signer.py.
# See:
# - https://github.com/bitcoin/bitcoin/pull/31541
python3.13 build/test/functional/test_runner.py --ci --extended -j ${{ env.CI_NCPU }} --combinedlogslen=99999999 --quiet --tmpdirprefix . --timeout-factor=8 --exclude=rpc_signer.py,wallet_signer.py
netbsd-depends:
name: 'NetBSD: depends, MP'
runs-on: ubuntu-latest
defaults:
run:
shell: netbsd {0}
steps:
- name: Checkout Bitcoin Core repo
uses: actions/checkout@v4
with:
repository: bitcoin/bitcoin
- name: Apply patch
# This patch works around a libevent bug.
# For more details, see:
# - https://github.com/libevent/libevent/pull/1768
# - https://github.com/bitcoin/bitcoin/pull/31500
shell: bash -e {0}
run: |
cat >> depends/patches/libevent/cmake_fixups.patch << 'EOF'
--- a/kqueue.c
+++ b/kqueue.c
@@ -52,8 +52,8 @@
* intptr_t, whereas others define it as void*. There doesn't seem to be an
* easy way to tell them apart via autoconf, so we need to use OS macros. */
#if defined(__NetBSD__)
-#define PTR_TO_UDATA(x) ((typeof(((struct kevent *)0)->udata))(x))
-#define INT_TO_UDATA(x) ((typeof(((struct kevent *)0)->udata))(intptr_t)(x))
+#define PTR_TO_UDATA(x) ((__typeof__(((struct kevent *)0)->udata))(x))
+#define INT_TO_UDATA(x) ((__typeof__(((struct kevent *)0)->udata))(intptr_t)(x))
#elif defined(EVENT__HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__) && !defined(__CloudABI__)
#define PTR_TO_UDATA(x) ((intptr_t)(x))
#define INT_TO_UDATA(x) ((intptr_t)(x))
EOF
- name: Start NetBSD VM
uses: vmactions/netbsd-vm@v1
with:
envs: 'CCACHE_COMPILERCHECK CCACHE_DIR CCACHE_MAXFILES'
prepare: |
/usr/sbin/pkg_info > packages_before
/usr/sbin/pkg_add bash curl gmake cmake git-base perl gcc14 pkg-config ccache python313 py313-zmq
/usr/sbin/pkg_info > packages_after
diff -w packages_before packages_after | grep '^>'
run: git config --global --add safe.directory ${{ github.workspace }}
sync: 'rsync'
copyback: false
- name: Checkout helper actions
uses: actions/checkout@v4
with:
sparse-checkout: .github/actions
path: ci/nightly
- name: Build depends
uses: ./ci/nightly/.github/actions/build-depends
with:
vm: netbsd
options: "build_CC=/usr/pkg/gcc14/bin/gcc build_CXX=/usr/pkg/gcc14/bin/g++ CC=/usr/pkg/gcc14/bin/gcc CXX=/usr/pkg/gcc14/bin/g++ bdb_cppflags_netbsd=-D_NETBSD_SOURCE MULTIPROCESS=1"
- name: Generate buildsystem
run: |
cd ${{ github.workspace }}
# FIXME: The `-Wl,-z,separate-code` flag is incompatible with NetBSD's dynamic linker.
cmake -B build --toolchain depends/$(./depends/config.guess)/toolchain.cmake -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON -DAPPEND_LDFLAGS="-Wl,-z,noseparate-code"
- name: Build
uses: ./ci/nightly/.github/actions/build-with-ccache
with:
vm: netbsd
- name: Check 'bitcoind' executable
run: |
set -e
cd ${{ github.workspace }}
ls -l ./build/src/bitcoind
file ./build/src/bitcoind
ldd ./build/src/bitcoind
./build/src/bitcoind -version
- name: Run test suite
uses: ./ci/nightly/.github/actions/run-test-suite
with:
vm: netbsd
- name: Run functional tests
if: ${{ ! inputs.skip_functional_tests }}
run: |
cd ${{ github.workspace }}
# TODO: Fix and enable the following tests: rpc_signer.py, wallet_signer.py.
# See:
# - https://github.com/bitcoin/bitcoin/pull/31541
python3.13 build/test/functional/test_runner.py --ci --extended -j ${{ env.CI_NCPU }} --combinedlogslen=99999999 --quiet --tmpdirprefix . --timeout-factor=8 --exclude=rpc_signer.py,wallet_signer.py