Skip to content

Commit 612eee2

Browse files
authored
Merge pull request DeusData#2911 from DeusData/ci/freebsd-dispatch-workflow
ci(freebsd): add a dispatch-only, informational FreeBSD build workflow
2 parents 55206a8 + f13c847 commit 612eee2

3 files changed

Lines changed: 85 additions & 6 deletions

File tree

‎.github/workflows/freebsd.yml‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# FreeBSD build, INFORMATIONAL ONLY. Builds the headless binary (the C core,
2+
# no embedded UI) inside a FreeBSD VM with the canonical scripts/build.sh,
3+
# then checks that the binary starts (--version). The UI build is not run here:
4+
# its npm dependency tree pulls in onnxruntime-node, which publishes no FreeBSD
5+
# build, so `npm ci` stops with EBADPLATFORM. The UI bundle itself is
6+
# platform-independent JavaScript and is built on every other leg.
7+
#
8+
# NON-GATING: workflow_dispatch only. This workflow is not part of the ci-ok
9+
# aggregate and is not called by release.yml or dry-run.yml, so a FreeBSD red
10+
# never blocks a pull request or a release. Nothing from it is uploaded or
11+
# published, and it runs with read-only permissions.
12+
name: FreeBSD build (informational)
13+
14+
on:
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
build-freebsd:
22+
name: build (freebsd-${{ matrix.release }}, ${{ matrix.arch }}, clang)
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
release: ['15.1', '14.4']
27+
arch: ['x86_64']
28+
# arch: ['x86_64', 'aarch64']
29+
# aarch64 is disabled for now: it has not been proven with this
30+
# workflow. Its earlier blocker was the frontend build (lightningcss
31+
# publishes no freebsd-arm64 binary), which this headless job no
32+
# longer runs. Re-enable after a green aarch64 proof run.
33+
include:
34+
- arch: x86_64
35+
sync: rsync
36+
# - arch: aarch64
37+
# sync: scp
38+
# Must be an x86_64 host (ubuntu-latest). QEMU guest emulation on the arm
39+
# runners (ubuntu-*-arm) degrades so badly that runs hit 3+ hour timeouts.
40+
runs-on: ubuntu-latest
41+
timeout-minutes: 90
42+
steps:
43+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
44+
with:
45+
persist-credentials: false
46+
47+
- name: Build and run inside a FreeBSD ${{ matrix.release }} (${{ matrix.arch }}) VM
48+
# https://github.com/vmactions/freebsd-vm
49+
uses: vmactions/freebsd-vm@c46abacb49f09938ca4e1702d15d836285d694cc # v1.5.9
50+
with:
51+
release: ${{ matrix.release }}
52+
arch: ${{ matrix.arch }}
53+
# Sync options: rsync, sshfs, nfs, scp
54+
sync: ${{ matrix.sync }}
55+
# Nothing from the VM is used after the run, so skip the copy back.
56+
copyback: false
57+
mem: 6144
58+
cpu: 4
59+
prepare: |
60+
pkg update -f
61+
pkg install -y gmake sqlite3 pkgconf bash
62+
which python3 >/dev/null 2>&1 || ln -sf $(which python3.15 python3.14 python3.13 python3.12 python3.11 python3.10 2>/dev/null | head -n 1) /usr/local/bin/python3
63+
run: |
64+
scripts/build.sh CC=clang CXX=clang++
65+
build/c/codebase-memory-mcp --version

‎scripts/build.sh‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,18 @@ else
193193
cbm_remove_build_dir "$ROOT" "$BUILD_DIR"
194194
fi
195195

196-
# Step 2: Build (Makefile applies $ARCHFLAGS for the target arch on macOS)
196+
# Step 2: Build (Makefile applies $ARCHFLAGS for the target arch on macOS;
197+
# $MAKE comes from env.sh: gmake on FreeBSD, make elsewhere)
197198
if [[ "$PHASE" == vendored ]]; then
198-
make -j"$NPROC" -f Makefile.cbm cbm-third-party \
199+
"$MAKE" -j"$NPROC" -f Makefile.cbm cbm-third-party \
199200
CFLAGS_EXTRA="$CFLAGS_EXTRA" "${EXTRA_MAKE_ARGS[@]+"${EXTRA_MAKE_ARGS[@]}"}"
200201
echo "=== Third-party objects built in ${BUILD_DIR} (no binary) ==="
201202
exit 0
202203
elif $WITH_UI; then
203-
make -j"$NPROC" -f Makefile.cbm cbm-with-ui \
204+
"$MAKE" -j"$NPROC" -f Makefile.cbm cbm-with-ui \
204205
CFLAGS_EXTRA="$CFLAGS_EXTRA" "${EXTRA_MAKE_ARGS[@]+"${EXTRA_MAKE_ARGS[@]}"}"
205206
else
206-
make -j"$NPROC" -f Makefile.cbm cbm "${RETRACE_ARGS[@]+"${RETRACE_ARGS[@]}"}" \
207+
"$MAKE" -j"$NPROC" -f Makefile.cbm cbm "${RETRACE_ARGS[@]+"${RETRACE_ARGS[@]}"}" \
207208
CFLAGS_EXTRA="$CFLAGS_EXTRA" "${EXTRA_MAKE_ARGS[@]+"${EXTRA_MAKE_ARGS[@]}"}"
208209
fi
209210

‎scripts/env.sh‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
# Exports:
77
# ARCH — target architecture (arm64 / x86_64)
88
# ARCHFLAGS — "-arch <arch>" on macOS (target slice for clang/ld), empty elsewhere
9+
# MAKE — make program for Makefile.cbm (gmake on FreeBSD, make elsewhere)
910
# NPROC — number of CPU cores
10-
# OS — darwin / linux / windows
11+
# OS — darwin / linux / windows / freebsd
1112

1213
set -euo pipefail
1314

@@ -16,10 +17,22 @@ OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
1617
case "$OS" in
1718
darwin) OS="darwin" ;;
1819
linux) OS="linux" ;;
20+
freebsd*) OS="freebsd" ;;
1921
mingw*|msys*|cygwin*) OS="windows" ;;
2022
*) OS="unknown" ;;
2123
esac
2224

25+
# ── Select the make program ────────────────────────────────────
26+
# Makefile.cbm is written in GNU make syntax. FreeBSD ships BSD make as its
27+
# default make, so builds there run gmake (pkg install gmake); every other
28+
# platform runs make. Not exported: build.sh sources this file and runs
29+
# $MAKE in the same shell.
30+
if [[ "$OS" == "freebsd" ]]; then
31+
MAKE="gmake"
32+
else
33+
MAKE="make"
34+
fi
35+
2336
# ── Detect / override architecture ─────────────────────────────
2437
# Default: native HARDWARE architecture (not Rosetta-translated).
2538
# On macOS under Rosetta, uname -m returns x86_64 even on Apple Silicon.
@@ -128,5 +141,5 @@ fi
128141
# ── Print environment summary ──────────────────────────────────
129142
print_env() {
130143
local context="$1"
131-
echo "=== $context: os=$OS arch=$ARCH cores=$NPROC cc=${CC:-default} cxx=${CXX:-default} ==="
144+
echo "=== $context: os=$OS arch=$ARCH cores=$NPROC cc=${CC:-default} cxx=${CXX:-default} make=$MAKE ==="
132145
}

0 commit comments

Comments
 (0)