Skip to content

ci: fail board builds that leave stray files in the working tree - #1272

Merged
zackees merged 2 commits into
mainfrom
ci/stray-file-guard
Aug 7, 2026
Merged

ci: fail board builds that leave stray files in the working tree#1272
zackees merged 2 commits into
mainfrom
ci/stray-file-guard

Conversation

@zackees

@zackees zackees commented Aug 7, 2026

Copy link
Copy Markdown
Member

Follow-up to #1269/#1270, requested guard so this regression class is caught in CI.

What

Adds a step to template_build.yml (inherited by all ~60 rendered build-*.yml board workflows) that runs after the quick + release fbuild build steps and fails if git status --porcelain is non-empty.

Why

Linker helpers (collect2 / lto-wrapper) running in the fbuild daemon's inherited cwd have now twice dropped scratch files — a stray 0-byte file literally named -r — into the invocation directory (#1267 fixed teensy in #1268; #1269/#1270 fixed the remaining five ARM linkers). CI builds run from the repo root, which is exactly the cwd the stray landed in, so a clean-tree assertion after the build catches the whole class regardless of which platform regresses next.

Gitignored build output (.fbuild/, target/) is invisible to git status, so the check only fires on genuinely stray untracked/modified files.

Verification

  • ci/render_workflows.py drift check: clean (the template is referenced via workflow_call, no re-render needed; every rendered workflow already lists template_build.yml in its path filters, so all board builds run on this PR and exercise the new step).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of local library paths so symlink and file-based dependencies resolve consistently across platforms, including Windows network paths.
    • Updated path comparisons to reflect normalized source locations.
  • Chores

    • Builds now verify that quick and release build processes leave the working tree unchanged, reporting unexpected modified or untracked files as errors.

Linker helpers (collect2/lto-wrapper) running in the daemon's inherited
cwd twice dropped scratch files (a stray 0-byte `-r`) into the repo
root (#1267, #1269, FastLED/FastLED#3867). Every board build now asserts
`git status --porcelain` is empty after the quick + release builds so
the regression class is caught in CI instead of by users.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a6a947eb-7dcd-4779-88b2-98be2d6d2aef

📥 Commits

Reviewing files that changed from the base of the PR and between 1324d6c and 5b00c46.

📒 Files selected for processing (3)
  • .github/workflows/template_build.yml
  • crates/fbuild-library/src/library/library_manager.rs
  • crates/fbuild-library/src/library/library_spec.rs

📝 Walkthrough

Walkthrough

The changes normalize local library dependency paths and add a post-build check that requires quick and release builds to leave the working tree clean.

Changes

Local dependency path normalization

Layer / File(s) Summary
Normalized library paths
crates/fbuild-library/src/library/library_spec.rs, crates/fbuild-library/src/library/library_manager.rs
LibrarySpec.local_path and named symlink:// and file:// dependencies now use NormalizedPath. Tests compare normalized paths, including Windows paths and UNC prefixes.

Build working-tree validation

Layer / File(s) Summary
Post-build cleanliness check
.github/workflows/template_build.yml
The workflow runs git status --porcelain after builds. It reports changes and fails the job when the working tree is not clean.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • FastLED/fbuild#965: Related path normalization and UNC-prefix handling in fbuild_core::path.
  • FastLED/fbuild#1036: Related changes to reusable build workflow setup and validation steps.
  • FastLED/fbuild#1257: Related changes to LibrarySpec.local_path and local dependency path handling.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: CI fails board builds that leave stray files in the working tree.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/stray-file-guard

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.

…ctation

Two pre-existing failures from #1256/#1257/#1258 that turned main's
Dylint and Check macOS/Windows jobs red:

- library_spec.rs used std::path::PathBuf for local_path, which the
  ban_std_pathbuf dylint denies (the file is not allowlisted). Migrate
  to fbuild_core::path::NormalizedPath.
- test_named_relative_local_symlink_adds_include_dir compared raw
  tempfile paths against production's canonicalized output, failing on
  Windows (8.3 short names, RUNNER~1) and macOS (/var -> /private/var).
  Canonicalize the expectation the same way production does.

Co-Authored-By: Claude <noreply@anthropic.com>
@zackees
zackees merged commit 0014f03 into main Aug 7, 2026
92 checks passed
@zackees
zackees deleted the ci/stray-file-guard branch August 7, 2026 05:03
zackees added a commit that referenced this pull request Aug 7, 2026
Ships 0dd68b2 (teensy link cwd, #1268), 2976d86 (RP Bluetooth menu,
#1263), 1324d6c (ARM linkers link cwd, #1269/#1270), and 0014f03
(CI stray-file guard, #1272). Closes the release half of #1269.

Co-authored-by: Claude <noreply@anthropic.com>
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Aug 8, 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