[M5+] verify_link retries with libc++ stdenv override on link failure

This commit is contained in:
2026-05-10 15:16:47 +00:00
parent 5e691ac37b
commit 3c77431658
5 changed files with 161 additions and 14 deletions

View File

@@ -14,6 +14,12 @@ struct Recipe {
std::string find_package; // post-substitution
std::vector<std::string> targets; // post-substitution
std::string source; // 'curated' | 'manual' | etc.
// Set when the dep needs `.override { stdenv = llvmPkgs.libcxxStdenv; }`
// to link against the user's libc++-built project (e.g. nixpkgs ships
// it built against libstdc++ — abseil-cpp, llvm). verify_link toggles
// this on after a libstdc++/libc++ link failure. Codegen wraps the
// buildInputs entry in the override expression when true.
bool requires_libcxx_override = false;
bool operator==(const Recipe&) const = default;
};
@@ -37,6 +43,7 @@ struct OverlayRow {
std::vector<std::string> targets;
std::string source;
std::int64_t verified_at = 0;
bool requires_libcxx_override = false;
};
// RAII wrapper for an open sqlite3 connection used by the overlay database.
@@ -90,6 +97,13 @@ auto overlay_delete_recipe(OverlayState& state, const std::string& package,
const std::string& source)
-> cargoxx::util::Result<void>;
// Toggle the libcxx-override flag for an existing row. Used by
// `verify_link` after a libstdc++/libc++ link mismatch.
auto overlay_set_libcxx_override(OverlayState& state, const std::string& package,
const std::string& version_range,
const std::string& source, bool value)
-> cargoxx::util::Result<void>;
auto overlay_query(OverlayState& state, const std::string& package)
-> cargoxx::util::Result<std::vector<OverlayRow>>;
@@ -125,6 +139,11 @@ class Database {
const std::string& version_range,
const std::string& source) -> util::Result<void>;
auto set_libcxx_override(const std::string& package,
const std::string& version_range,
const std::string& source, bool value)
-> util::Result<void>;
private:
Database() = default;
std::map<std::string, std::vector<detail::CuratedRecipe>> curated_;