[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

@@ -115,4 +115,25 @@ struct VerifyLinkRequest {
auto verify_link(const VerifyLinkRequest& req, const BuildFn& build_fn)
-> util::Result<void>;
// What discover() returns: the verified Recipe and a tag identifying
// which probe yielded it ("conan", "vcpkg", or "nix-probe").
struct Discovered {
linkdb::Recipe recipe;
std::string source;
};
// Walks the full auto-resolution chain for a package not present in the
// curated linkdb or the user's overlay:
// 1. nixpkgs_probe(name) — confirms the attribute exists, captures
// version + out_path
// 2. for each of conan_probe, vcpkg_probe, nix_cmake_scan(out_path,…):
// build a candidate linkdb::Recipe, run verify_link on it, return
// on first success
// 3. all candidates failed → ResolutionUnsatisfiable
auto discover(const std::string& name, const std::string& version_spec,
const std::vector<std::string>& components,
const std::filesystem::path& overlay_path,
const std::filesystem::path& scratch_root, const BuildFn& build_fn)
-> util::Result<Discovered>;
} // namespace cargoxx::resolver