Created attachment 764732 [details] emerge --info Let's say I start with a clean amd64 systemd stage3. This stage has sys-kernel/installkernel-gentoo preinstalled. If I do: ``` # emerge -vp installkernel-systemd-boot These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] sys-kernel/installkernel-systemd-boot-1::gentoo 0 KiB [uninstall ] sys-kernel/installkernel-gentoo-3::gentoo [blocks b ] sys-kernel/installkernel-gentoo ("sys-kernel/installkernel-gentoo" is soft blocking sys-kernel/installkernel-systemd-boot-1) [blocks b ] sys-kernel/installkernel-systemd-boot ("sys-kernel/installkernel-systemd-boot" is soft blocking sys-kernel/installkernel-gentoo-3) Total: 1 package (1 new, 1 uninstall), Size of downloads: 0 KiB Conflict: 2 blocks (all satisfied) ``` i.e. emerge correctly establishes that one can replace the other. However, if I add a package that has a || ( sys-kernel/installkernel-gentoo sys-kernel/installkernel-systemd-boot ) dependency, Portage is no longer able to figure it out: ``` # emerge -vtp installkernel-systemd-boot gentoo-kernel-bin These are the packages that would be merged, in reverse order: Calculating dependencies... done! [nomerge ] sys-kernel/gentoo-kernel-bin-5.15.19:5.15.19::gentoo USE="initramfs -test" [ebuild N ] virtual/dist-kernel-5.15.19:0/5.15.19::gentoo 0 KiB [ebuild N ] sys-kernel/gentoo-kernel-bin-5.15.19:5.15.19::gentoo USE="initramfs -test" 187515 KiB [ebuild N ] sys-kernel/installkernel-systemd-boot-1::gentoo 0 KiB [nomerge ] sys-kernel/gentoo-kernel-bin-5.15.19:5.15.19::gentoo USE="initramfs -test" [ebuild N ] virtual/libelf-3:0/1::gentoo ABI_X86="(64) -32 (-x32)" 0 KiB [ebuild N ] dev-libs/elfutils-0.186::gentoo USE="bzip2 nls utils -lzma -static-libs -test (-threads) -valgrind -zstd" ABI_X86="(64) -32 (-x32)" 9018 KiB [ebuild N ] sys-devel/bc-1.07.1-r3::gentoo USE="readline -libedit -static" 411 KiB [ebuild N ] sys-kernel/dracut-055-r4::gentoo USE="(-selinux) (-test)" 354 KiB [ebuild N ] app-text/asciidoc-9.1.0::gentoo USE="-doc -test" PYTHON_SINGLE_TARGET="python3_9 (-pypy3) -python3_8 -python3_10" 1221 KiB [ebuild N ] app-arch/cpio-2.12-r1::gentoo USE="nls" 1230 KiB [blocks B ] sys-kernel/installkernel-gentoo ("sys-kernel/installkernel-gentoo" is soft blocking sys-kernel/installkernel-systemd-boot-1) [blocks B ] sys-kernel/installkernel-systemd-boot ("sys-kernel/installkernel-systemd-boot" is soft blocking sys-kernel/installkernel-gentoo-3) Total: 9 packages (9 new), Size of downloads: 199746 KiB Conflict: 2 blocks (2 unsatisfied) * Error: The above package list contains packages which cannot be * installed at the same time on the same system. (sys-kernel/installkernel-systemd-boot-1:0/0::gentoo, ebuild scheduled for merge) pulled in by installkernel-systemd-boot (sys-kernel/installkernel-gentoo-3-1:0/0::gentoo, installed) pulled in by sys-kernel/installkernel-gentoo required by (sys-kernel/gentoo-kernel-bin-5.15.19:5.15.19/5.15.19::gentoo, ebuild scheduled for merge) USE="initramfs -test" ABI_X86="(64)" ```
Wed Nov 24 12:36:59 2021 is the last time portage did the replace; might be a good place to start the bisect.
Bisected it to: commit a7289ac0eaaa0d435bf6d9bfb2724a6b39adcbee Author: Zac Medico <zmedico@gentoo.org> Date: Sat Dec 4 15:54:47 2021 -0800 dep_zapdeps: avoid new slots when appropriate (bug 828136) Place choices that do not pull in new slots into a preferred choice bin, so that they will not be mixed with choices that contain unnecessary upgrades. This fixes the included test case so that an unnecessary new python slot is not pulled in. Bug: https://bugs.gentoo.org/828136 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/dep/dep_check.py | 6 ++- .../tests/resolver/test_unecessary_slot_upgrade.py | 62 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 lib/portage/tests/resolver/test_unecessary_slot_upgrade.py
(In reply to Michał Górny from comment #2) > Bisected it to: > > commit a7289ac0eaaa0d435bf6d9bfb2724a6b39adcbee > Author: Zac Medico <zmedico@gentoo.org> > Date: Sat Dec 4 15:54:47 2021 -0800 > > dep_zapdeps: avoid new slots when appropriate (bug 828136) > > Place choices that do not pull in new slots into a preferred > choice bin, so that they will not be mixed with choices that > contain unnecessary upgrades. This fixes the included test > case so that an unnecessary new python slot is not pulled in. > > Bug: https://bugs.gentoo.org/828136 > Signed-off-by: Zac Medico <zmedico@gentoo.org> Note that you can use the --update flag to avoid the new behavior. Of course we can always revert the patch if the new behavior is deemed too troublesome.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=041763a8b7cda7dac0b75aa4a85eb73f333b7e55 commit 041763a8b7cda7dac0b75aa4a85eb73f333b7e55 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2022-02-14 00:11:43 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2022-02-14 00:13:05 +0000 Add unit test to reproduce bug 833014 Bug: https://bugs.gentoo.org/833014 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/tests/resolver/test_installkernel.py | 111 +++++++++++++++++++++++ 1 file changed, 111 insertions(+)
Should we revert the behavior, or is it acceptable to use --update and --deep for cases like this?
(In reply to Zac Medico from comment #5) > Should we revert the behavior, or is it acceptable to use --update and > --deep for cases like this? IMO, it's a lesser evil to revert than keep the current behaviour (bug 828136 was a bit odd, but less confusing than this, and less likely for people to hit it).
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=17d64dba6363c15069f49bfe3dc2060a9811e288 commit 17d64dba6363c15069f49bfe3dc2060a9811e288 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2022-03-05 19:22:08 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2022-03-05 19:23:39 +0000 Revert "dep_zapdeps: avoid new slots when appropriate (bug 828136)" Revert the change from bug 828136, since it prevents solving of some blockers unless --update and --deep are specified as reported in bug 833014. Bug: https://bugs.gentoo.org/833014 Reverts: a7289ac0eaaa0d435bf6d9bfb2724a6b39adcbee Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/dep/dep_check.py | 6 +----- lib/portage/tests/resolver/test_installkernel.py | 20 +------------------- .../tests/resolver/test_unecessary_slot_upgrade.py | 11 ----------- 3 files changed, 2 insertions(+), 35 deletions(-)