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

Prefer latest versions of newly pulled in dependencies over smaller transaction #549

Open
kontura opened this issue Jan 9, 2024 · 6 comments

Comments

@kontura
Copy link
Contributor

kontura commented Jan 9, 2024

Following the pointer from #536 we are trying the SOLVER_FLAG_FOCUS_BEST but it seems it is too strong for dnf.

To test it out we did set it as a default for all dnf5 commands and perhaps unsurprisingly it caused issues.

I believe that the desired behavior for dnf is to: prefer latest versions of newly pulled in dependencies over smaller transaction.

Is this something libsolv is already trying to achieve and when it doesn't happen can we consider that a bug (like #514)? Or would a new flag be needed for that?

@kontura
Copy link
Contributor Author

kontura commented Jun 26, 2024

Any update here?

@kontura
Copy link
Contributor Author

kontura commented Jul 3, 2024

To clarify on the testcase from #536

For:

repo @System 0 testtags <inline>
#>=Pkg: krb5-libs 1.18.2 22.el8_7 x86_64
#>=Prv: krb5-libs(x86-64) = 1.18.2-22.el8_7

repo available 0 testtags <inline>
#>=Pkg: ipa-client 4.9.11 5.el8 x86_64
#>=Req: krb5-pkinit-openssl
#>
#>=Pkg: krb5-libs 1.18.2 25.el8_8 x86_64
#>=Prv: krb5-libs(x86-64) = 1.18.2-25.el8_8
#>
#>=Pkg: krb5-pkinit 1.18.2 25.el8_8 x86_64
#>=Req: krb5-libs(x86-64) = 1.18.2-25.el8_8
#>=Prv: krb5-pkinit-openssl = 1.18.2-25.el8_8
#>
#>=Pkg: krb5-pkinit 1.18.2 22.el8_7 x86_64
#>=Req: krb5-libs(x86-64) = 1.18.2-22.el8_7
#>=Prv: krb5-pkinit-openssl = 1.18.2-22.el8_7

system x86_64 rpm @System

job install oneof ipa-client-4.9.11-5.el8.x86_64@available

We would like the result (just like with focusbest):

result transaction,problems <inline>
#>install ipa-client-4.9.11-5.el8.x86_64@available
#>install krb5-pkinit-1.18.2-25.el8_8.x86_64@available
#>upgrade krb5-libs-1.18.2-22.el8_7.x86_64@@System krb5-libs-1.18.2-25.el8_8.x86_64@available

However if the upgrade of krb5-libs isn't needed:

repo @System 0 testtags <inline>
#>=Pkg: krb5-libs 1.18.2 22.el8_7 x86_64
#>=Prv: krb5-libs(x86-64) = 1.18.2-22.el8_7

repo available 0 testtags <inline>
#>=Pkg: ipa-client 4.9.11 5.el8 x86_64
#>=Req: krb5-pkinit-openssl
#>
#>=Pkg: krb5-libs 1.18.2 25.el8_8 x86_64
#>=Prv: krb5-libs(x86-64) = 1.18.2-25.el8_8
#>
#>=Pkg: krb5-pkinit 1.18.2 25.el8_8 x86_64
#>=Req: krb5-libs(x86-64)
#>=Prv: krb5-pkinit-openssl = 1.18.2-25.el8_8
#>
#>=Pkg: krb5-pkinit 1.18.2 22.el8_7 x86_64
#>=Req: krb5-libs(x86-64)
#>=Prv: krb5-pkinit-openssl = 1.18.2-22.el8_7

system x86_64 rpm @System

job install oneof ipa-client-4.9.11-5.el8.x86_64@available

It should be like without focusbest:

result transaction,problems <inline>
#>install ipa-client-4.9.11-5.el8.x86_64@available
#>install krb5-pkinit-1.18.2-25.el8_8.x86_64@available

@mlschroe
Copy link
Member

mlschroe commented Jul 8, 2024

Actually it's not hard to do. I just need to find a name for that mode. FOCUS_UPDATE?

@mlschroe
Copy link
Member

mlschroe commented Jul 8, 2024

FOCUS_BETTER ;-)

mlschroe added a commit that referenced this issue Jul 9, 2024
First resolve the given jobs, then the dependencies of the
resulting packages ignoreing the ones provided by currently
installed packages. After that resolve all already installed
packages. This is similar to SOLVER_FLAG_FOCUS_BEST but less
aggressive in updating packages.

Fixes issue #549
@mlschroe
Copy link
Member

mlschroe commented Jul 9, 2024

Ok, it's SOLVER_FLAG_FOCUS_NEW unless you come up with a better name.

@kontura
Copy link
Contributor Author

kontura commented Jul 15, 2024

That is great, thank you!
We will try to use it in dnf5 as a start: rpm-software-management/dnf5#1582.

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

No branches or pull requests

2 participants