mamba::solver
#
The mamba::solver
namespace contains the packages solver and related objects.
This particular namespace is a generic common interface, while the subnamespace
mamba::solver::libsolv
contains LibSolv
specific implementations.
-
namespace solver#
Functions
-
template<typename T>
auto operator==(const conflict_map<T> &lhs, const conflict_map<T> &rhs) -> bool#
-
template<typename T>
auto operator!=(const conflict_map<T> &lhs, const conflict_map<T> &rhs) -> bool#
-
auto simplify_conflicts(const ProblemsGraph &pbs) -> ProblemsGraph#
Hand-crafted hurisitics to simplify conflicts in messy situations.
-
auto print_problem_tree_msg(std::ostream &out, const CompressedProblemsGraph &pbs, const ProblemsMessageFormat &format = {}) -> std::ostream&#
-
auto problem_tree_msg(const CompressedProblemsGraph &pbs, const ProblemsMessageFormat &format = {}) -> std::string#
-
template<typename Iter, typename UnaryFunc>
void for_each_to_remove(Iter first, Iter last, UnaryFunc &&func)#
-
template<typename Range, typename UnaryFunc>
void for_each_to_remove(Range &&actions, UnaryFunc &&func)#
-
template<typename Iter, typename UnaryFunc>
void for_each_to_install(Iter first, Iter last, UnaryFunc &&func)#
-
template<typename Range, typename UnaryFunc>
void for_each_to_install(Range &&actions, UnaryFunc &&func)#
-
class CompressedProblemsGraph#
Public Types
-
using RootNode = ProblemsGraph::RootNode#
-
using PackageListNode = NamedList<ProblemsGraph::PackageNode>#
-
using UnresolvedDependencyListNode = NamedList<ProblemsGraph::UnresolvedDependencyNode>#
-
using ConstraintListNode = NamedList<ProblemsGraph::ConstraintNode>#
-
using node_t = std::variant<RootNode, PackageListNode, UnresolvedDependencyListNode, ConstraintListNode>#
-
using conflicts_t = conflict_map<node_id>#
-
using merge_criteria_t = std::function<bool(const ProblemsGraph&, ProblemsGraph::node_id, ProblemsGraph::node_id)>#
Public Functions
-
CompressedProblemsGraph(graph_t graph, conflicts_t conflicts, node_id root_node)#
-
auto conflicts() const noexcept -> const conflicts_t&#
Public Static Functions
-
static auto from_problems_graph(const ProblemsGraph &pbs, const merge_criteria_t &merge_criteria = {}) -> CompressedProblemsGraph#
-
template<typename T, typename Allocator = std::allocator<T>>
class NamedList : private mamba::util::flat_set<T, RoughCompare<T>, std::allocator<T>># A list of objects with a name, version, and build member.
For simplicity, the implementation is kept in the translation unit with specialization for needed types.
Public Types
-
using Base = util::flat_set<T, RoughCompare<T>, Allocator>#
Public Functions
-
NamedList() = default#
-
template<typename InputIterator>
NamedList(InputIterator first, InputIterator last)#
-
auto front() const noexcept -> const value_type&#
-
auto back() const noexcept -> const value_type&#
-
auto begin() const noexcept -> const_iterator#
-
auto end() const noexcept -> const_iterator#
-
auto rbegin() const noexcept -> const_reverse_iterator#
-
auto rend() const noexcept -> const_reverse_iterator#
-
auto name() const -> const std::string&#
-
auto versions_trunc(std::string_view sep = "|", std::string_view etc = "...", std::size_t threshold = 5, bool remove_duplicates = true) const -> std::pair<std::string, std::size_t>#
-
auto build_strings_trunc(std::string_view sep = "|", std::string_view etc = "...", std::size_t threshold = 5, bool remove_duplicates = true) const -> std::pair<std::string, std::size_t>#
-
auto versions_and_build_strings_trunc(std::string_view sep = "|", std::string_view etc = "...", std::size_t threshold = 5, bool remove_duplicates = true) const -> std::pair<std::string, std::size_t>#
-
void insert(const value_type &e)#
-
void insert(value_type &&e)#
-
template<typename InputIterator>
void insert(InputIterator first, InputIterator last)#
-
using Base = util::flat_set<T, RoughCompare<T>, Allocator>#
-
template<typename T>
struct RoughCompare# A rough comparison for nodes.
We need to be able to compare nodes for using them in a set but we do not have proper version parsing. Ideally we would like proper comparison for printing packages in order.
As with
NamedList
below, the implementation is currently kept private for needed types.
-
using RootNode = ProblemsGraph::RootNode#
-
template<typename T>
class conflict_map : private std::unordered_map<T, util::flat_set<T>># -
Public Functions
-
conflict_map() = default#
-
auto has_conflict(const key_type &a) const -> bool#
-
auto in_conflict(const key_type &a, const key_type &b) const -> bool#
-
auto begin() const noexcept -> const_iterator#
-
auto end() const noexcept -> const_iterator#
-
auto add(const key_type &a, const key_type &b) -> bool#
-
auto remove(const key_type &a, const key_type &b) -> bool#
-
auto remove(const key_type &a) -> bool#
-
conflict_map() = default#
-
class ProblemsGraph#
A directed graph of the packages involved in a libsolv conflict.
Public Types
-
using node_t = std::variant<RootNode, PackageNode, UnresolvedDependencyNode, ConstraintNode>#
-
using conflicts_t = conflict_map<node_id>#
Public Functions
-
ProblemsGraph(graph_t graph, conflicts_t conflicts, node_id root_node)#
-
auto conflicts() const noexcept -> const conflicts_t&#
-
struct PackageNode : public mamba::specs::PackageInfo#
-
struct RootNode#
-
using node_t = std::variant<RootNode, PackageNode, UnresolvedDependencyNode, ConstraintNode>#
-
struct ProblemsMessageFormat#
Formatting options for error message functions.
-
struct Request#
Public Types
-
struct Flags#
Public Members
-
bool force_reinstall = false#
Force reinstallation of jobs.
-
bool allow_downgrade = true#
Allow downgrading packages to satisfy requirements.
-
bool allow_uninstall = true#
Allow uninstalling packages to satisfy requirements.
-
bool strict_repo_priority = true#
Prefer packages by repoitory order.
-
bool order_request = true#
Order the request to get a deterministic solution.
-
bool force_reinstall = false#
-
struct Freeze#
Instruct to freeze the version and status of the matching installed package.
-
struct Install#
Instruct to install a package matching the given spec.
-
struct Keep#
Instruct to keep packages matching the spec during dependency clean.
-
struct Pin#
Add a constraints on packages possible to install.
-
struct Remove#
Instruct to remove packages matching the given spec.
-
struct Update#
Instruct to update packages matching the given spec.
-
struct Flags#
-
struct Solution#
Public Types
Public Members
-
action_list actions = {}#
Public Static Attributes
-
struct Change#
-
struct Downgrade#
-
struct Install#
Public Members
-
specs::PackageInfo install#
-
specs::PackageInfo install#
-
struct Omit#
Public Members
-
specs::PackageInfo what#
-
specs::PackageInfo what#
-
struct Reinstall#
Public Members
-
specs::PackageInfo what#
-
specs::PackageInfo what#
-
struct Remove#
Public Members
-
specs::PackageInfo remove#
-
specs::PackageInfo remove#
-
struct Upgrade#
-
action_list actions = {}#
-
namespace libsolv#
Enums
Functions
-
auto operator==(const Priorities &lhs, const Priorities &rhs) -> bool#
-
auto operator!=(const Priorities &lhs, const Priorities &rhs) -> bool#
-
auto operator==(const RepodataOrigin &lhs, const RepodataOrigin &rhs) -> bool#
-
auto operator!=(const RepodataOrigin &lhs, const RepodataOrigin &rhs) -> bool#
-
void to_json(nlohmann::json &j, const RepodataOrigin &m)#
-
void from_json(const nlohmann::json &j, RepodataOrigin &p)#
-
class Database#
Database of solvable involved in resolving en environment.
The database contains the solvable (packages) information required from the Solver. The database can be reused by multiple solvers to solve differents requirements with the same ecosystem.
Public Functions
-
explicit Database(specs::ChannelResolveParams channel_params)#
-
~Database()#
-
auto channel_params() const -> const specs::ChannelResolveParams&#
-
void set_logger(logger_type callback)#
-
auto add_repo_from_repodata_json(const fs::u8path &path, std::string_view url, const std::string &channel_id, PipAsPythonDependency add = PipAsPythonDependency::No, PackageTypes package_types = PackageTypes::CondaOrElseTarBz2, VerifyPackages verify_packages = VerifyPackages::No, RepodataParser parser = RepodataParser::Mamba) -> expected_t<RepoInfo>#
-
auto add_repo_from_native_serialization(const fs::u8path &path, const RepodataOrigin &expected, const std::string &channel_id, PipAsPythonDependency add = PipAsPythonDependency::No) -> expected_t<RepoInfo>#
-
template<typename Iter>
auto add_repo_from_packages(Iter first_package, Iter last_package, std::string_view name = "", PipAsPythonDependency add = PipAsPythonDependency::No) -> RepoInfo#
-
template<typename Range>
auto add_repo_from_packages(const Range &packages, std::string_view name = "", PipAsPythonDependency add = PipAsPythonDependency::No) -> RepoInfo#
-
auto native_serialize_repo(const RepoInfo &repo, const fs::u8path &path, const RepodataOrigin &metadata) -> expected_t<RepoInfo>#
-
void set_repo_priority(RepoInfo repo, Priorities priorities)#
-
auto repo_count() const -> std::size_t#
-
auto package_count() const -> std::size_t#
-
class Impl#
An access control wrapper.
This struct is to control who can access the underlying private representation of the ObjPool without giving them full friend access.
-
explicit Database(specs::ChannelResolveParams channel_params)#
-
struct RepodataOrigin#
Metadata serialized with a repository index.
This is used to identify if the binary serialization is out of date with the expected index.
-
class RepoInfo#
A libsolv repository descriptor.
In libsolv, most of the data is help in the Database, and repo are tightly coupled with them. This repository class is a lightwight description of a repository returned when creating a new repository in the Database. Some modifications to the repo are possible throught the Database.
See also
Database::add_repo_from_repodata_json
See also
Database::add_repo_from_packages
See also
Database::remove_repo
Public Types
-
using RepoId = int#
Public Functions
-
auto name() const -> std::string_view#
-
auto package_count() const -> std::size_t#
-
auto priority() const -> Priorities#
-
using RepoId = int#
-
class Solver#
Public Types
-
using Outcome = std::variant<Solution, UnSolvable>#
-
using Outcome = std::variant<Solution, UnSolvable>#
-
class UnSolvable#
Public Functions
-
UnSolvable(UnSolvable&&)#
-
~UnSolvable()#
-
auto operator=(UnSolvable&&) -> UnSolvable&#
-
auto problems_graph(const Database &pool) const -> ProblemsGraph#
-
auto explain_problems_to(Database &pool, std::ostream &out, const ProblemsMessageFormat &format) const -> std::ostream&#
-
auto explain_problems(Database &pool, const ProblemsMessageFormat &format) const -> std::string#
-
UnSolvable(UnSolvable&&)#
-
auto operator==(const Priorities &lhs, const Priorities &rhs) -> bool#
-
template<typename T>