[M5+] wire resolver::discover into cargoxx add

This commit is contained in:
2026-05-10 10:54:55 +00:00
parent 816ec993cd
commit afe1856e11
10 changed files with 269 additions and 17 deletions

View File

@@ -78,6 +78,21 @@ All notable changes to cargoxx will be documented in this file.
and `[build]` honoring `warnings_as_errors` and `sanitizers`. Source
paths emitted relative to `build/` (i.e. prefixed with `../`).
Output is deterministic. `tests/codegen_cmake.cpp` covers 11 cases.
- `cargoxx add <pkg>` now auto-resolves packages outside the curated
linkdb. On `LinkdbUnknownPackage`, `cmd_add` invokes
`resolver::discover` which: probes `nixpkgs#<pkg>` to confirm the
attribute exists and capture its store path; tries Conan, vcpkg, and
the nix-store CMake scan in order; for each candidate runs a real
`cargoxx build` against an empty `int main() {}` project via
`verify_link`; on first success persists a confirmed overlay row.
Subsequent `cargoxx add <pkg>` for the same package is an
overlay-cache hit (~ms). End-to-end live: a fresh `cargoxx add
simdjson` (not in our curated db) takes ~11 s including the verifying
nix+cmake build, then 0.002 s on the second invocation.
`linkdb::default_overlay_path()` is now exported as a public helper
so the resolver and CLI agree on the overlay file when no path is
explicitly passed. Tests opt out of the slow chain via
`CARGOXX_NO_AUTORESOLVE=1`.
- `cargoxx.linkdb::Database::insert_provisional`,
`confirm_provisional`, and `abort_provisional` — three-step lifecycle
for non-`manual` overlay rows: insert with `verified_at = 0`, run a