Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename MPool into solver::libsolv::Database #3180

Merged
merged 6 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions libmamba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ set(
${LIBMAMBA_SOURCE_DIR}/solv-cpp/solvable.cpp
${LIBMAMBA_SOURCE_DIR}/solv-cpp/solver.cpp
${LIBMAMBA_SOURCE_DIR}/solv-cpp/transaction.cpp
# Solver interface
# Solver generic interface
${LIBMAMBA_SOURCE_DIR}/solver/helpers.cpp
${LIBMAMBA_SOURCE_DIR}/solver/problems_graph.cpp
# Solver libsolv implementation
${LIBMAMBA_SOURCE_DIR}/solver/libsolv/database.cpp
${LIBMAMBA_SOURCE_DIR}/solver/libsolv/helpers.cpp
${LIBMAMBA_SOURCE_DIR}/solver/libsolv/parameters.cpp
${LIBMAMBA_SOURCE_DIR}/solver/libsolv/repo_info.cpp
Expand All @@ -212,6 +214,7 @@ set(
# Core API (low-level)
${LIBMAMBA_SOURCE_DIR}/core/singletons.cpp
${LIBMAMBA_SOURCE_DIR}/core/activation.cpp
${LIBMAMBA_SOURCE_DIR}/core/package_database_loader.cpp
${LIBMAMBA_SOURCE_DIR}/core/channel_context.cpp
${LIBMAMBA_SOURCE_DIR}/core/context.cpp
${LIBMAMBA_SOURCE_DIR}/core/download_progress_bar.cpp
Expand All @@ -224,7 +227,6 @@ set(
${LIBMAMBA_SOURCE_DIR}/core/output.cpp
${LIBMAMBA_SOURCE_DIR}/core/package_handling.cpp
${LIBMAMBA_SOURCE_DIR}/core/package_cache.cpp
${LIBMAMBA_SOURCE_DIR}/core/pool.cpp
${LIBMAMBA_SOURCE_DIR}/core/prefix_data.cpp
${LIBMAMBA_SOURCE_DIR}/core/progress_bar.cpp
${LIBMAMBA_SOURCE_DIR}/core/progress_bar_impl.cpp
Expand Down Expand Up @@ -313,10 +315,12 @@ set(
${LIBMAMBA_INCLUDE_DIR}/mamba/specs/unresolved_channel.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/specs/version.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/specs/version_spec.hpp
# Solver Interface
# Solver generic interface
${LIBMAMBA_INCLUDE_DIR}/mamba/solver/problems_graph.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/solver/request.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/solver/solution.hpp
# Solver libsolv implementation
${LIBMAMBA_INCLUDE_DIR}/mamba/solver/libsolv/database.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/solver/libsolv/parameters.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/solver/libsolv/repo_info.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/solver/libsolv/solver.hpp
Expand All @@ -341,6 +345,7 @@ set(
${LIBMAMBA_INCLUDE_DIR}/mamba/core/context.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/download_progress_bar.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/environments_manager.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/package_database_loader.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/error_handling.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/history.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/link.hpp
Expand All @@ -351,7 +356,6 @@ set(
${LIBMAMBA_INCLUDE_DIR}/mamba/core/package_fetcher.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/package_handling.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/package_paths.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/pool.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/prefix_data.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/progress_bar.hpp
${LIBMAMBA_INCLUDE_DIR}/mamba/core/pinning.hpp
Expand Down
7 changes: 5 additions & 2 deletions libmamba/include/mamba/api/channel_loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@

namespace mamba
{
namespace solver::libsolv
{
class Database;
}
class Context;
class ChannelContext;
class MPool;
class MultiPackageCache;

auto load_channels( //
Context& ctx,
ChannelContext& channel_context,
MPool& pool,
solver::libsolv::Database& pool,
MultiPackageCache& package_caches
) -> expected_t<void, mamba_aggregated_error>;
}
Expand Down
16 changes: 13 additions & 3 deletions libmamba/include/mamba/api/install.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,33 @@
#ifndef MAMBA_API_INSTALL_HPP
#define MAMBA_API_INSTALL_HPP

#include <iosfwd>
#include <string>
#include <vector>

#include <nlohmann/json.hpp>
#include <yaml-cpp/yaml.h>

#include "mamba/core/package_cache.hpp"
#include "mamba/core/pool.hpp"
#include "mamba/fs/filesystem.hpp"
#include "mamba/solver/request.hpp"
#include "mamba/specs/package_info.hpp"

namespace mamba
{
class Context;
class ChannelContext;
class Configuration;
class PrefixData;
class MultiPackageCache;

namespace specs
{
class PackageInfo;
}

namespace solver::libsolv
{
class DataBase;
}

void install(Configuration& config);

Expand Down
7 changes: 6 additions & 1 deletion libmamba/include/mamba/api/repoquery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

namespace mamba
{
namespace solver::libsolv
{
class DataBase;
}

enum class QueryResultFormat
{
Json = 0,
Expand All @@ -23,7 +28,7 @@ namespace mamba
};

[[nodiscard]] auto make_repoquery(
MPool& pool,
solver::libsolv::Database& pool,
QueryType type,
QueryResultFormat format,
const std::vector<std::string>& queries,
Expand Down
39 changes: 39 additions & 0 deletions libmamba/include/mamba/core/package_database_loader.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) 2019, QuantStack and Mamba Contributors
//
// Distributed under the terms of the BSD 3-Clause License.
//
// The full license is in the file LICENSE, distributed with this software.

#ifndef MAMBA_CORE_PACKAGE_DATABASE_LOADER_HPP
#define MAMBA_CORE_PACKAGE_DATABASE_LOADER_HPP

#include "mamba/core/error_handling.hpp"
#include "mamba/solver/libsolv/repo_info.hpp"
#include "mamba/specs/channel.hpp"

namespace mamba
{
class Context;
class PrefixData;
class SubdirData;

namespace solver::libsolv
{
class Database;
}

void add_spdlog_logger_to_database(solver::libsolv::Database& db);

auto load_subdir_in_database( //
const Context& ctx,
solver::libsolv::Database& db,
const SubdirData& subdir
) -> expected_t<solver::libsolv::RepoInfo>;

auto load_installed_packages_in_database(
const Context& ctx,
solver::libsolv::Database& db,
const PrefixData& prefix
) -> solver::libsolv::RepoInfo;
}
#endif
Loading
Loading