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
Add disfavored packages to the goal (RhBug:1699672) #1774
Conversation
Examples how to use it: Set the rule only for the transaction
When config option is When config option is When config option is Set the rule permanently in
|
@j-mracek, thanks for the code. To make sure I understand the intended usage correctly -- if I don't have any
and
behave exactly the same, or differently? On one of my systems, I see
and
and I wonder if that is expected. |
I see a weird discrepancy:
I'm not sure I understand why upgrade of In either of those cases, no This was with
|
Yes this is expected. |
Awesome, thanks. In that case, could you please look into the |
Another use-case where
Are supplements expected to be covered by the |
I investigated the issue and I found the problem. The problem is that the
original package recommended `exiv2 = 0.27.3-5.fc34` therefore the logic
disfavored `exiv2-0.27.3-5.fc34.x86_64@fedora` but not `exiv2-libs-0.27.3-7.fc34.x86_64@updates`.
The new package `Recommends: exiv2 = 0.27.3-7.fc34`.
I am not sure what we should do. What's your opinion?
|
That would make it one of the 196 cases mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1699672#c43. In https://bugzilla.redhat.com/show_bug.cgi?id=1699672#c44 Miro suggested that we could discourage using that form. Still, maybe some heuristics could help -- for example if both those packages in question have the same source rpm and the version of the one carrying the Recommends matches the version in the Recommends clause, then the |
It is possible to add additional heuristic. But more conditions means more resources for resolvement. Each additional condition means potential new set of problems and complications for debugging. |
I was also thinking about additional logic. I don't like to use source rpm name because any query that uses it is quite slow. I was thinking about logic like - if weakdep is unsatisfied and it is versioned add all packages that provides weak name. It will resolve the issue but I am not sure whether it is a good idea. Ok the logic will be even more complicated to not jump into another edge case. |
@adelton I created a patches that changed the logic . It also requires a new version of libdnf. |
It looks like that disfavors brake handling of debug-source packages. The behaviour is covered by test
The problem is in disfavors order. Try |
I changed the code and it should work correctly - proper best candidate, repo priority and preference of the architecture. May I ask for retest of the latest implementation? |
I'm using dnf-4.7.1-1.git.9427.1a4b359.fc34.noarch and it works fine for me. But I did not specifically try to find scenarios to break it. :-) |
It disfavor packages for solver and remove them from the list of candidates for weak deps. It will prevents of installing disfavored packages that are recommended or supplemented. https://bugzilla.redhat.com/show_bug.cgi?id=1699672
Versioned provides which differs between packages can be incorrectly detected by disfavor_unmet_weak_deps heuristic. It can be resolve by additional search with the reldep name.
The order of disfavors is important for the solver but not wanted for auto-detection where there is not predictable order of disfavors.
I discovered another problem with disfavors. Disfavors are stronger than Obsoletes. Available packages Expected behaviour for upgrade: pkg-B is replaced by pkg-C. But pkg-C is disfavored by disfavor_unmet_weak_deps therefore the obsolete is ignored. |
It disfavor packages for solver and remove them from the list of
candidates for weak deps. It will prevents of installing disfavored
packages that are recommended or supplemented.
Requires: rpm-software-management/libdnf#1257
Requires: rpm-software-management/ci-dnf-stack#1005
Alternative to: #1771