Skip to content

experimental: Minimal self-contained implementation using resolvo with tests against libsolv's #3827

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

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ae43cf0
Depend on resolvo
jjerphan Jun 7, 2024
0e4d054
Add resolvo-cpp to the mamba environment
jjerphan Jun 13, 2024
3b6657b
Add a test for resolvo
jjerphan Jun 21, 2024
85e9439
Add specializations of `std::hash`
jjerphan Jun 21, 2024
cf32f8c
Implement most methods
jjerphan Jun 24, 2024
e340343
wip
jjerphan Jun 27, 2024
ade1c08
wip
jjerphan Jun 28, 2024
d1455a4
wip: Use custom pools
jjerphan Jun 28, 2024
7d00ee6
Minimal Reproducer of the problem
jjerphan Jun 28, 2024
c0b7dc6
Also sort on build number
jjerphan Jul 1, 2024
3951576
test: Addition of PackageInfo to PackageDatabase
jjerphan Jul 1, 2024
4dd614d
test: Filter solvables
jjerphan Jul 1, 2024
dcec84f
Add more strings and names to pools
jjerphan Jul 1, 2024
6f1209f
Initialize Candidates.{favored,locked} to nullptr
jjerphan Jul 1, 2024
2c56fae
wip
jjerphan Jul 1, 2024
690251c
Parse repodata.json
jjerphan Jul 1, 2024
d2a7415
wip: Test consistency with libsolv
jjerphan Jul 2, 2024
0729f39
wip
jjerphan Jul 3, 2024
79f54c3
test: mlflow=2.12.2 explicit
jjerphan Jul 8, 2024
c925ff4
Debug
jjerphan Jul 8, 2024
67e3672
More tests
jjerphan Jul 9, 2024
b28f8af
Complete ordering of solvables
jjerphan Jul 10, 2024
84e0986
Case for ordering on track features
jjerphan Jul 12, 2024
2068b65
Remove old tests
jjerphan Jul 25, 2024
02d0cc1
Combine test cases
jjerphan Jul 25, 2024
0d5b486
Require, simplify, reformat, new sklearn example
jjerphan Feb 17, 2025
bf46479
Update scikit-learn explicit known resolution
jjerphan Feb 17, 2025
267beae
Add comment regarding pip
jjerphan Feb 18, 2025
aa78980
Reformat with recent prettier pre-commit setup
jjerphan Feb 18, 2025
998f51f
Do not promote warnings as errors
jjerphan Feb 18, 2025
4270f26
Add `resolvo-cpp` as a host dependency for micromamba builds
jjerphan Feb 18, 2025
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
2 changes: 2 additions & 0 deletions .github/workflows/static_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
# Special values for running the feedstock with a local source
export FEEDSTOCK_ROOT="${PWD}"
export CI="local"
# Patch: add resolvo-cpp as a host dependency
sed -i 's/ - fmt/ - fmt\n - resolvo-cpp/' recipe/meta.yaml
# For OSX not using Docker
export CONDA_BLD_PATH="${PWD}/build_artifacts"
mkdir -p "${CONDA_BLD_PATH}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unix_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
--preset mamba-unix-shared-${{ inputs.build_type }} \
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
-D MAMBA_WARNING_AS_ERROR=ON \
-D MAMBA_WARNING_AS_ERROR=OFF \
-D BUILD_LIBMAMBAPY=OFF \
-D ENABLE_MAMBA_ROOT_PREFIX_FALLBACK=OFF
cmake --build build/ --parallel
Expand Down
1 change: 1 addition & 0 deletions dev/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- libarchive
- libcurl >=7.86
- libsodium
- resolvo-cpp
- libsolv >=0.7.18
- nlohmann_json
- reproc-cpp >=14.2.4.post0
Expand Down
1 change: 1 addition & 0 deletions dev/environment-micromamba-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- simdjson-static >=3.3.0
- spdlog
- fmt
- resolvo-cpp
- libsolv-static >=0.7.24
- yaml-cpp-static >=0.8.0
- reproc-static >=14.2.4.post0
Expand Down
4 changes: 4 additions & 0 deletions libmamba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ find_package(yaml-cpp CONFIG REQUIRED)
find_package(reproc CONFIG REQUIRED)
find_package(reproc++ CONFIG REQUIRED)
find_package(Libsolv MODULE REQUIRED)
find_package(Resolvo CONFIG REQUIRED)

add_subdirectory(ext/solv-cpp)

macro(libmamba_create_target target_name linkage output_name)
Expand Down Expand Up @@ -480,6 +482,7 @@ macro(libmamba_create_target target_name linkage output_name)
solv::libsolv_static
solv::libsolvext_static
solv::cpp
Resolvo::Resolvo
)

if(UNIX)
Expand Down Expand Up @@ -626,6 +629,7 @@ macro(libmamba_create_target target_name linkage output_name)
solv::libsolv
solv::libsolvext
solv::cpp
Resolvo::Resolvo
)
# CMake 3.17 provides a LibArchive::LibArchive target that could be used instead of
# LIBRARIES/INCLUDE_DIRS
Expand Down
3 changes: 2 additions & 1 deletion libmamba/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ set(
src/core/test_transaction_context.cpp
src/core/test_util.cpp
src/core/test_virtual_packages.cpp
src/solver/resolvo/test_solver.cpp
)

message(STATUS "Building libmamba C++ tests")
Expand All @@ -115,7 +116,7 @@ find_package(Threads REQUIRED)
target_link_libraries(
test_libmamba
PUBLIC mamba::libmamba reproc reproc++
PRIVATE Catch2::Catch2WithMain Threads::Threads
PRIVATE Catch2::Catch2WithMain Threads::Threads Resolvo::Resolvo simdjson::simdjson
)
set_target_properties(
test_libmamba PROPERTIES COMPILE_DEFINITIONS CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS
Expand Down
42 changes: 42 additions & 0 deletions libmamba/tests/src/solver/libsolv/test_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,48 @@ find_actions_with_name(const Solution& solution, std::string_view name)
return out;
}

auto
find_actions(const Solution& solution) -> std::vector<Solution::Action>
{
auto out = std::vector<Solution::Action>();
for (const auto& action : solution.actions)
{
std::visit(
[&](const auto& act)
{
using Act = std::decay_t<decltype(act)>;
if constexpr (Solution::has_install_v<Act>)
{
out.push_back(act);
}
},
action
);
}
return out;
}

auto
extract_package_to_install(const Solution& solution) -> std::vector<specs::PackageInfo>
{
auto out = std::vector<specs::PackageInfo>();
for (const auto& action : find_actions(solution))
{
std::visit(
[&](const auto& act)
{
using Act = std::decay_t<decltype(act)>;
if constexpr (Solution::has_install_v<Act>)
{
out.push_back(act.install);
}
},
action
);
}
return out;
}

namespace
{
using namespace specs::match_spec_literals;
Expand Down
Loading
Loading