Summary: | sys-apps/portage-2.3.6: endless subslot rebuilds triggered by installed package with unavailable ebuild with --autounmask=n | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Zac Medico <zmedico> |
Component: | Core - Interface (emerge) | Assignee: | Portage team <dev-portage> |
Status: | IN_PROGRESS --- | ||
Severity: | normal | CC: | esigra, sam, tgbugs, zhuyifei1999 |
Priority: | Normal | Keywords: | InVCS, PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=439688 https://bugs.gentoo.org/show_bug.cgi?id=618228 https://github.com/gentoo/portage/pull/1053 https://bugs.gentoo.org/show_bug.cgi?id=910212 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 908717 | ||
Bug Blocks: | 300071 |
Description
Zac Medico
2017-06-20 03:44:33 UTC
An implementation of --autounmask-backtrack=n that works with --autounmask=n would be helpful here, as proposed in bug 618228. I hit this bug a few months ago and a few days ago saw this again on Reddit (https://www.reddit.com/r/Gentoo/comments/143mp3a/portage_keeps_rebuilding_the_same_packages_when/) I did a bit of debugging. Reddit OP triggered this bug by un-accepting ~amd64 and rolling back to amd64 keyword, which would cause openssl to be downgraded from =dev-libs/openssl=3.0.9 to =dev-libs/openssl-1.1.1u, but they also had dev-util/rustup, which does not have a version with amd64 keyword. This then caused a bunch of packages to be rebuilt endlessly. I debugged their emerge --debug and found the issue and suggested to accept ~amd64 for rustup, which fixed the issue for them. So I then wrote a test for portage and tried to do bisection but did not find it to be a regression (didn't find a version that passed the test), but then I found that if I have another package, whose upgrade was prevented because of an unsolved dependency, the bug doesn't trigger. In my case I had net-vpn/networkmanager-openconnect 1.2.8-r1 -> 1.2.10 prevented but it depends on webkit-gtk and I have it masked. This led me through the debug logs and I found the backtrack trigger for bug 439688, and a bit of minor debugging led me to the root cause here: > lib/_emerge/depgraph.py > def _get_missed_updates(self): > [...] > if chosen_pkg > pkg or ( > not chosen_pkg.installed and chosen_pkg.version == pkg.version > ): bug 439688 expects a backtrack to prune these rebuilds, but it doesn't happen, because chosen_pkg (here =dev-libs/openssl=3.0.9) is > pkg (here =dev-libs/openssl-1.1.1u) I will send the patches for text + fix. Oh, fantastic, thank you! The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=44afa8445dc46464200fe46c1e09e0c7475067bf commit 44afa8445dc46464200fe46c1e09e0c7475067bf Author: YiFei Zhu <zhuyifei1999@gmail.com> AuthorDate: 2023-06-12 02:23:09 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-06-16 03:34:46 +0000 depgraph: Don't ignore downgrades as missed_updates Missed updates can also come in the form of package downgrades, when, for example, there are keyword changes. They can cause rebuilds, and these rebuilds may be not possible due to reasons such as keywords or masks. In this case, prior to this patch, portage would cancel the downgrade, but the rebuilds would be requested endlessly, because bug 439688's backtrack code does not trigger. To reproduce, on an ACCEPT_KEYWORDS=~amd64 machine, emerge =dev-libs/openssl=3.0.9, dev-util/rustup, and something else that depends on openssl. Then un-accept ~amd64 for openssl and rustup. Prior to this patch, a @world upgrade would cause: These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild rR ] dev-libs/libevent-2.1.12-r1:0/2.1-7::gentoo [ebuild rR ] net-misc/rsync-3.2.7-r2::gentoo [...] Total: 71 packages (71 reinstalls), Size of downloads: 0 KiB There are no packages marked "R", only "rR". There are no section labeled "The following packages are causing rebuilds:" either. After this patch, we have: These are the packages that would be merged, in order: Calculating dependencies... done! Total: 0 packages, Size of downloads: 0 KiB WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict: dev-libs/openssl:0 (dev-libs/openssl-1.1.1u:0/1.1::gentoo, ebuild scheduled for merge) dev-libs/openssl:0/3= required by (dev-util/rustup-1.25.2:0/0::gentoo, installed) I also updated the test from the previous patch to account for this change. No other tests seems affected. Bug: https://bugs.gentoo.org/439688 Bug: https://bugs.gentoo.org/622270 Signed-off-by: YiFei Zhu <zhuyifei1999@gmail.com> Closes: https://github.com/gentoo/portage/pull/1053 Signed-off-by: Sam James <sam@gentoo.org> lib/_emerge/depgraph.py | 4 +--- lib/portage/tests/resolver/test_slot_conflict_blocked_prune.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) https://gitweb.gentoo.org/proj/portage.git/commit/?id=2af4bc17d1b4ea1581bb191dfa7f34ec64ab140b commit 2af4bc17d1b4ea1581bb191dfa7f34ec64ab140b Author: YiFei Zhu <zhuyifei1999@gmail.com> AuthorDate: 2023-06-12 02:07:39 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-06-16 03:34:46 +0000 tests: resolver: Test the (bad) behavior of bug #622270 Without fixing the bug. This is so we have a baseline behavior to compare against. Bug: https://bugs.gentoo.org/439688 Bug: https://bugs.gentoo.org/622270 Signed-off-by: YiFei Zhu <zhuyifei1999@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> .../resolver/test_slot_conflict_blocked_prune.py | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) We reverted the fix for this temporarily for bug 908717. |