From 6498eb410667864a8807845a0e7ed69f370f1006 Mon Sep 17 00:00:00 2001 From: Jean-Michael Celerier Date: Sun, 16 Aug 2026 09:18:21 -0400 Subject: [PATCH] ci: make the FreeBSD job actually build, and fail when it does not ci/freebsd.build.sh started with "#!/usr/bin/env bash -e". env(1) does not split its first operand, so it looked for a program literally named "bash -e", printed "env: bash -e: No such file or directory" and exited 127 before a single line of the script ran. score has therefore never been compiled by the FreeBSD job - see for instance run 31948475911, where the whole build step is those five words between "Start Build" and "End Build". Nothing noticed because the workflow ran the script as "./ci/freebsd.build.sh && echo ... Success ...": the && swallows the failure, and the step's status is that of the trailing "End Build" echo, which always succeeds. Adding set -e to the run block is not enough on its own either - errexit is specified to ignore any command of an AND-OR list other than the last one. So set the option inside the script instead, and let the workflow run it as a plain command under set -e. Note that bash lives in /usr/local/bin on FreeBSD, which is why this one keeps env rather than the "#!/bin/bash -e" of its siblings. Verified on a FreeBSD 15.0 VM with a cmake stub that fails on --build: the workflow block exits 0 before, 1 after, and still 0 when the build succeeds. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/bsd.yml | 4 +++- ci/freebsd.build.sh | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bsd.yml b/.github/workflows/bsd.yml index 1439e8cc89..cd9c8638f3 100644 --- a/.github/workflows/bsd.yml +++ b/.github/workflows/bsd.yml @@ -52,8 +52,10 @@ jobs: echo "=============== FreeBSD End install =====================" run: | + set -e echo "=============== FreeBSD Start Deps =====================" ./ci/common.deps.sh && echo "=============== FreeBSD Deps Success =====================" echo "=============== FreeBSD Start Build =====================" - ./ci/freebsd.build.sh && echo "=============== FreeBSD Build Success =====================" + ./ci/freebsd.build.sh + echo "=============== FreeBSD Build Success =====================" echo "=============== FreeBSD End Build =====================" diff --git a/ci/freebsd.build.sh b/ci/freebsd.build.sh index 5b3f209a41..80bf84f980 100755 --- a/ci/freebsd.build.sh +++ b/ci/freebsd.build.sh @@ -1,4 +1,10 @@ -#!/usr/bin/env bash -e +#!/usr/bin/env bash +# The options have to be set here, not on the shebang line: env(1) does not +# split its first operand, so "#!/usr/bin/env bash -e" looks for a program +# literally named "bash -e" and exits 127 before running a single line. +# Note that bash is /usr/local/bin/bash on FreeBSD, hence env rather than the +# "#!/bin/bash -e" the other ci/*.build.sh use. +set -e export SCORE_DIR=$PWD