In the process of trying to debug an ffmpeg incompatibility with kodi, I spotted some strange equery uses output: > famine@gentoo ~ (0) $ equery u kodi > [ Legend : U - final flag setting for installation] > [ : I - package is installed with flag ] > [ Colors : set, unset ] > * Found these USE flags for media-tv/kodi-17.4-r1: > U I > + + X : Add support for X11 > ... > - - sftp : Support browsing files over SFTP > - + system-ffmpeg : Use system ffmpeg instead of the bundled one > - - systemd : Enable use of systemd-specific libraries and features like socket activation or session tracking > ... > - - zeroconf : Support for DNS Service Discovery (DNS-SD) > famine@gentoo ~ (0) $ The important point here is that system-ffmpeg is shown as not on by default, but installed with it on anyway. This isn't true - system-ffmpeg is not only on by default in the kodi package, I also have it set in my make.conf for general use. I debugged it a bit, and I can see that the python code for filtering use flags appears to be doing the wrong thing with package.use.force. Here is (a summary of) the debug session: > Python 3.4.6 (default, Sep 22 2017, 14:35:47) > [GCC 6.4.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> from gentoolkit.flag import get_flags > >>> final, hidden, mask, force = get_all_cpv_use("media-tv/kodi-17.4-r1") > >>> print("system-ffmpeg" in final) > True > >>> "system-ffmpeg" in final > True > >>> "system-ffmpeg" in hidden > False > >>> "system-ffmpeg" in mask > False > >>> "system-ffmpeg" in force > True > >>> result=filter_flags(final, hidden, mask, force) > >>> "system-ffmpeg" in result > False > >>> And indeed, it is forced on by package.use.force (system wide): > famine@gentoo ~ (0) $ egrep '(kodi|ffmpeg)' /usr/portage/**/*.force > /usr/portage/profiles/base/package.use.force:# Only ever use system ffmpeg, allow kodi bundled ffmpeg > /usr/portage/profiles/base/package.use.force:media-tv/kodi system-ffmpeg > famine@gentoo ~ (0) $ So - for some reason the function filter_flags has removed a flag that is in fact enabled by package.use.force Looking at that function, it does indeed seem to treat package.use.force as a mask, whereas my understanding of this file is that it may contain both "+" and "-" type use lines: > # dbl check if any from usemasked or useforced are still there > masked = usemasked + useforced > for a in use[:]: > if a in masked: > use.remove(a) > return use
Shame, I went to the effort of investigating this right through to pointing out the exact lines of code that aren't working, and nobody has even bothered to look at it.
Seems here is another report: https://bugs.gentoo.org/646874 Would be great to see a fix for this issue, especially since there already is a hint on the source!
Currently there is no one actively working on gentoolkit. Myself, I have been swamped with work, family and other things in Gentoo, and getting even farther behind... If someone is able to supply a patch, that would help us out a tremendous amount.
Months later, no action here. The output of equery use continues to be complete bollocks. I don't trust it at all now. The below is output for an uninstalled package so I can try and see what it will do before I waste an age compiling, but it's just crap. hangouts/proprietary-codes/suid it says are installed off, despite package not being installed and none of these use flags being mentioned in any of my configuration files. God knows what it means by this. system-libvpx it says will be set off, despite it being set *ON* in my make.conf. emerge --info agrees with me that hangouts/proprietary-codes/suid are not mentioned and system-libvpx is on. Disinformation is worse than no information, sigh. This feature should be disabled if it won't be fixed. > famine@gentoo ~ (0) $ equery u -i chromium > [ Legend : U - final flag setting for installation] > [ : I - package is installed with flag ] > [ Colors : set, unset ] > * Found these USE flags for www-client/chromium-66.0.3359.45: > U I > - - component-build : Split build into more shared libraries to speed up linking. Mostly intended for debugging > and development, NOT RECOMMENDED for general use. > + + cups : Add support for CUPS (Common Unix Printing System) > - - custom-cflags : Build with user-specified CFLAGS (unsupported) > - - gnome-keyring : Enable support for storing passwords via gnome-keyring > + - hangouts : Enable support for Google Hangouts features such as screen sharing > - - jumbo-build : Combine source files to speed up build process. > - - kerberos : Add kerberos support > + - proprietary-codecs : Enable proprietary codecs like H.264, MP3 > + + pulseaudio : Add support for PulseAudio sound server > + - suid : Build the SUID sandbox, which is only needed on CONFIG_USER_NS=n kernels > + + system-ffmpeg : Use system ffmpeg instead of the bundled one > + + system-icu : Use system icu instead of the bundled one > - + system-libvpx : Use system libvpx instead of the bundled one > - - tcmalloc : Use bundled tcmalloc instead of system malloc > - - widevine : Unsupported closed-source DRM capability (required by Netflix VOD) > famine@gentoo ~ (0) $
Created attachment 584904 [details, diff] remove check for flags from usemasked or useforced I encountered this issue and found that simply deleting the lines below that check package.use.force seems to solve the issue. (see patch) > # dbl check if any from usemasked or useforced are still there > masked = usemasked + useforced > for a in use[:]: > if a in masked: > use.remove(a) This patch is a bit of a hack and I'm not sure if it causes any other problems, but I haven't noticed any issues so far.
I just checked, and the flags going into the filter_flags function may have a + prefix which will cause unintended behavior: ['+xslt', 'python_targets_python2_7', 'dvd', 'udisks', '+system-ffmpeg', 'pulseaudio', 'nonfree', 'mariadb', 'gles', 'samba', 'vaapi', 'dbus', 'bluetooth', 'lirc', 'zeroconf', 'libusb', 'upnp', 'libressl', 'alsa', 'caps', 'cec', '+css', '+opengl', 'vdpau', 'bluray', 'kernel_linux', 'debug', 'mysql', 'test', 'upower', 'airplay', '+udev', 'webserver', 'nfs', 'java', 'sftp', 'lcms', 'systemd']
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=8eeb4ee67da8ce2143f26f07545e666b3a4ad610 commit 8eeb4ee67da8ce2143f26f07545e666b3a4ad610 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2019-07-29 00:48:07 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-07-29 00:50:23 +0000 filter_flags: handle default IUSE correctly with reduce_flag Fix comparisons to use the result of reduce_flag. Bug: https://bugs.gentoo.org/690786 Signed-off-by: Zac Medico <zmedico@gentoo.org> pym/gentoolkit/flag.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
(In reply to faminebadger from comment #0) > So - for some reason the function filter_flags has removed a flag that is in > fact enabled by package.use.force Apparently that was the intended behavior of the function, though it did not correctly handle comparisons for flags with default IUSE. (In reply to Zac Medico from comment #7) > The bug has been referenced in the following commit(s): > > https://gitweb.gentoo.org/proj/gentoolkit.git/commit/ > ?id=8eeb4ee67da8ce2143f26f07545e666b3a4ad610 > > commit 8eeb4ee67da8ce2143f26f07545e666b3a4ad610 > Author: Zac Medico <zmedico@gentoo.org> > AuthorDate: 2019-07-29 00:48:07 +0000 > Commit: Zac Medico <zmedico@gentoo.org> > CommitDate: 2019-07-29 00:50:23 +0000 > > filter_flags: handle default IUSE correctly with reduce_flag > > Fix comparisons to use the result of reduce_flag. > > Bug: https://bugs.gentoo.org/690786 > Signed-off-by: Zac Medico <zmedico@gentoo.org> > > pym/gentoolkit/flag.py | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) This causes the code to behave as intended, so that equery uses will not display any forced or masked flags.
(In reply to nnbrain8 from comment #5) > Created attachment 584904 [details, diff] [details, diff] > remove check for flags from usemasked or useforced > > I encountered this issue and found that simply deleting the lines below that > check package.use.force seems to solve the issue. (see patch) > > > # dbl check if any from usemasked or useforced are still there > > masked = usemasked + useforced > > for a in use[:]: > > if a in masked: > > use.remove(a) > > This patch is a bit of a hack and I'm not sure if it causes any other > problems, but I haven't noticed any issues so far. Lets not change default behavior of the function. We can add a parameter that allows the behavior to be overridden, or else define a new function to give the desired result.
Perhaps it's best if equery uses does not display forced/masked flags, since it's generally not intended for the user to modify these flags. Otherwise, we should probably update the display so that forced/masked flags are distinguishable from regular flags.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5b2a1086997f3bda772910edf5199a3827b5137 commit e5b2a1086997f3bda772910edf5199a3827b5137 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2019-08-19 04:00:56 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-08-19 05:06:14 +0000 app-portage/gentoolkit: Bump to version 0.4.6 Bug: https://bugs.gentoo.org/463952 Bug: https://bugs.gentoo.org/634824 Package-Manager: Portage-2.3.71, Repoman-2.3.17 Signed-off-by: Zac Medico <zmedico@gentoo.org> app-portage/gentoolkit/Manifest | 1 + app-portage/gentoolkit/gentoolkit-0.4.6.ebuild | 74 ++++++++++++++++++++++++++ 2 files changed, 75 insertions(+)