When running `emerge -uUD --with-bdeps=y @world` it is expected that all packages will be updated to latest version and all USE flag changes would be applied, or, if that is not possible, an error message would be provided to the user. However, in the case when there is an unmet REQUIRED_USE, portage seems to silently skip it, providing no error or warning. Here is an example: First, let's create a simple ebuild to test with: $ pwd /var/db/repos/local/app-misc/repro $ cat repro-0.0.1.ebuild # Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DESCRIPTION="" HOMEPAGE="" SRC_URI="" LICENSE="" SLOT="0" KEYWORDS="~amd64" IUSE="auseflag anotheruseflag" REQUIRED_USE="auseflag? ( anotheruseflag )" Then, emerge with the USE flags: # USE="auseflag anotheruseflag" emerge -1 app-misc/repro Calculating dependencies... done! >>> Verifying ebuild manifests >>> Emerging (1 of 1) app-misc/repro-0.0.1::local >>> Unpacking source... >>> Source unpacked in /var/tmp/portage/app-misc/repro-0.0.1/work >>> Preparing source in /var/tmp/portage/app-misc/repro-0.0.1/work ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/app-misc/repro-0.0.1/work ... >>> Source configured. >>> Compiling source in /var/tmp/portage/app-misc/repro-0.0.1/work ... >>> Source compiled. >>> Test phase [not enabled]: app-misc/repro-0.0.1 >>> Install app-misc/repro-0.0.1 into /var/tmp/portage/app-misc/repro-0.0.1/image >>> Completed installing app-misc/repro-0.0.1 into /var/tmp/portage/app-misc/repro-0.0.1/image * Final size of build directory: 0 KiB * Final size of installed tree: 0 KiB >>> Installing (1 of 1) app-misc/repro-0.0.1::local >>> Auto-cleaning packages... >>> No outdated packages were found on your system. Later, I change some USE flags and decide to update world, but emerge says there is nothing to rebuild: # USE="auseflag" emerge -puUD --with-bdeps\=y @world These are the packages that would be merged, in order: Calculating dependencies... done! This is obviously false because I removed the "anotheruseflag" USE flag, so it should attempt to rebuild. When explicitly telling it to rebuild, it gives the expected error message: # USE="auseflag" emerge -1p app-misc/repro These are the packages that would be merged, in order: Calculating dependencies | !!! Problem resolving dependencies for app-misc/repro ... done! !!! The ebuild selected to satisfy "app-misc/repro" has unmet requirements. - app-misc/repro-0.0.1::local USE="auseflag -anotheruseflag" ABI_X86="(64)" The following REQUIRED_USE flag constraints are unsatisfied: auseflag? ( anotheruseflag )
I think this is expected if that package isn't in world / you used -1. They're orphans and will be removed on depclean.
You are right, that was my bad. I cannot reproduce what is happening on my system with simple ebuilds, but I am certain there is a bug (or at least unexpected behavior). Here is the case I was trying to represent in the original bug report: Here I check if there are any orphans (none, as far as I can tell): # emerge -ac * Always study the list of packages to be cleaned for any obvious * mistakes. Packages that are part of the world set will always * be kept. They can be manually added to this set with * `emerge --noreplace <atom>`. Packages that are listed in * package.provided (see portage(5)) will be removed by * depclean, even if they are part of the world set. * * As a safety measure, depclean will not remove any packages * unless *all* required dependencies have been resolved. As a * consequence of this, it often becomes necessary to run * `emerge --update --newuse --deep @world` prior to depclean. Calculating dependencies... done! >>> No packages selected for removal by depclean >>> To see reverse dependencies, use --verbose Packages installed: 1343 Packages in world: 148 Packages in system: 44 Required packages: 1343 Number removed: 0 Then, I try to update: # emerge -auUD --with-bdeps\=y --quiet-build @world These are the packages that would be merged, in order: Calculating dependencies... done! Nothing to merge; quitting. I get no errors or warnings that dev-python/PyQt5 has changed USE flags that cannot be met. Here are the changed flags: # equery uses dev-python/PyQt5 [ Legend : U - final flag setting for installation] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for dev-python/PyQt5-5.15.6: U I - + bluetooth : Build bindings for the QtBluetooth module - - dbus : Build bindings for the QtDBus module - - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces - - declarative : Build bindings for the QtQml and QtQuick modules and enable the qmlscene plugin - - designer : Build bindings for the QtDesigner module and enable the designer plugin - - examples : Install examples, usually source code - - gles2-only : Use GLES 2.0 or later instead of full OpenGL - + gui : Build bindings for the QtGui module - - help : Build bindings for the QtHelp module - - location : Build bindings for the QtLocation module - - multimedia : Build bindings for the QtMultimedia module + + network : Build bindings for the QtNetwork module + + opengl : Build bindings for the QtOpenGL module - - positioning : Build bindings for the QtPositioning module + + printsupport : Build bindings for the QtPrintSupport module - - python_targets_python3_10 : Build with Python 3.10 - - python_targets_python3_8 : Build with Python 3.8 + + python_targets_python3_9 : Build with Python 3.9 - - sensors : Build bindings for the QtSensors module - - serialport : Build bindings for the QtSerialPort module - - speech : Build bindings for the QtTextToSpeech module - - sql : Build bindings for the QtSql module + + ssl : Add support for SSL/TLS connections (Secure Socket Layer / Transport Layer Security) + + svg : Build bindings for the QtSvg module - - testlib : Build bindings for the QtTest module + + webchannel : Build bindings for the QtWebChannel module - - websockets : Build bindings for the QtWebSockets module - + widgets : Build bindings for the QtWidgets module - - x11extras : Build bindings for the QtX11Extras module - - xmlpatterns : Build bindings for the QtXmlPatterns module Here I try to force rebuild dev-python/PyQt5: # emerge -a1 dev-python/PyQt5 These are the packages that would be merged, in order: Calculating dependencies \ !!! Problem resolving dependencies for dev-python/PyQt5 ... done! !!! The ebuild selected to satisfy "dev-python/PyQt5" has unmet requirements. - dev-python/PyQt5-5.15.6::gentoo USE="network opengl printsupport ssl svg webchannel -bluetooth -dbus -debug -declarative -designer -examples -gles2-only -gui -help -location -multimedia -positioning -sensors -serialport -speech -sql -testlib -websockets -widgets -x11extras -xmlpatterns" ABI_X86="(64)" PYTHON_TARGETS="python3_9 -python3_10 -python3_8" The following REQUIRED_USE flag constraints are unsatisfied: opengl? ( gui widgets ) printsupport? ( gui widgets ) svg? ( gui widgets ) The above constraints are a subset of the following complete expression: any-of ( python_targets_python3_8 python_targets_python3_9 python_targets_python3_10 ) bluetooth? ( gui ) declarative? ( gui network ) designer? ( widgets ) help? ( gui widgets ) location? ( positioning ) multimedia? ( gui network ) opengl? ( gui widgets ) positioning? ( gui ) printsupport? ( gui widgets ) sensors? ( gui ) serialport? ( gui ) sql? ( widgets ) svg? ( gui widgets ) testlib? ( widgets ) webchannel? ( network ) websockets? ( network ) widgets? ( gui ) xmlpatterns? ( network ) Just to be 100% sure that dev-python/PyQt5 is not an orphan, I check what depends on it: # equery depends dev-python/PyQt5 * These packages depend on dev-python/PyQt5: app-misc/anki-2.1.15-r1 (python_single_target_python3_8 ? >=dev-python/PyQt5-5.12[gui,svg,widgets,python_targets_python3_8(-)]) (python_single_target_python3_9 ? >=dev-python/PyQt5-5.12[gui,svg,widgets,python_targets_python3_9(-)]) dev-python/PyQtWebEngine-5.15.5 (>=dev-python/PyQt5-5.15.5[gui,network,printsupport,ssl,webchannel,widgets,python_targets_python3_8(-)?,python_targets_python3_9(-)?,python_targets_python3_10(-)?]) net-print/hplip-3.22.4 (qt5 ? >=dev-python/PyQt5-5.5.1[dbus,gui,widgets,python_targets_python3_8(-)]) (qt5 ? >=dev-python/PyQt5-5.5.1[dbus,gui,widgets,python_targets_python3_9(-)]) (qt5 ? >=dev-python/PyQt5-5.5.1[dbus,gui,widgets,python_targets_python3_10(-)]) And I do, indeed, have app-misc/anki in world: # grep anki /var/lib/portage/world app-misc/anki # equery uses app-misc/anki [ Legend : U - final flag setting for installation] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for app-misc/anki-2.1.15-r1: U I - - python_single_target_python3_8 : Build for Python 3.8 only + + python_single_target_python3_9 : Build for Python 3.9 only - - test : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently) I do not know what is causing this issue. I just tried to create another ebuild, app-misc/depend-on-repro, that depends on app-misc/repro, then install (into world this time) app-misc/depend-on-repro with USE="auseflag anotheruseflag", then tried `USE="auseflag" emerge -auUD --with-bdeps=y @world` and it give me the expected error, so why am I not getting that error with the "real world" example?
Good question! My guess was maybe REQUIRED_USE constraints in the ebuild changed w/o a revbump or something, but.. apparently not?
I was able to reproduce this bug using simpler ebuilds: # cat /var/db/repos/local/app-misc/depend-on-repro/depend-on-repro-0.0.3.ebuild # Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DESCRIPTION="" HOMEPAGE="" SRC_URI="" LICENSE="" SLOT="0" KEYWORDS="~amd64" IUSE="" RESTRICT="" REQUIRED_USE="" RDEPEND="app-misc/repro[auseflag,anotheruseflag]" BDEPEND="" # cat /var/db/repos/local/app-misc/repro/repro-0.0.3.ebuild # Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DESCRIPTION="" HOMEPAGE="" SRC_URI="" LICENSE="" SLOT="0" KEYWORDS="~amd64" IUSE="auseflag anotheruseflag" RESTRICT="" REQUIRED_USE="auseflag? ( anotheruseflag )" RDEPEND="" BDEPEND="" I think the important part is that app-misc/depend-on-repro depends on app-misc/repro with those required flags. First install with those flags set. Nothing unusual. # USE="auseflag anotheruseflag" emerge -a depend-on-repro These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] app-misc/repro-0.0.3 USE="anotheruseflag auseflag" [ebuild N ] app-misc/depend-on-repro-0.0.3 Would you like to merge these packages? [Yes/No] >>> Verifying ebuild manifests >>> Emerging (1 of 2) app-misc/repro-0.0.3::local * Fetching files in the background. * To view fetch progress, run in another terminal: * tail -f /var/log/emerge-fetch.log >>> Unpacking source... >>> Source unpacked in /var/tmp/portage/app-misc/repro-0.0.3/work >>> Preparing source in /var/tmp/portage/app-misc/repro-0.0.3/work ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/app-misc/repro-0.0.3/work ... >>> Source configured. >>> Compiling source in /var/tmp/portage/app-misc/repro-0.0.3/work ... >>> Source compiled. >>> Test phase [not enabled]: app-misc/repro-0.0.3 >>> Install app-misc/repro-0.0.3 into /var/tmp/portage/app-misc/repro-0.0.3/image >>> Completed installing app-misc/repro-0.0.3 into /var/tmp/portage/app-misc/repro-0.0.3/image * Final size of build directory: 0 KiB * Final size of installed tree: 0 KiB >>> Installing (1 of 2) app-misc/repro-0.0.3::local >>> Emerging (2 of 2) app-misc/depend-on-repro-0.0.3::local >>> Unpacking source... >>> Source unpacked in /var/tmp/portage/app-misc/depend-on-repro-0.0.3/work >>> Preparing source in /var/tmp/portage/app-misc/depend-on-repro-0.0.3/work ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/app-misc/depend-on-repro-0.0.3/work ... >>> Source configured. >>> Compiling source in /var/tmp/portage/app-misc/depend-on-repro-0.0.3/work ... >>> Source compiled. >>> Test phase [not enabled]: app-misc/depend-on-repro-0.0.3 >>> Install app-misc/depend-on-repro-0.0.3 into /var/tmp/portage/app-misc/depend-on-repro-0.0.3/image >>> Completed installing app-misc/depend-on-repro-0.0.3 into /var/tmp/portage/app-misc/depend-on-repro-0.0.3/image * Final size of build directory: 0 KiB * Final size of installed tree: 0 KiB >>> Installing (2 of 2) app-misc/depend-on-repro-0.0.3::local >>> Recording app-misc/depend-on-repro in "world" favorites file... >>> Auto-cleaning packages... >>> No outdated packages were found on your system. Now when I do an update to world with unmet REQUIRED_USE, I get no errors or warning, which is unexpected. This is the bug I am talking about. # USE="auseflag" emerge -auUD --with-bdeps=y @world These are the packages that would be merged, in order: Calculating dependencies... done! Nothing to merge; quitting. Explicitly rebuilding app-misc/repro however does trigger an error, which is good. # USE="auseflag" emerge -a1 repro These are the packages that would be merged, in order: Calculating dependencies \ !!! Problem resolving dependencies for app-misc/repro ... done! !!! The ebuild selected to satisfy "repro" has unmet requirements. - app-misc/repro-0.0.3::local USE="auseflag -anotheruseflag" ABI_X86="(64)" The following REQUIRED_USE flag constraints are unsatisfied: auseflag? ( anotheruseflag ) Just confirming that app-misc/repro is not an orphan: # emerge -ac * Always study the list of packages to be cleaned for any obvious * mistakes. Packages that are part of the world set will always * be kept. They can be manually added to this set with * `emerge --noreplace <atom>`. Packages that are listed in * package.provided (see portage(5)) will be removed by * depclean, even if they are part of the world set. * * As a safety measure, depclean will not remove any packages * unless *all* required dependencies have been resolved. As a * consequence of this, it often becomes necessary to run * `emerge --update --newuse --deep @world` prior to depclean. Calculating dependencies... done! >>> No packages selected for removal by depclean >>> To see reverse dependencies, use --verbose Packages installed: 1345 Packages in world: 149 Packages in system: 44 Required packages: 1345 Number removed: 0 # equery depends app-misc/repro * These packages depend on app-misc/repro: app-misc/depend-on-repro-0.0.3 (app-misc/repro[auseflag,anotheruseflag]) # grep depend-on-repro /var/lib/portage/world app-misc/depend-on-repro I think this confirms the bug has nothing to do with Python, Qt, or any other inherited eclass; instead it is just with how portage is calculating dependencies. Maybe since app-misc/depend-on-repro depends on app-misc/repro with auseflag and anotheruseflag both set, portage is incorrectly assuming that the user does actually have both of them set for some reason?