-
Notifications
You must be signed in to change notification settings - Fork 153
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
Deduplicate multiple subsequent choicerule_find_installed
calls
#545
base: master
Are you sure you want to change the base?
Conversation
Do you really need choicerules for mamba? They only make sense for packages providing multiple capabilities. I thought, conda doesn't do that. |
(Can you make a solver testcase available somewhere if mamba offers that? i.e. a call to testcase_write() after the solver run) |
There is no mention of |
They are not visible to the outside, so there's no documentation except some comments in the code. Here's what they do: Libsolv tries to keep the installed packages unchanged (unless you tell it to update). To do so, it first resolves the rules coming from the user job, then it resolves all installed packages, and finally it resolves all open dependencies. This is where choice rules come into play. Often a dependency may be solved by updating a already installed package. But without choicerules, libsolv will not update (because that would mean backtracking), but instead install a different provider. So it may install "sendmail" instead of updating "postfix". The choice rules are basically normal dependencies rules with the new packages removed from the possibilities. They are marked as "weak", so they can be broken if needed. But they make the solver backtrack and try a package update to solve a dependency. |
choicerule creation never took much time in Fedora/SUSE, so there must be something special in the conda repos to slow down solving that much. |
Yeah I don't think that's a thing in Conda universe @AntoinePrv @wolfv? Solving a medium sized Conda env performs 1M+ calls to |
Nope, it's not a thing in the condaverse. At least not yet! :) |
@mlschroe what next steps do you suggest? Happy with a flag that disables choice rules |
There are two possibilities:
What do you prefer? |
Maybe better to disable that for |
@AntoinePrv @wolfv any opinion? |
I'm not so knowledgeable about it, but I would say a compiler flag is safer in case we turn out to need it. |
@mlschroe I'm going to send a PR. Are you still interested in the "cache" I introduced in this PR? |
No, the cache wont work in the general case when there are package obsoletes. |
(Not saying that a cache wouldn't be a good thing, it just needs to be a bit more complicated. That's why I asked for a solver testcase, so that I can test things locally) |
I wanted to provide a test case but I failed building/linking with Mamba with the extension. Cmake is hard. |
Not sure if this is a correct change to make, I'm really new to the libsolv codebase.
It speeds up solving in Mamba by a factor of 5 for some environments.
cc @AntoinePrv do you have enough understanding of libsolv to tell if this is a correct change?
xref mamba-org/mamba#2824 (comment)
Example:
micromamba -p ... install xtensor