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>
bool operator==(const conflict_map<T> &lhs, const conflict_map<T> &rhs)#
-
template<typename T>
bool operator!=(const conflict_map<T> &lhs, const conflict_map<T> &rhs)#
-
ProblemsGraph simplify_conflicts(const ProblemsGraph &pbs)#
Hand-crafted hurisitics to simplify conflicts in messy situations.
-
std::ostream &print_problem_tree_msg(std::ostream &out, const CompressedProblemsGraph &pbs, const ProblemsMessageFormat &format = {})#
-
std::string problem_tree_msg(const CompressedProblemsGraph &pbs, const ProblemsMessageFormat &format = {})#
-
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)#
-
const conflicts_t &conflicts() const noexcept#
Public Static Functions
-
static CompressedProblemsGraph from_problems_graph(const ProblemsGraph &pbs, const merge_criteria_t &merge_criteria = {})#
-
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)#
-
const value_type &front() const noexcept#
-
const value_type &back() const noexcept#
-
const_iterator begin() const noexcept#
-
const_iterator end() const noexcept#
-
const_reverse_iterator rbegin() const noexcept#
-
const_reverse_iterator rend() const noexcept#
-
const std::string &name() const#
-
std::pair<std::string, std::size_t> 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> 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> versions_and_build_strings_trunc(std::string_view sep = "|", std::string_view etc = "...", std::size_t threshold = 5, bool remove_duplicates = true) const#
-
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
NamedListbelow, 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#
-
bool has_conflict(const key_type &a) const#
-
bool in_conflict(const key_type &a, const key_type &b) const#
-
const_iterator begin() const noexcept#
-
const_iterator end() const noexcept#
-
bool add(const key_type &a, const key_type &b)#
-
bool remove(const key_type &a, const key_type &b)#
-
bool remove(const key_type &a)#
-
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)#
-
const conflicts_t &conflicts() const noexcept#
-
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 Functions
-
inline auto packages() const#
Return a view of all unique packages involved in the solution.
The view is invalidated if actions is modified.
-
inline auto packages()#
-
inline auto packages_to_remove() const#
Return a view of all packages that need to be removed.
The view is invalidated if actions is modified.
-
inline auto packages_to_remove()#
-
inline auto packages_to_install() const#
Return a view of all packages that need to be installed.
The view is invalidated if actions is modified.
-
inline auto packages_to_install()#
-
inline auto packages_to_omit() const#
Return a view of all packages that are omitted.
The view is invalidated if actions is modified.
-
inline auto packages_to_omit()#
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#
-
inline auto packages() const#
-
namespace libsolv#
Enums
Functions
-
bool operator==(const Priorities &lhs, const Priorities &rhs)#
-
bool operator!=(const Priorities &lhs, const Priorities &rhs)#
-
bool operator==(const RepodataOrigin &lhs, const RepodataOrigin &rhs)#
-
bool operator!=(const RepodataOrigin &lhs, const RepodataOrigin &rhs)#
-
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 different requirements with the same ecosystem.
Public Functions
-
explicit Database(specs::ChannelResolveParams channel_params)#
-
Database(specs::ChannelResolveParams channel_params, Settings settings)#
-
~Database()#
- Database &=delete operator= (const Database &)
-
const specs::ChannelResolveParams &channel_params() const#
-
void set_logger(logger_type callback)#
-
expected_t<RepoInfo> 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 repo_parser = RepodataParser::Mamba)#
-
expected_t<RepoInfo> add_repo_from_native_serialization(const fs::u8path &path, const RepodataOrigin &expected, const std::string &channel_id, PipAsPythonDependency add = PipAsPythonDependency::No)#
-
template<typename Iter>
RepoInfo add_repo_from_packages(Iter first_package, Iter last_package, std::string_view name = "", PipAsPythonDependency add = PipAsPythonDependency::No)#
-
template<typename Range>
RepoInfo add_repo_from_packages(const Range &packages, std::string_view name = "", PipAsPythonDependency add = PipAsPythonDependency::No)#
-
expected_t<RepoInfo> native_serialize_repo(const RepoInfo &repo, const fs::u8path &path, const RepodataOrigin &metadata)#
-
void set_repo_priority(RepoInfo repo, Priorities priorities)#
-
std::size_t repo_count() const#
-
std::size_t package_count() const#
-
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.
-
struct Settings#
Global Database settings.
Public Members
-
MatchSpecParser matchspec_parser = MatchSpecParser::Libsolv#
-
MatchSpecParser matchspec_parser = MatchSpecParser::Libsolv#
-
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 lightweight description of a repository returned when creating a new repository in the Database. Some modifications to the repo are possible through 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#
-
using RepoId = int#
-
class Solver#
Public Types
-
using Outcome = std::variant<Solution, UnSolvable>#
Public Functions
-
expected_t<Outcome> solve(Database &database, Request &&request, MatchSpecParser ms_parser = MatchSpecParser::Mixed)#
-
expected_t<Outcome> solve(Database &database, const Request &request, MatchSpecParser ms_parser = MatchSpecParser::Mixed)#
-
using Outcome = std::variant<Solution, UnSolvable>#
-
class UnSolvable#
Public Functions
-
UnSolvable(UnSolvable&&)#
-
~UnSolvable()#
-
UnSolvable &operator=(UnSolvable&&)#
-
ProblemsGraph problems_graph(const Database &database) const#
-
std::ostream &explain_problems_to(Database &database, std::ostream &out, const ProblemsMessageFormat &format) const#
-
std::string explain_problems(Database &database, const ProblemsMessageFormat &format) const#
-
UnSolvable(UnSolvable&&)#
-
bool operator==(const Priorities &lhs, const Priorities &rhs)#
-
template<typename T>