Skip to content

Commit e750c05

Browse files
DeusDataPR9000
andcommitted
ci(freebsd): add a dispatch-only, informational FreeBSD build workflow
Add .github/workflows/freebsd.yml, a standalone workflow triggered only by workflow_dispatch. It builds the UI-embedded binary inside FreeBSD 15.1 and 14.4 x86_64 VMs (vmactions/freebsd-vm, full-SHA pin to v1.5.9) with the canonical scripts/build.sh and runs the binary with --version. It declares read-only permissions, uploads and publishes nothing, is not part of ci-ok and is not called by release.yml or dry-run.yml, so a FreeBSD red never gates a pull request or a release. scripts/env.sh now detects FreeBSD and selects gmake there (BSD make cannot read the GNU make syntax of Makefile.cbm) and make everywhere else; the environment summary line reports the choice. scripts/build.sh runs $MAKE at all three build call sites. macOS, Linux and Windows still run make, so their builds are unchanged. Distilled from DeusData#1422 by PR9000: the release matrix, the x86_64-host choice, the aarch64 exclusion, the vmactions VM approach with a SHA pin, fail-fast: false and the gmake detection all come from that pull request, which built on the FreeBSD groundwork of DeusData#1093, DeusData#1423 and DeusData#1467. Co-authored-by: Pedro Ramos <131530838+pr9000@users.noreply.github.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent e0c7a1d commit e750c05

3 files changed

Lines changed: 86 additions & 6 deletions

File tree

‎.github/workflows/freebsd.yml‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# FreeBSD build, INFORMATIONAL ONLY. Builds the UI-embedded binary (the one
2+
# every platform ships) inside a FreeBSD VM with the canonical scripts/build.sh,
3+
# then checks that the binary starts (--version).
4+
#
5+
# NON-GATING: workflow_dispatch only. This workflow is not part of the ci-ok
6+
# aggregate and is not called by release.yml or dry-run.yml, so a FreeBSD red
7+
# never blocks a pull request or a release. Nothing from it is uploaded or
8+
# published, and it runs with read-only permissions.
9+
name: FreeBSD build (informational)
10+
11+
on:
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build-freebsd:
19+
name: build (freebsd-${{ matrix.release }}, ${{ matrix.arch }}, clang)
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
release: ['15.1', '14.4']
24+
arch: ['x86_64']
25+
# arch: ['x86_64', 'aarch64']
26+
# aarch64 is disabled for now: lightningcss (a native Rust dependency
27+
# of the Vite/CSS build) publishes no prebuilt binary for freebsd-arm64,
28+
# so `npm run build` fails with "Cannot find module
29+
# '../lightningcss.freebsd-arm64.node'". That is a gap in the package's
30+
# platform coverage, not something fixable on our side without
31+
# vendoring a Rust build of it. Re-enable once lightningcss ships that
32+
# target, or once the frontend build runs natively on a Linux host
33+
# instead of inside the FreeBSD VM.
34+
include:
35+
- arch: x86_64
36+
sync: rsync
37+
# - arch: aarch64
38+
# sync: scp
39+
# Must be an x86_64 host (ubuntu-latest). QEMU guest emulation on the arm
40+
# runners (ubuntu-*-arm) degrades so badly that runs hit 3+ hour timeouts.
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 90
43+
steps:
44+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
45+
with:
46+
persist-credentials: false
47+
48+
- name: Build and run inside a FreeBSD ${{ matrix.release }} (${{ matrix.arch }}) VM
49+
# https://github.com/vmactions/freebsd-vm
50+
uses: vmactions/freebsd-vm@c46abacb49f09938ca4e1702d15d836285d694cc # v1.5.9
51+
with:
52+
release: ${{ matrix.release }}
53+
arch: ${{ matrix.arch }}
54+
# Sync options: rsync, sshfs, nfs, scp
55+
sync: ${{ matrix.sync }}
56+
# Nothing from the VM is used after the run, so skip the copy back.
57+
copyback: false
58+
mem: 6144
59+
cpu: 4
60+
prepare: |
61+
pkg update -f
62+
pkg install -y gmake sqlite3 pkgconf node22 npm-node22 bash
63+
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
64+
run: |
65+
scripts/build.sh --with-ui CC=clang CXX=clang++
66+
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)