[M5+] cargoxx add evicts stale auto-discovered overlay rows
This commit is contained in:
@@ -139,6 +139,20 @@ auto cmd_add(const fs::path& project_root, const std::string& name,
|
||||
|
||||
const auto effective_overlay = overlay_path.value_or(linkdb::default_overlay_path());
|
||||
|
||||
// Drop any auto-discovered overlay rows for this package before
|
||||
// resolving — they may have been written by an older cargoxx whose
|
||||
// scanner produced a different recipe (e.g. picked the wrong
|
||||
// CMake config in a multi-config tree). Manual recipes survive.
|
||||
{
|
||||
auto db = linkdb::Database::open(effective_overlay);
|
||||
if (!db) {
|
||||
return std::unexpected(db.error());
|
||||
}
|
||||
if (auto r = db->evict_auto_recipes(name); !r) {
|
||||
return std::unexpected(r.error());
|
||||
}
|
||||
}
|
||||
|
||||
auto known = recipe_already_known(name, effective_version, components,
|
||||
effective_overlay);
|
||||
if (!known) {
|
||||
|
||||
Reference in New Issue
Block a user