What changed, and why it matters
This commit adds a new automated build test for Bitcoin Core that compiles the software for NetBSD (a lesser-used operating system) from an Ubuntu machine. It does not change any Bitcoin code, wallet logic, network behavior, or security settings. It only adds continuous-integration (CI) configuration files and a script to download the NetBSD system headers/libraries needed for cross-compilation.
No security action required. Reviewers may optionally verify the NetBSD SDK download URL and checksum policy, but the change is routine CI infrastructure expansion consistent with existing cross-compilation jobs.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces a GitHub Actions CI matrix entry named ‘NetBSD Cross’ and a setup script ci/test/00_setup_env_netbsd_cross.sh that configures clang/LLVM cross-compilation for x86_64-unknown-netbsd using a NetBSD 11.0_RC6 sysroot. ci/test/01_base_install.sh is extended to download base.tar.xz and comp.tar.xz from cdn.netbsd.org and extract them into the depends SDK directory, mirroring the existing FreeBSD and macOS cross-compilation workflows. Unit and functional tests are disabled for this job (RUN_UNIT_TESTS=false, RUN_FUNCTIONAL_TESTS=false).
Changed components
.github/workflows/ci.ymlci/test/00_setup_env_netbsd_cross.shci/test/01_base_install.shInspect captured patch +52 / −0
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 34dd688e..bce9c603 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -463,6 +463,12 @@ jobs:
timeout-minutes: 120
file-env: './ci/test/00_setup_env_mac_cross_intel.sh'
+ - name: 'NetBSD Cross'
+ warp-runner: 'warp-ubuntu-latest-x64-8x'
+ fallback-runner: 'ubuntu-latest'
+ timeout-minutes: 120
+ file-env: './ci/test/00_setup_env_netbsd_cross.sh'
+
- name: 'FreeBSD Cross'
warp-runner: 'warp-ubuntu-latest-x64-8x'
fallback-runner: 'ubuntu-latest'
diff --git a/ci/test/00_setup_env_netbsd_cross.sh b/ci/test/00_setup_env_netbsd_cross.sh
new file mode 100755
index 00000000..9fb4c18a
--- /dev/null
+++ b/ci/test/00_setup_env_netbsd_cross.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or https://opensource.org/license/mit.
+
+export LC_ALL=C.UTF-8
+
+export CONTAINER_NAME=ci_netbsd_cross
+export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:26.04"
+export APT_LLVM_V="22"
+export HOST=x86_64-unknown-netbsd
+export NETBSD_VERSION=11.0_RC6
+export NETBSD_SDK_BASENAME="netbsd-${HOST}-${NETBSD_VERSION}"
+export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld-${APT_LLVM_V}"
+export SYSROOT="--sysroot=${DEPENDS_DIR}/SDKs/${NETBSD_SDK_BASENAME}"
+export DEP_OPTS="build_CC=clang build_CXX=clang++ \
+ CC='clang --target=${HOST} ${SYSROOT}' \
+ CXX='clang++ --target=${HOST} ${SYSROOT} -stdlib=libstdc++' \
+ LDFLAGS='-fuse-ld=lld -lgcc_s' \
+ AR=llvm-ar-${APT_LLVM_V} \
+ NM=llvm-nm-${APT_LLVM_V} \
+ OBJCOPY=llvm-objcopy-${APT_LLVM_V} \
+ OBJDUMP=llvm-objdump-${APT_LLVM_V} \
+ RANLIB=llvm-ranlib-${APT_LLVM_V} \
+ STRIP=llvm-strip-${APT_LLVM_V}"
+export GOAL="install"
+export BITCOIN_CONFIG="\
+ --preset=dev-mode \
+ -DBUILD_GUI=OFF \
+ -DREDUCE_EXPORTS=ON \
+ -DWITH_USDT=OFF \
+"
+export RUN_UNIT_TESTS=false
+export RUN_FUNCTIONAL_TESTS=false
diff --git a/ci/test/01_base_install.sh b/ci/test/01_base_install.sh
index 652416b9..f619a088 100755
--- a/ci/test/01_base_install.sh
+++ b/ci/test/01_base_install.sh
@@ -118,6 +118,17 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
fi
+if [ -n "$NETBSD_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${NETBSD_SDK_BASENAME}" ]; then
+ mkdir -p "${DEPENDS_DIR}/SDKs/${NETBSD_SDK_BASENAME}"
+ for NETBSD_SDK_FILENAME in base.tar.xz comp.tar.xz; do
+ NETBSD_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${NETBSD_SDK_FILENAME}"
+ if [ ! -f "$NETBSD_SDK_PATH" ]; then
+ ${CI_RETRY_EXE} curl --location --fail "https://cdn.netbsd.org/pub/NetBSD/NetBSD-${NETBSD_VERSION}/amd64/binary/sets/${NETBSD_SDK_FILENAME}" -o "$NETBSD_SDK_PATH"
+ fi
+ tar -C "${DEPENDS_DIR}/SDKs/${NETBSD_SDK_BASENAME}" -xf "$NETBSD_SDK_PATH"
+ done
+fi
+
if [ -n "$FREEBSD_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" ]; then
FREEBSD_SDK_FILENAME="base-${FREEBSD_VERSION}.txz"
FREEBSD_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${FREEBSD_SDK_FILENAME}"
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.