[M5+] cargoxx add evicts stale auto-discovered overlay rows

This commit is contained in:
2026-05-10 15:49:44 +00:00
parent 5f233b9fa9
commit 6e280becbe
3 changed files with 57 additions and 0 deletions

View File

@@ -104,6 +104,13 @@ auto overlay_set_libcxx_override(OverlayState& state, const std::string& package
const std::string& source, bool value)
-> cargoxx::util::Result<void>;
// Drops every overlay row for `package` whose source is not "manual".
// Used by `cargoxx add` to invalidate stale auto-discovered recipes
// when the resolver/scanner logic has changed under the user — they
// should never have to know `~/.cache/cargoxx/linkdb.sqlite` exists.
auto overlay_evict_auto(OverlayState& state, const std::string& package)
-> cargoxx::util::Result<void>;
auto overlay_query(OverlayState& state, const std::string& package)
-> cargoxx::util::Result<std::vector<OverlayRow>>;
@@ -144,6 +151,12 @@ class Database {
const std::string& source, bool value)
-> util::Result<void>;
// Evict every non-manual overlay row for `package`. Called by
// `cargoxx add` so users never have to manually drop stale
// auto-discovered recipes when cargoxx's resolver/scanner logic
// changes.
auto evict_auto_recipes(const std::string& package) -> util::Result<void>;
private:
Database() = default;
std::map<std::string, std::vector<detail::CuratedRecipe>> curated_;