From 65379bb8d0ebcbf5251f0bc0727019d2ba95be3c Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 3 Feb 2026 11:58:43 +0000 Subject: [PATCH] ci: add FreeBSD cross CI job --- .github/workflows/ci.yml | 6 ++++++ ci/test/00_setup_env_freebsd_cross.sh | 23 +++++++++++++++++++++++ ci/test/01_base_install.sh | 12 ++++++++++++ 3 files changed, 41 insertions(+) create mode 100755 ci/test/00_setup_env_freebsd_cross.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 914b29cad3d..dd26228292a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -486,6 +486,12 @@ jobs: timeout-minutes: 120 file-env: './ci/test/00_setup_env_mac_cross_intel.sh' + - name: 'FreeBSD Cross' + cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' + fallback-runner: 'ubuntu-24.04' + timeout-minutes: 120 + file-env: './ci/test/00_setup_env_freebsd_cross.sh' + - name: 'No wallet' cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' fallback-runner: 'ubuntu-24.04' diff --git a/ci/test/00_setup_env_freebsd_cross.sh b/ci/test/00_setup_env_freebsd_cross.sh new file mode 100755 index 00000000000..da7304d1d26 --- /dev/null +++ b/ci/test/00_setup_env_freebsd_cross.sh @@ -0,0 +1,23 @@ +#!/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_freebsd_cross +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" +export APT_LLVM_V="22" +export FREEBSD_VERSION=15.0 +export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} lld" +export HOST=x86_64-unknown-freebsd +export DEP_OPTS="build_CC=clang build_CXX=clang++ AR=llvm-ar-${APT_LLVM_V} STRIP=llvm-strip-${APT_LLVM_V} NM=llvm-nm-${APT_LLVM_V} RANLIB=llvm-ranlib-${APT_LLVM_V}" +export GOAL="install" +export BITCOIN_CONFIG="\ + --preset=dev-mode \ + -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 308f7abe862..0debf36fedc 100755 --- a/ci/test/01_base_install.sh +++ b/ci/test/01_base_install.sh @@ -104,4 +104,16 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ] tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" fi +FREEBSD_SDK_BASENAME="freebsd-${HOST}-${FREEBSD_VERSION}" + +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}" + if [ ! -f "$FREEBSD_SDK_PATH" ]; then + ${CI_RETRY_EXE} curl --location --fail "https://download.freebsd.org/releases/amd64/${FREEBSD_VERSION}-RELEASE/base.txz" -o "$FREEBSD_SDK_PATH" + fi + mkdir -p "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" + tar -C "${DEPENDS_DIR}/SDKs/${FREEBSD_SDK_BASENAME}" -xf "$FREEBSD_SDK_PATH" +fi + echo -n "done" > "${CFG_DONE}"