Skip to content

fix(include-farm): keep dirs whose top-level headers climb out via .. - #1581

Merged
zackees merged 3 commits into
mainfrom
fix/include-farm-root-relative
Sep 29, 2026
Merged

zackees merged 3 commits into
mainfrom
fix/include-farm-root-relative

Conversation

@zackees

@zackees zackees commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

esp_bt.h (IDF bt/include/esp32/include) does
#include "../../../controller/esp32/esp_bredr_cfg.h". Linked at the farm
root, the .. escaped the farm and esp32dev failed on esp32-hal-bt.c.

The conflict check built "/" + name for top-level headers, making the
include absolute so the escape was never compared, and its fallback chain
still searched the farmed dir itself. Use the bare name at the root and
compare against the post-farm -I chain. Farm format v3 rebuilds caches.

Regression from #1550.

Summary by CodeRabbit

  • Bug Fixes
    • Improved quoted-include conflict checks to account for the order of directories searched around an include farm.
    • Corrected handling of top-level headers and relative paths that climb out of a header’s directory, so these paths are checked using the expected include lookup rules.

esp_bt.h (IDF bt/include/esp32/include) does
#include "../../../controller/esp32/esp_bredr_cfg.h". Linked at the farm
root, the .. escaped the farm and esp32dev failed on esp32-hal-bt.c.

The conflict check built "/" + name for top-level headers, making the
include absolute so the escape was never compared, and its fallback chain
still searched the farmed dir itself. Use the bare name at the root and
compare against the post-farm -I chain. Farm format v3 rebuilds caches.

Regression from #1550.
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

Next included review available in 49 minutes.

Check out review usage here.

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: Repository: FastLED/fbuild/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f1edc328-65ac-45c4-809a-018541738ecb

📥 Commits

Reviewing files that changed from the base of the PR and between 0e731f6 and 1cdc832.

📒 Files selected for processing (2)
  • crates/fbuild-build-engine/src/include_farm.rs
  • crates/fbuild-build-engine/src/include_farm_tests.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: FastLED/fbuild/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d7650f8b-fa71-44f7-9e11-53b603bc2c93

📥 Commits

Reviewing files that changed from the base of the PR and between f4528f0 and 0e731f6.

📒 Files selected for processing (2)
  • crates/fbuild-build-engine/src/include_farm.rs
  • crates/fbuild-build-engine/src/include_farm_tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The include-farm format version increases to 3. Quoted-include conflict checks now use the post-farm search chain, and a test covers a top-level header whose relative include path climbs out of its directory.

Changes

Include-farm lookup

Layer / File(s) Summary
Farm lookup and conflict checks
crates/fbuild-build-engine/src/include_farm.rs, crates/fbuild-build-engine/src/include_farm_tests.rs
The format version changes to 3. Conflict checks compare original lookup results with results from a chain that searches preceding directories, the farm, and unfarmed block directories. A test checks that a top-level header retains its directory when its relative include path climbs out of it.

Priority: ➖ Normal

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0e731

The include-farm change is mergeable after normal checks; no actionable risk remains identified.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 0e731

The change affects which existing SDK include directories remain in the compiler search path and rebuilds incompatible caches. No new external entry point or expanded build authority was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — Effective exposure is the header search for builds using the SDK include block: the changed planner may keep original SDK directories separate rather than merge them, without establishing a new privilege or external entry point.

Trust Boundaries and Controls

  • observed — Header-supplied quoted include names are compared across the original and farmed lookup paths before a directory is farmed. Cache reuse requires the current version and matching preceding and block paths.

Resilience and Maintainability Implications

  • observed — On farm-planning failure or a changed SDK-block position, compilation retains the original include-directory list rather than consuming a mismatched farm replacement.
🚥 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: preserving directories when top-level headers traverse outside the include-farm root through relative .. paths.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files.
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
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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 8128aa0 into main Sep 29, 2026
22 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 30, 2026
@zackees
zackees deleted the fix/include-farm-root-relative branch October 16, 2026 11:20
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