Problem
The library-selection cache key covers .cpp contents and each library's main header, but not the project or local-library headers that the LDF scan reaches. Editing only a reached header (for example, removing an #include <X.h> from a .cpp.hpp pulled in by a unity .cpp) gives a cache hit under the same key, so the stale selection is reused.
fbuild build --clean does not clear ~/.fbuild/*/cache/library-selection, so even a clean build keeps the stale selection.
Repro (seen while diagnosing #1606)
- FastLED rp2350 project:
lib/FastLED/platforms/arm/rp/ble_rp.cpp.hpp includes <BTstackLib.h>, so BTstackLib is selected.
- Remove that include from the lib copy, then run
fbuild build <proj> -e rp2350 --clean.
- BTstackLib is still selected (daemon log:
selected framework library 'BTstackLib'). After moving ~/.fbuild/prod/cache/library-selection aside, the same build drops it.
Expected
The selection cache key should include every file the scan reads, or --clean should invalidate it.
Problem
The library-selection cache key covers
.cppcontents and each library's main header, but not the project or local-library headers that the LDF scan reaches. Editing only a reached header (for example, removing an#include <X.h>from a.cpp.hpppulled in by a unity.cpp) gives a cache hit under the same key, so the stale selection is reused.fbuild build --cleandoes not clear~/.fbuild/*/cache/library-selection, so even a clean build keeps the stale selection.Repro (seen while diagnosing #1606)
lib/FastLED/platforms/arm/rp/ble_rp.cpp.hppincludes<BTstackLib.h>, so BTstackLib is selected.fbuild build <proj> -e rp2350 --clean.selected framework library 'BTstackLib'). After moving~/.fbuild/prod/cache/library-selectionaside, the same build drops it.Expected
The selection cache key should include every file the scan reads, or
--cleanshould invalidate it.