Skip to content

build: derive TEST_BINS from the build rules, not the .c files (corrects #731) - #733

Merged
JustVugg merged 1 commit into
devfrom
build/test-bins-from-rules
Jul 31, 2026
Merged

build: derive TEST_BINS from the build rules, not the .c files (corrects #731)#733
JustVugg merged 1 commit into
devfrom
build/test-bins-from-rules

Conversation

@JustVugg

Copy link
Copy Markdown
Owner

Correction to #731, found by merging dev into a real contributor branch rather than by reasoning about it.

What #731 got wrong

#731 replaced the hand-written TEST_BINS line with a glob of tests/test_*.c. That was wrong in the opposite direction from the list it replaced: it promotes any test_*.c file into a gate, including ones that deliberately have no build rule.

On dev the four such files were known and excluded by name, so the resulting set was identical and the mistake was invisible. On a contributor branch it is not. Merging dev into #529 promoted that branch's tests/test_fp8_e2e_loader.c — a file @monotophic has but never gated — and the build failed:

test_fp8_e2e_loader.c:(.text+0x4c5cd): undefined reference to `sqrtf'
collect2: error: ld returned 1 exit status

Every future branch carrying an un-wired test would have hit the same thing at merge time.

The fix

Having a build rule is the honest definition of a gate, so derive the list from the rules instead of from the files. TEST_EXCLUDE drops from five entries to one — test_uring, which has a rule but is Linux-only and is appended conditionally just below.

The property that motivated all of this is unchanged and now stronger: adding a gate means adding your .c and its own rule, which land in different places in the file. There is no shared list left to conflict on at all.

Verification

One file, build system only.

Corrects #731, which globbed tests/test_*.c. That was wrong in the opposite
direction from the hand-written list it replaced: it promoted files that
deliberately have no build rule into gates. On dev the four such files were
known and excluded by name, so the set came out identical and the mistake was
invisible; on a contributor branch it is not. Merging dev into #529 promoted
that branch's tests/test_fp8_e2e_loader.c -- a file monotophic has but never
gated -- and the build failed on an undefined reference to sqrtf.

Having a build rule is the honest definition of a gate, so derive the list from
the rules. TEST_EXCLUDE drops from five entries to one: test_uring, which has a
rule but is Linux-only and is appended conditionally just below.

The property that motivated all of this is unchanged and now stronger: adding a
gate means adding your .c and its own rule, which land in different places in
the file. There is no shared list left to conflict on at all.

Verified identical to current dev (31 entries, same names) and make test-c green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JustVugg
JustVugg merged commit ca3d1db into dev Jul 31, 2026
10 checks passed
@JustVugg
JustVugg deleted the build/test-bins-from-rules branch July 31, 2026 22:05
JustVugg added a commit to monotophic/colibri that referenced this pull request Jul 31, 2026
Resolved by a maintainer instead of asking for another rebase. The only
conflicting hunk was the hand-written TEST_BINS line, which dev no longer has:
gates are derived from the build rules, so this branch's tests are picked up by
their own rules and the manual list entry is dropped. No other file conflicted
and no commit on this branch was rewritten.

Verified before pushing: every test this branch adds a rule for is in the gate
set, and make test-c passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JustVugg added a commit to terrizoaguimor/colibri that referenced this pull request Jul 31, 2026
Resolved by a maintainer instead of asking for another rebase. The only
conflicting hunk was the hand-written TEST_BINS line, which dev no longer has:
gates are derived from the build rules, so this branch's tests are picked up by
their own rules and the manual list entry is dropped. No other file conflicted
and no commit on this branch was rewritten.

Verified before pushing: every test this branch adds a rule for is in the gate
set, and make test-c passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JustVugg added a commit to monotophic/colibri that referenced this pull request Jul 31, 2026
Resolved by a maintainer instead of asking for another rebase. The only
conflicting hunk was the hand-written TEST_BINS line, which dev no longer has:
gates are derived from the build rules, so this branch's tests are picked up by
their own rules and the manual list entry is dropped. No other file conflicted
and no commit on this branch was rewritten.

Verified before pushing: every test this branch adds a rule for is in the gate
set, and make test-c passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JustVugg added a commit to terrizoaguimor/colibri that referenced this pull request Jul 31, 2026
Resolved by a maintainer instead of asking for another rebase. The only
conflicting hunk was the hand-written TEST_BINS line, which dev no longer has:
gates are derived from the build rules, so this branch's tests are picked up by
their own rules and the manual list entry is dropped. No other file conflicted
and no commit on this branch was rewritten.

Verified before pushing: every test this branch adds a rule for is in the gate
set, and make test-c passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JustVugg added a commit to jeswr/colibri that referenced this pull request Jul 31, 2026
…l.h in the colibri rule

Two conflicting hunks, resolved by a maintainer rather than asking for a rebase.

TEST_BINS: dev no longer has a hand-written list, so this branch's entry is
dropped and its test is picked up by its own rule.

The colibri$(EXE) rule: both sides were right. This branch adds abl.h to the
prerequisites; dev added $(VK_OBJ)/$(VK_SPV) and the Vulkan backend rules.
Merged rather than picked -- dev's line with abl.h reinstated -- so the ablation
harness still rebuilds when its header changes and the Vulkan build keeps working.

make test-c passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JustVugg added a commit to monotophic/colibri that referenced this pull request Jul 31, 2026
Resolved by a maintainer instead of asking for another rebase. The only
conflicting hunk was the hand-written TEST_BINS line, which dev no longer has:
gates are derived from the build rules, so this branch's tests are picked up by
their own rules and the manual list entry is dropped. No other file conflicted
and no commit on this branch was rewritten.

Verified before pushing: every test this branch adds a rule for is in the gate
set, and make test-c passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JustVugg added a commit to jeswr/colibri that referenced this pull request Jul 31, 2026
Resolved by a maintainer instead of asking for another rebase. The only
conflicting hunk was the hand-written TEST_BINS line, which dev no longer has:
gates are derived from the build rules, so this branch's tests are picked up by
their own rules and the manual list entry is dropped. No other file conflicted
and no commit on this branch was rewritten.

Verified before pushing: every test this branch adds a rule for is in the gate
set, and make test-c passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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