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

Solving Isolation #2302

Closed
AntoinePrv opened this issue Feb 16, 2023 · 0 comments
Closed

Solving Isolation #2302

AntoinePrv opened this issue Feb 16, 2023 · 0 comments

Comments

@AntoinePrv
Copy link
Member

AntoinePrv commented Feb 16, 2023

This is a meta issue to plan the isolation of libsolv and the definition of a new solving interface.

Breakdown

A -solv-cpp Safe and useful wrapping of libsolv

The goal is to build self contained C++ wrappers around libsolv that makes it safer and consolidate verbose patterns into utility functions.
Things such as:

  • RAII and value semantic
  • Iterators
  • Visitors (to replace macros)

But not:

  • Mamba specific logic
  • Context
  • Any #include from other mamba headers
  • Wrap all libsolv functions for the sake of wrapping
  • Hide the original libsolv object (because only selected functions would be wrapped).

All this wrapping will be private to Mamba. Current MSolver, MPool... will make use of these new wrappers but keep their interface. This will help getting some code outside of the current implementation to keep only the Mamba logic.

B- Specs ownership

Currently, version comparison, matchspecs, even repodata.json parsing is done in libsolv.
This leads to duplication (e.g. mamba::MatchSpecs), and difficulty to evolve (let alone lack of unit testing).

Right now, some functions such as MSolver::add_channel_specific_job, implement custom libsolv logic when this could be handled (and unit tested) through proper abstraction (MatchSpecs, Version...).

The goal is to implement and test (with conda test cases) these abstractions and use them in libsolv through function callbacks (need to send PR on libsolv to make it possible).

The repodata would also be read by Mamba and the packages added explicitly into libsolv.

C - New solving interface

Once all abstractions are in place, libsolv is only used as a SAT solver. We can design the new solving interface that we would like.
There would be a generic interface (or trait). All solvers, starting with libsolv and other in the future, would implement such interface, hiding all their dependencies. This would make it possible to switch solver without any code change, possibly even at runtime (which shows that things are properly abstracted).

To be completed for more details on the new interface...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant