-
Notifications
You must be signed in to change notification settings - Fork 158
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
initial ordering by reldep and reldep-trackfeatures for conda #457
base: master
Are you sure you want to change the base?
initial ordering by reldep and reldep-trackfeatures for conda #457
Conversation
src/policy.c
Outdated
|
||
int i = 0, j = 0; | ||
// set intersection, assuming sorted arrays | ||
if (prev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this assumes that the Id's returned by pool_whatprovides are sorted... is that correct @mlschroe ?
Hi @mlschroe I am reasonably confident in this PR now (and it definitely improves the situation on the mamba/conda side). It would be great to get your review and improvement suggestions. I am sure things can be further simplified with more in-depth knowledge of libsolv. Some test cases:
|
I added support for trackfeature minimization in the "trackfeature" branch. This implements what I described in the other pull request, i.e. backtracking if a new tracked feature needs to be added. Can you please check if that helps with your testcases? |
Hi @mlschroe awesome, yes, it seems to work fine! The ordering by dependencies seems to be missing though, right? Basically in your branch it "works" by accident since the build strings are often ordererable (e.g. py39hashval > py38hashval...). However, sometimes that breaks ... (especially when people are pushing a new build without updating the build number, which unfortunately does happen). E.g. for this combination of install specs: But anyways, maybe it makes sense to combine both? |
Yes, something like your order by dependency patch is still needed. |
7ef80f4
to
e7c6718
Compare
@mlschroe we've released this code into our conda package and it's been released for a while now. We're not getting any more complaints so I think this would be good to go now :) Do you want me to reformat anything? |
What about my "trackfeature" branch? Is that also live in your released conda package? Can/Should I merge it? |
the track feature branch is not yet live, no. I should probably run more tests with that. |
I went back to the drawing board and now came up with this solution for the problem of preferring variants for conda packages.
There are two additional sorts:
For a given two solvables that are "variants" (same version & build number), this code compares all dependencies. If the dependency specifier between the two solvables is different, it will resolve the first level of deps to check:
For example:
numpy-1.20-py3.8
numpy-1.20-py3.7
numpy-1.20-pypy3.7
I would be happy to get some tips on how to slim down the code further :) specifically I was thinking about using the selection_solvables and selection_filter functions but didn't really know if they'd be efficient at doing what I needed.
One of the corner cases I tried to solve was when we have the same reldep->name twice, e.g. the warpx package depends on
For this, I am trying here to select the matching solvables for both reldep strings, then compute the intersection of the two sets.
From the matching solvables I compare if they (all) have track features, and finally I find the best EVR of all matching solvables and return it.
Then I check the second list of dependencies, and compare both "best EVRs" and existence of track_features.