Skip to content

library-selection cache ignores reached headers; --clean does not invalidate it #1607

Description

@zackees

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)

  1. FastLED rp2350 project: lib/FastLED/platforms/arm/rp/ble_rp.cpp.hpp includes <BTstackLib.h>, so BTstackLib is selected.
  2. Remove that include from the lib copy, then run fbuild build <proj> -e rp2350 --clean.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions