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

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

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
6a18e78
Depend on resolvo
jjerphan Jun 7, 2024
67c12f4
Add resolvo-cpp to the mamba environment
jjerphan Jun 13, 2024
a2e652a
Add a test for resolvo
jjerphan Jun 21, 2024
35b4024
Add specializations of `std::hash`
jjerphan Jun 21, 2024
cd89e5b
Implement most methods
jjerphan Jun 24, 2024
fe7bd2a
wip
jjerphan Jun 27, 2024
32922a8
wip
jjerphan Jun 28, 2024
e12956c
wip: Use custom pools
jjerphan Jun 28, 2024
f386b9e
Minimal Reproducer of the problem
jjerphan Jun 28, 2024
fc0ded7
Also sort on build number
jjerphan Jul 1, 2024
5e8ff63
test: Addition of PackageInfo to PackageDatabase
jjerphan Jul 1, 2024
70c860c
test: Filter solvables
jjerphan Jul 1, 2024
2d9fe28
Add more strings and names to pools
jjerphan Jul 1, 2024
72e47b2
Initialize Candidates.{favored,locked} to nullptr
jjerphan Jul 1, 2024
752c6fb
wip
jjerphan Jul 1, 2024
ac73e6a
Parse repodata.json
jjerphan Jul 1, 2024
be1b5ec
wip: Test consistency with libsolv
jjerphan Jul 2, 2024
dad967d
wip
jjerphan Jul 3, 2024
83d1ca5
test: mlflow=2.12.2 explicit
jjerphan Jul 8, 2024
eeb98cb
Debug
jjerphan Jul 8, 2024
45de479
More tests
jjerphan Jul 9, 2024
4cdd918
Complete ordering of solvables
jjerphan Jul 10, 2024
7a9d21f
Case for ordering on track features
jjerphan Jul 12, 2024
03dd3c4
Remove old tests
jjerphan Jul 25, 2024
c847252
Combine test cases
jjerphan Jul 25, 2024
507f810
Require, simplify, reformat, new sklearn example
jjerphan Feb 17, 2025
5a9660d
Update scikit-learn explicit known resolution
jjerphan Feb 17, 2025
79bd511
Add comment regarding pip
jjerphan Feb 18, 2025
c1619f8
Reformat with recent prettier pre-commit setup
jjerphan Feb 18, 2025
886d570
Do not promote warnings as errors
jjerphan Feb 18, 2025
05a533e
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 @@ -68,6 +68,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 @@ -430,6 +430,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 @@ -478,6 +480,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 @@ -624,6 +627,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 @@ -92,6 +92,7 @@ set(
src/core/test_thread_utils.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 @@ -113,7 +114,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