Repository navigation
fix(build-engine): keep on-disk spelling when re-rooting a compile database (#2048) - #2051
Merged
Merged
Conversation
…tabase relative_spelling built the emitted path out of the case-folded comparison keys, so on macOS/Windows `FreeRTOS-Kernel/tasks.c` was written `freertos-kernel/tasks.c` — a path that does not resolve on a case-sensitive volume. Key components now decide only how much of the two paths is shared; the emitted tail comes from the original components. Fixes #2048.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 17, 2026
zackees
added a commit
that referenced
this pull request
Nov 18, 2026
Brings #2051 (reroot relative spelling), #2057 (rp2040 large future), #2058 (respell has_root / native tool spelling / renesas OnceCell), #2059 (bench framework + tracing feature) and #2063/#2067. Only conflict was fbuild-toolchain esp32.rs test fixture, resolved to main's #2058 native-spelling semantics (explicit native_name let-binding).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
compile_database::merge::relative_spellingbuilt the emitted relative path outof
normalize_for_keycomponents. On a case-insensitive host that key iscase-folded, so the spelling inherited the fold:
full / macos / Testfailed on every branch with a currentmainmerged in(572 passed / 2 failed, #2048):
reroot_spells_sources_relative_to_the_projectplus
merge_adds_framework_entries_only_idf_compiled, whose delegated entrylookup is spelled the same way. A compile database is opened by tooling (IDE
indexers, replay), so a folded component names a file that does not exist on a
case-sensitive volume. Linux is green at the same commit, which is why only the
macOS cells caught it.
The fix
Two parallel component lists, on purpose:
comparison) decide how much of the two paths isshared — matching stays case-insensitive where the platform says so;
relative_spellingkeeps its signature and calls the newrelative_spelling_with(path, base, comparison), which takes the key functionas a parameter. That seam is what makes the macOS behaviour testable on Linux.
..count is unchanged (base_key.len() - common), and path normalization isdone by a small
path_componentshelper returning borrowedComponents ratherthan a
PathBuf, so no newstd::path::PathBufenters a path-linted file.Tests (real output)
Three new tests in
merge_tests.rs, and the fold is injected so CI on Linuxcovers the macOS path:
relative_spelling_keeps_the_on_disk_case_when_the_key_folds_itrelative_spelling_matches_case_insensitively_but_emits_the_source_spellingrelative_spelling_unchanged_when_the_key_does_not_fold(pins the..climband
.-collapsing behaviour of the un-folded case)RED with the old emission semantics (key components emitted verbatim):
GREEN after:
Gates:
cargo fmt --checkexit 0,clippy -p fbuild-build-engine --all-targets --no-depsexit 0 (the 6unfulfilled_lint_expectationswarnings are pre-existing on this crate),
ci/run_dylint.py --package fbuild-build-engineexit 0,ci/enforce_platform_boundary.py --print-totals=rows=44; dylint_rows=43.Scope
Behaviour only changes where the key and the spelling disagree — i.e. macOS and
Windows. Linux output is byte-identical. #2049 (windows-msvc
large_futures)is a separate defect and stays open.
Fixes #2048.