Skip to content

Commit 3eba121

Browse files
committed
fix(ci): route FreeBSD build through canonical scripts/build.sh
- scripts/env.sh: add freebsd* OS detection + MAKE=gmake (BSD make doesn't understand GNU Makefile.cbm syntax; all other platforms use 'make') - scripts/build.sh: use $MAKE instead of hard-coded 'make' (2 call sites) - scripts/package-release.sh: add 'freebsd' to GOOS case validation + usage - .github/workflows/_build.yml: replace inline gmake calls with scripts/build.sh, following venue-parity contract Venue parity contract requires: provision in prepare:, call canonical scripts/ in run:. Inline gmake violated this — now FreeBSD follows the same pattern as Linux/macOS/Windows. Closes: PR DeusData#1422 venue-parity contract violation Signed-off-by: Pedro Ramos <131530838+pr9000@users.noreply.github.com>
1 parent e7e2dba commit 3eba121

4 files changed

Lines changed: 30 additions & 14 deletions

File tree

‎.github/workflows/_build.yml‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,17 +379,22 @@ jobs:
379379
prepare: |
380380
pkg update -f
381381
pkg install -y gmake sqlite3 pkgconf node22 npm-node22 bash
382-
run: |
383382
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
384-
echo "Python location: $(which python3 2>/dev/null || echo 'not found')"
385-
python3 --version 2>&1 || true
386-
387-
# 1. Build standard binary
388-
gmake -f Makefile.cbm cbm
383+
run: |
384+
# Build standard binary (canonical scripts/build.sh pattern)
385+
if [ -n "${{ inputs.version }}" ]; then
386+
scripts/build.sh --version "${{ inputs.version }}" CC=clang CXX=clang++
387+
else
388+
scripts/build.sh CC=clang CXX=clang++
389+
fi
389390
scripts/package-release.sh freebsd ${{ matrix.arch }}-${{ matrix.release }}
390391
391-
# 2. Build UI binary
392-
gmake -f Makefile.cbm cbm-with-ui
392+
# Build UI binary
393+
if [ -n "${{ inputs.version }}" ]; then
394+
scripts/build.sh --version "${{ inputs.version }}" --with-ui CC=clang CXX=clang++
395+
else
396+
scripts/build.sh --with-ui CC=clang CXX=clang++
397+
fi
393398
scripts/package-release.sh freebsd ${{ matrix.arch }}-${{ matrix.release }} --variant ui
394399
395400
- name: Attest standard binary provenance

‎scripts/build.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ cbm_remove_build_dir "$ROOT" "$BUILD_DIR"
149149

150150
# Step 2: Build (Makefile applies $ARCHFLAGS for the target arch on macOS)
151151
if $WITH_UI; then
152-
make -j"$NPROC" -f Makefile.cbm cbm-with-ui \
152+
$MAKE -j"$NPROC" -f Makefile.cbm cbm-with-ui \
153153
CFLAGS_EXTRA="$CFLAGS_EXTRA" "${EXTRA_MAKE_ARGS[@]+"${EXTRA_MAKE_ARGS[@]}"}"
154154
else
155-
make -j"$NPROC" -f Makefile.cbm cbm \
155+
$MAKE -j"$NPROC" -f Makefile.cbm cbm \
156156
CFLAGS_EXTRA="$CFLAGS_EXTRA" "${EXTRA_MAKE_ARGS[@]+"${EXTRA_MAKE_ARGS[@]}"}"
157157
fi
158158

‎scripts/env.sh‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# ARCH — target architecture (arm64 / x86_64)
88
# ARCHFLAGS — "-arch <arch>" on macOS (target slice for clang/ld), empty elsewhere
99
# NPROC — number of CPU cores
10-
# OS — darwin / linux / windows
10+
# OS — darwin / linux / windows / freebsd
1111

1212
set -euo pipefail
1313

@@ -16,10 +16,21 @@ OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
1616
case "$OS" in
1717
darwin) OS="darwin" ;;
1818
linux) OS="linux" ;;
19+
freebsd*) OS="freebsd" ;;
1920
mingw*|msys*|cygwin*) OS="windows" ;;
2021
*) OS="unknown" ;;
2122
esac
2223

24+
# ── Set platform-appropriate make ──────────────────────────────
25+
# FreeBSD ships BSD make as the default 'make'; GNU Makefile syntax in
26+
# Makefile.cbm requires gmake. All other platforms use 'make'.
27+
if [[ "$OS" == "freebsd" ]]; then
28+
MAKE=gmake
29+
else
30+
MAKE=make
31+
fi
32+
export MAKE
33+
2334
# ── Detect / override architecture ─────────────────────────────
2435
# Default: native HARDWARE architecture (not Rosetta-translated).
2536
# On macOS under Rosetta, uname -m returns x86_64 even on Apple Silicon.

‎scripts/package-release.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Usage: scripts/package-release.sh <goos> <goarch> [--variant standard|ui]
2323
The canonical release-archive step: identical in the release build and the
2424
local artifact-flow smoke lane.
2525
26-
goos linux | darwin | windows
26+
goos linux | darwin | windows | freebsd
2727
goarch arch label used verbatim in the archive name (amd64, arm64,
2828
arm64-portable, ...)
2929
--variant standard (default) | ui — selects the archive NAME prefix; the
@@ -77,8 +77,8 @@ for arg in "$@"; do
7777
done
7878
[ -n "$GOOS" ] && [ -n "$GOARCH" ] || { usage >&2; exit 2; }
7979
case "$GOOS" in
80-
linux | darwin | windows) ;;
81-
*) echo "package-release: goos must be linux, darwin or windows." >&2; exit 2 ;;
80+
linux | darwin | windows | freebsd) ;;
81+
*) echo "package-release: goos must be linux, darwin, windows or freebsd." >&2; exit 2 ;;
8282
esac
8383
case "$VARIANT" in
8484
standard) SUFFIX="" ;;

0 commit comments

Comments
 (0)