Skip to content

fix(buildfs): refuse data/ declarations that collide after pointer projection - #2105

Merged
zackees merged 1 commit into
mainfrom
agent/buildfs-pointer-collision
Nov 20, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/buildfs-pointer-collision

Conversation

@zackees

@zackees zackees commented Nov 19, 2026

Copy link
Copy Markdown
Member

What

fbuild buildfs stages data/ into a filesystem image and resolves fbuild blob
pointers (.fetch, and JSON .lnk) at their projected name — data/video1.rgb.fetch
ships as video1.rgb. Nothing checked that projection, so two declarations could
land on the same slot in the image and the last one staged silently won:

  • a committed data/video1.rgb plus data/video1.rgb.fetch — the blob replaced the
    committed binary (or not, depending on walk order);
  • data/video1.rgb.fetch plus data/video1.rgb.lnk — one pointer overwrote the other.

Both build "successfully" and produce an image whose content depends on directory
iteration order. This is the "two declarations naming the same file with conflicting
targets" error case from #1356, and it is silently wrong today.

Fix

ensure_unique_projections(&entries) runs inside stage_data immediately after the
tree is walked and before anything is fetched, so a colliding tree fails without
touching the network or the disk cache:

video1.rgb and video1.rgb.fetch both land on video1.rgb in the image: a blob pointer
is staged at its blob's name, so one would silently overwrite the other. Remove one
declaration, or rename the blob it points at.

FastLED's plain-text runtime .lnk asset links are not fbuild pointers — they ship
as data under their own name — so track.mp3.lnk next to a committed track.mp3 keeps
working unchanged (guarded by a test).

Tests

soldr cargo test -p fbuild-cli --bin fbuild buildfs -> 43 passed; 0 failed (4 new):

  • committed_file_and_pointer_with_the_same_projected_name_is_an_error
  • two_pointers_projecting_to_the_same_blob_name_is_an_error
  • distinct_pointers_and_runtime_lnk_links_stage_without_collision (no false positives)
  • stage_data_refuses_a_projection_collision_before_fetching — goes through stage_data,
    so deleting the call fails the test (verified: it fails with the call commented out)

Gates: soldr cargo clippy -p fbuild-cli --all-targets --no-deps -- -D warnings exit 0,
cargo fmt --check clean, ci/enforce_platform_boundary.py --print-totals -> 44/43,
buildfs.rs 974 LOC (< 1000 gate).

#1356 stays open: the destination vocabulary (dest on .fetch), the end-of-build
"fetched but unconsumed" warning, and the platform capability matrix still need their
own rulings.

…ojection

A blob pointer is staged at its blob's name, so a committed data/<blob> and a
data/<blob>.fetch (or two pointers naming one blob) silently overwrote each
other and the image depended on walk order. Reject the collision before
anything is fetched (#1356).
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@zackees
zackees added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 74e1639 Nov 20, 2026
32 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 20, 2026
@zackees
zackees deleted the agent/buildfs-pointer-collision branch November 24, 2026 21:36
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