Skip to content

fix: do not hardcode gcc; FreeBSD base has no gcc at all - #1375

Merged
nicolas-maman merged 2 commits into
mainfrom
fix/freebsd-native-toolchain
Aug 2, 2026
Merged

fix: do not hardcode gcc; FreeBSD base has no gcc at all#1375
nicolas-maman merged 2 commits into
mainfrom
fix/freebsd-native-toolchain

Conversation

@nicolas-maman

@nicolas-maman nicolas-maman commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

The FreeBSD native job added in #1373 failed on its first real run, post-merge,
which is exactly what it was added to do.

gmake: gcc: No such file or directory
gmake: *** [Makefile:556: build/obj/compiler/aetherc.o] Error 127

CC was hardcoded to gcc. FreeBSD base installs clang as cc and ships no
gcc at all, so a native build there dies before compiling a single object. That
is a real defect in the build for anyone building on FreeBSD, not just in CI,
so it is fixed in the Makefile rather than papered over with CC=clang in the
workflow.

CC now prefers gcc, falls back to the system cc, then clang. Everything
that builds today is unaffected, since all of those platforms have gcc, macOS
included through its clang shim. Verified: resolves to gcc unchanged on a host
that has it, cc when gcc is absent, clang when neither is present.

Also trims the comment blocks #1373 left in ci.yml down to the facts that
cannot be read off the code.

The native job now runs on pull requests

#1373 kept it behind the merge on my estimate that a VM boot plus a from-scratch
build would cost tens of minutes. That estimate was wrong. Measured on its first
real run: 1.6 minutes end to end, 140 files compiled, libaether.a built,
Building Test Suite (FreeBSD), 229/229 unit tests passed. At that price
there is no argument for learning after merge what can be known before, so the
if: github.event_name != 'pull_request' gate is removed and the timeout drops
from 60 to 30 minutes.

FreeBSD is now fully covered before merge: the cross gate for compile breaks,
the native job for anything that only shows up when the code actually runs.

Validation

Validated pre-merge with a workflow_dispatch run on this branch (the native
job was still PR-gated at that point, and dispatch runs it):
both FreeBSD / cross-compile (x86_64) and FreeBSD / native build + unit tests passed. This PR's own checks now exercise the native job directly.

CC was set unconditionally to gcc, so a native FreeBSD build failed with
"gcc: No such file or directory" before compiling a single object. FreeBSD
base installs clang as cc and ships no gcc. CC now prefers gcc, then the
system cc, then clang; every platform building today has gcc (macOS through
its clang shim), so nothing that worked changes.

Found by the FreeBSD native CI job added in #1373, on its first run after
merge, which is what that job is for.

Also trims the comment blocks that PR left in ci.yml down to the facts that
are not readable from the code.
It was gated to push-to-main on the assumption that a VM boot plus a
from-scratch build cost tens of minutes. Measured on the first real run:
1.6 minutes end to end, 140 files compiled and 229/229 unit tests. At that
price there is no reason to learn after merge what can be known before.
@nicolas-maman
nicolas-maman merged commit 431a4c7 into main Aug 2, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant