-
Notifications
You must be signed in to change notification settings - Fork 337
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
Package Orderers now apply to variants #1684
Package Orderers now apply to variants #1684
Conversation
8619474
to
c200011
Compare
Signed-off-by: Ben Andersen <ben@isohedron.com.au>
c200011
to
cde1475
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1684 +/- ##
==========================================
+ Coverage 58.05% 58.23% +0.18%
==========================================
Files 126 126
Lines 17035 17143 +108
Branches 3490 3502 +12
==========================================
+ Hits 9889 9983 +94
- Misses 6482 6494 +12
- Partials 664 666 +2 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Ben Andersen <ben@isohedron.com.au>
7d040b0
to
6288676
Compare
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Signed-off-by: Ben Andersen <156872503+isohedronpipeline@users.noreply.github.com>
Signed-off-by: Ben Andersen <ben@isohedron.com.au>
Signed-off-by: Ben Andersen <ben@isohedron.com.au>
acbbfb8
to
7566066
Compare
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Signed-off-by: Ben Andersen <156872503+isohedronpipeline@users.noreply.github.com>
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Signed-off-by: Ben Andersen <156872503+isohedronpipeline@users.noreply.github.com>
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Signed-off-by: Ben Andersen <156872503+isohedronpipeline@users.noreply.github.com>
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Signed-off-by: Ben Andersen <156872503+isohedronpipeline@users.noreply.github.com>
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Signed-off-by: Ben Andersen <156872503+isohedronpipeline@users.noreply.github.com>
Signed-off-by: Ben Andersen <ben@isohedron.com.au>
Signed-off-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
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.
Thanks a lot for fixing this bug! flake8 is failing, but apart from that, I'm happy to get this merged in the next release.
Signed-off-by: Ben Andersen <ben@isohedron.com.au>
d91cde9
into
AcademySoftwareFoundation:main
Previously, package orderers were only applied on packages. This was an oversight. With this change, they are now applied to variants too. --------- Signed-off-by: Ben Andersen <ben@isohedron.com.au> Co-authored-by: Paul Molodowitch <elrond79@gmail.com>
Fixes #369
Fixes #1683
This PR fixes this bug so that package orderers are applied to all packages and variants uniformly in all circumstances, for more expected results.
Carries on the work originally started by @pmolodo with #355 and #413.
Here is an example of how one might take advantage of package ordering applying to variants:
Consider a package
python
which has versions['2.6.4', '2.7.16', '3.7.9', '3.9.6', '3.10.8']
The default sorted package orderer would give us this sorted list:
['3.10.8', '3.9.6', '3.7.9', '2.7.16', '2.6.4']
And we end up choosing the first possible option in the resolve:
3.10.8
If we apply the following package order:
Then we would get packages ordered like this:
['2.7.16', '2.6.4', '3.10.8', '3.9.6', '3.7.9']
, where we start at the version_split first version.Which in turn would resolve to
2.7.16
. So far so good. This is the current behavior.Now consider a package
pipeline
which has variants:If you do
rez env pipeline
we would getpython-3.9.6
in the resolve, even if we have a package orderer specifically saying we want to prefer python 2.7.16. In order to get the correctly requested version of python, we must include it in the resolve:rez env pipeline python-2.7.16
, which largely defeats the purpose of the package orderer, since the point of it is to inform the choices of packages for second order package requests.@JeanChristopheMorinPerso and I have discussed the possible speed implications. There should be neglible differences, even for very large repositories.
Variants were already being sorted, but this change just changes them to be sorted according to a sort key, in a uniform way to first order requests, instead of simply by version. The sort key for more complicated package orderers are cached anyway, so it really should be very quick.
Since this will change the way packages are resolved, there is a small danger of people no longer getting the same resolve they used to. However, it is the belief of @JeanChristopheMorinPerso, @maxnbk, and I that anyone who is using package ordering would have expected this to be the correct result anyway, and the number of people using package orderers is small enough.