fix: do not hardcode gcc; FreeBSD base has no gcc at all - #1375
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The FreeBSD native job added in #1373 failed on its first real run, post-merge,
which is exactly what it was added to do.
CCwas hardcoded togcc. FreeBSD base installs clang asccand ships nogcc 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=clangin theworkflow.
CCnow prefersgcc, falls back to the systemcc, thenclang. Everythingthat builds today is unaffected, since all of those platforms have gcc, macOS
included through its clang shim. Verified: resolves to
gccunchanged on a hostthat has it,
ccwhen gcc is absent,clangwhen neither is present.Also trims the comment blocks #1373 left in
ci.ymldown to the facts thatcannot 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.abuilt,Building Test Suite (FreeBSD), 229/229 unit tests passed. At that pricethere 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 dropsfrom 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_dispatchrun on this branch (the nativejob was still PR-gated at that point, and dispatch runs it):
both
FreeBSD / cross-compile (x86_64)andFreeBSD / native build + unit testspassed. This PR's own checks now exercise the native job directly.