Skip to content

chore(build-engine): build test fixtures from the canonical path segments - #1394

Merged
zackees merged 1 commit into
mainfrom
chore/1349-ratchet-batch6
Aug 24, 2026
Merged

chore(build-engine): build test fixtures from the canonical path segments#1394
zackees merged 1 commit into
mainfrom
chore/1349-ratchet-batch6

Conversation

@zackees

@zackees zackees commented Aug 24, 2026

Copy link
Copy Markdown
Member

Sixth ratchet batch for #1349. Allowlist 20 → 15, and fbuild-build-engine
is clear.

Six files of test fixtures that spelled <project>/.fbuild/build/... by hand —
build_info, both compile-database suites, compiler_tests, linker, and
compiler — now assemble their paths from FBUILD_DIR_NAME /
BUILD_DIR_NAME.

Why fixtures are worth ratcheting

It is easy to read these as cosmetic. They are not, and the reason is specific:

A hand-spelled fixture keeps passing after the layout changes. It asserts
against the shape the test author typed, not the shape the code produces. So
the suite goes on reporting green while describing a directory nothing writes
to — the same drift as the production sites, minus the symptom that would tell
you.

That is not hypothetical in this crate. compile_cwd_from_output walks for the
.fbuild component, and #1392 just routed that walk through the const. If the
const changed and these fixtures did not, every one of them would still pass
while testing a layout the walker no longer recognizes.

Found by the lint, not by reading

compiler_tests.rs had four more sites than my first pass surfaced — the
framework cache root and three toolchain/include paths under
~/.fbuild/packages/. My initial grep | head -5 had truncated them. The lint
listed all of them; that is the argument for removing allowlist entries and
letting the tool enumerate, rather than grepping and trusting the result.

Verification

Remaining

15 entries: fbuild-build 12, plus the 3 sanctioned sites
(fbuild-paths/lib.rs, fbuild-core/path.rs, fbuild-cli/args.rs). One crate
left.

…ents

Sixth ratchet batch for #1349. Allowlist 20 -> 15, and
`fbuild-build-engine` is clear.

Six files of test fixtures that spelled `<project>/.fbuild/build/...` by
hand: `build_info`, the two compile-database suites, `compiler_tests`,
`linker`, and `compiler`. Each now assembles its paths from
`FBUILD_DIR_NAME` / `BUILD_DIR_NAME`.

Fixtures are worth ratcheting for a reason that is easy to miss: a hand-spelled
fixture keeps passing after the layout changes. It asserts against the shape
the test author typed, not the shape the code produces, so the suite goes on
reporting green while describing a directory nothing writes to. That is the
same failure the production sites have, minus the symptom.

`compiler_tests` had more sites than the first pass surfaced — the framework
cache root and three toolchain/include paths under `~/.fbuild/packages/` — all
found by the lint rather than by reading.

Lint crate 0.1.5 -> 0.1.6, checked against the version this branch starts from
rather than against main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 11 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ef2b76b-72cf-48f6-9863-4140372344fd

📥 Commits

Reviewing files that changed from the base of the PR and between cf5a3fe and d7bb2a3.

📒 Files selected for processing (7)
  • crates/fbuild-build-engine/src/build_info.rs
  • crates/fbuild-build-engine/src/compile_database/tests/clang.rs
  • crates/fbuild-build-engine/src/compile_database/tests/generate.rs
  • crates/fbuild-build-engine/src/compiler_tests.rs
  • crates/fbuild-build-engine/src/linker.rs
  • dylints/ban_raw_fbuild_path/Cargo.toml
  • dylints/ban_raw_fbuild_path/src/allowlist.txt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit 675a477 into main Aug 24, 2026
98 checks passed
@zackees
zackees deleted the chore/1349-ratchet-batch6 branch August 24, 2026 00:50
zackees added a commit that referenced this pull request Aug 24, 2026
Review follow-up on #1349 batch 7.

Two call sites reached for `FBUILD_DIR_NAME` and then hardcoded `"build"` as
the next segment — half-migrated, and worse than either whole state: it reads
as done while still carrying the literal it was supposed to remove.

The lint cannot catch this. It bans `.fbuild`, and `"build"` is not that
string, so both sites passed a clean workspace sweep. The gap is between the
two consts, not in either one.

Fixed in `compile_many_two_stage.rs` (this branch) and in
`compiler_tests.rs`, which shipped with the same gap in #1394 — swept for the
pattern rather than fixing only the one that was reported.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
zackees added a commit that referenced this pull request Aug 24, 2026
…1395)

* chore(build): finish the `.fbuild` ratchet — baseline reaches zero

Seventh and final ratchet batch for #1349. Allowlist
15 -> 3, and all three that remain are sanctioned definition sites.

`fbuild-build`'s twelve files — `compile_many` plus eleven integration
suites — assembled `<root>/.fbuild/build/<env>/<profile>` by hand. They now
build it from `FBUILD_DIR_NAME` / `BUILD_DIR_NAME`.

Deliberately a literal substitution rather than a switch to
`BuildLayout::resolve()`, which would be the more principled fixture. These
are `#[ignore]`d toolchain-downloading suites that cannot run on this machine,
and `resolve()` also honours `FBUILD_BUILD_DIR` and collapses the `<env>`
segment. Changing what the fixtures compute, in tests I cannot execute, is not
a trade worth making for elegance. The literal is gone either way; moving them
onto the real resolver is a separate change that should be made by someone who
can run them.

## The baseline is closed

48 files spelled `.fbuild` by hand when the lint landed. All 48 now route
through `fbuild_paths`. What remains:

  crates/fbuild-paths/src/lib.rs    the source of truth
  crates/fbuild-core/src/path.rs    where the const is declared, because
                                    fbuild-paths depends on fbuild-core and
                                    not the reverse
  crates/fbuild-cli/src/cli/args.rs clap stringifies `///` help into literals
                                    attributed to the `#[derive]`, so no
                                    expression edit can clear it

Each carries its rationale inline. The baseline section is kept rather than
deleted so the next person to reach for it can see it was closed on purpose.

Lint crate 0.1.6 -> 0.1.7.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: use BUILD_DIR_NAME for the segment that follows FBUILD_DIR_NAME

Review follow-up on #1349 batch 7.

Two call sites reached for `FBUILD_DIR_NAME` and then hardcoded `"build"` as
the next segment — half-migrated, and worse than either whole state: it reads
as done while still carrying the literal it was supposed to remove.

The lint cannot catch this. It bans `.fbuild`, and `"build"` is not that
string, so both sites passed a clean workspace sweep. The gap is between the
two consts, not in either one.

Fixed in `compile_many_two_stage.rs` (this branch) and in
`compiler_tests.rs`, which shipped with the same gap in #1394 — swept for the
pattern rather than fixing only the one that was reported.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant