Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 675748 - REQUIRED_USE unsatisfied error with --fetchonly --pretend, but not with just --fetchonly
Summary: REQUIRED_USE unsatisfied error with --fetchonly --pretend, but not with just ...
Status: IN_PROGRESS
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 701888 (view as bug list)
Depends on: 925481
Blocks: 377365
  Show dependency tree
 
Reported: 2019-01-18 03:52 UTC by ta2002
Modified: 2024-03-03 20:10 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ta2002 2019-01-18 03:52:16 UTC
This is just... weird. Have no idea what is going on.

# emerge -p sdlmame

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ~] games-emulation/sdlmame-0.205::jorgicio [0.174::local] USE="alsa arcade opengl openmp -debug -mess -tools" 133,062 KiB

Total: 1 package (1 upgrade), Size of downloads: 133,062 KiB


# emerge -fp sdlmame

These are the packages that would be fetched, in order:

Calculating dependencies... done!

  The following REQUIRED_USE flag constraints are unsatisfied:
    || ( arcade mess )


# emerge -f sdlmame

These are the packages that would be fetched, in order:

Calculating dependencies... done!
[ebuild     U ~] games-emulation/sdlmame-0.205::jorgicio [0.174::local] USE="alsa arcade opengl openmp -debug -mess -tools" 133,062 KiB

Total: 1 package (1 upgrade), Size of downloads: 133,062 KiB


>>> Fetching (1 of 1) games-emulation/sdlmame-0.205::jorgicio
>>> Downloading [...]



$ emerge -p --info
Portage 2.3.51 (python 3.6.5-final-0, default/linux/amd64/17.0/no-multilib, gcc-7.3.0, glibc-2.27-r6, 4.4.39-gentoo x86_64)
=================================================================
System uname: Linux-4.4.39-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q8400_@_2.66GHz-with-gentoo-2.6
KiB Mem:     8017272 total,   2897960 free
KiB Swap:    1047548 total,   1047196 free
Timestamp of repository gentoo: Thu, 17 Jan 2019 23:30:01 +0000
Head commit of repository gentoo: 4177479b80ff1fe1ad218e0681a0b9e28437a539
sh bash 4.2_p53
ld GNU ld (Gentoo 2.30 p5) 2.30.0
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p53-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.3-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r4::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://velocious/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-max-age: 24

x-crossdev
    location: /usr/local/x-crossdev
    masters: gentoo
    priority: 0

local
    location: /usr/local/portage
    masters: gentoo
    priority: 1

java
    location: /usr/portage/local/layman/java
    masters: gentoo
    priority: 50

jorgicio
    location: /usr/portage/local/layman/jorgicio
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -fomit-frame-pointer -pipe -mfpmath=sse -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -msse4.1 -mfxsr --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=core2 -fstack-protector-strong"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -fomit-frame-pointer -pipe -mfpmath=sse -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -msse4.1 -mfxsr --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=core2 -fstack-protector-strong"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="64bit R X a52 aac aalib accessibility acoustid acpi additions adobe-cff aio alsa amd64 ap arcade arping asf aspell audio audiofile avcodec avformat blksha1 bluray bookmarks bwscheduler bzip2 cacert cairo caps cdda cdio cdr chm chroot cli client clock-panel-plugin cpumining cracklib crypt cryptsetup css cups cxx daemon dbus device-mapper dga directfb display-manager djvu downloadorder dri dri3 drm dvbpsi dvd dvdnav dvdr ebook egl eigen elogind encode epub espeak exceptions exif expat extra-filters fam fbcon ffmpeg filecaps flac fluidsynth fontconfig fortran gallium gbm gcj gcrypt gd ggi gif glamor glass glib glibc-omitfp gmp gpg gphoto2 gpm gsm gstreamer gtk handbook hardcoded-tables harfbuzz hddtemp hpn iconv icu idea imap infowidget inotify iostats ipc ipfilter ipv6 jabber javafx jbig jit joystick jpeg jsbsim kdcraw kde kmod lame lcms less libass libinput libkms libmpv libsamplerate libtirpc libwww live lm_sensors logviewer lzma mad matroska mbox mdns-bundled memlimit midi mime minizip mmx mmxext mouse mp3 mp4 mpeg mta mudflap nas ncurses net network nls no-old-linux nodrm npm nptl ntfsprogs ntp ocamlopt offlinehelp ofx ogg okular opengl openmedia openmp opus oscar osdmenu p2p pango pcre pcre16 pdf pie pm-utils png policykit portmon postproc ps qml qt3support quotes raptor readline real recursion-limit redland rtc rtmp savedconfig scanfolder scanner scrypt sddm sdl search seccomp secure-delete sensord shared-glapi shm silc smbclient smtp snapshot sndfile sound speex spell sse sse2 sse2_4way sse2check sse4 ssl ssse3 stats svc svg swscale sysfs system-icu taglib tcmalloc tcpd theora threads threadsafe tiff tinfo tls-heartbeat truetype udev udisks unicode upower urandom usb userlocales utils uvm v4l2 vdpau video vorbis vtv wav webdav-neon webinterface webp widgets x264 xcb xinerama xml xmp xpdf-headers xscreensaver xslt xv xvid zlib zrtp" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="plan sheets words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3 sse4_1" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6" RUBY_TARGETS="ruby23" SANE_BACKENDS="epson2 hp" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-10 12:38:32 UTC
*** Bug 701888 has been marked as a duplicate of this bug. ***
Comment 2 Larry the Git Cow gentoo-dev 2024-01-16 16:03:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=a5078e5774932103d4ad367de4c6bf130a6da34f

commit a5078e5774932103d4ad367de4c6bf130a6da34f
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2024-01-15 23:10:03 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2024-01-16 16:01:53 +0000

    emerge: backtrack consistently regardless of --fetchonly
    
    Make the _accept_blocker_conflicts method always return
    True when backtracking is enabled, so that backtracking
    results will be identical regardless of options that
    _accept_blocker_conflicts treats specially. This way,
    conflicts will only be accepted when backtracking is
    disabled or all backtracking tries have been exhausted.
    Make --nodeps imply --backtrack=0, since backtracking
    is only useful with dependencies.
    
    Make _eliminate_rebuilds return early if there are
    slot conflicts, since the merge list is invalid anyway,
    and its possible that state inconsistencies could
    trigger unexpected exceptions as in bug 922038. Make
    the KeyError from bug 922038 a warning, and include
    relevant information to help trace the inconsistency
    back to the _eliminate_rebuilds method or some other
    source like  _solve_non_slot_operator_slot_conflicts.
    
    Bug: https://bugs.gentoo.org/161422
    Bug: https://bugs.gentoo.org/607252
    Bug: https://bugs.gentoo.org/675748
    Bug: https://bugs.gentoo.org/922038
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/_emerge/depgraph.py | 63 +++++++++++++++++++++++++++++++++++++++++++++----
 man/emerge.1            |  5 ++--
 2 files changed, 61 insertions(+), 7 deletions(-)
Comment 3 Zac Medico gentoo-dev 2024-03-02 04:17:08 UTC
I just saw this locally for sys-apps/portage even though the flag are properly set:

[ebuild   R   ~] sys-apps/portage-3.0.63::gentoo  USE="(ipc) native-extensions rsync-verify xattr -apidoc -build -doc -gentoo-dev (-selinux) -test" PYTHON_TARGETS="python3_10 python3_11 python3_12 -pypy3" 0 KiB

# emerge -pvf portage

These are the packages that would be fetched, in order:

Calculating dependencies... done!
Dependency resolution took 5.27 s (backtrack: 0/20).


  The following REQUIRED_USE flag constraints are unsatisfied:
    || ( python_targets_pypy3 python_targets_python3_10 python_targets_python3_11 python_targets_python3_12 )
Comment 4 Zac Medico gentoo-dev 2024-03-02 19:37:07 UTC
This fixed it for me but I need to investigate this invalid USE setting that I saw in pdb:

(Pdb) p pkg.use.enabled                                                                                                                                                     
frozenset({'python_targets_python3_7', 'native-extensions'})

--- a/lib/portage/package/ebuild/doebuild.py
+++ b/lib/portage/package/ebuild/doebuild.py
@@ -1813,6 +1813,7 @@ def _validate_deps(mysettings, myroot, mydo, mydbapi):
     invalid_dep_exempt_phases = {"clean", "cleanrm", "help", "prerm", "postrm"}
     all_keys = set(Package.metadata_keys)
     all_keys.add("SRC_URI")
+    all_keys.discard("USE")
     all_keys = tuple(all_keys)
     metadata = mysettings.configdict["pkg"]
     if all(k in metadata for k in ("PORTAGE_REPO_NAME", "SRC_URI")):
Comment 5 Zac Medico gentoo-dev 2024-03-02 19:43:14 UTC
It's actually my package.use settings that enter _validate_deps as mysettings.configdict["pkg"]["USE"] to corrupt the USE setting:

(Pdb) p mysettings.configdict["pkg"]["USE"]
'native-extensions python_targets_python3_7'

# grep -r sys-apps/portage /etc/portage/package.use
sys-apps/portage native-extensions
sys-apps/portage python_targets_python3_7
Comment 6 Larry the Git Cow gentoo-dev 2024-03-03 20:08:34 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=6ce2be8d454f95c508d9f547d13487f9de863bdd

commit 6ce2be8d454f95c508d9f547d13487f9de863bdd
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2024-03-03 19:53:11 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2024-03-03 19:53:11 +0000

    _validate_deps: Discard configdict["pkg"]["USE"]
    
    Since configdict["pkg"]["USE"] may contain package.use settings
    from config.setcpv, it is inappropriate to use here (bug 675748),
    so discard it. This is only an issue because configdict["pkg"] is
    a sub-optimal place to extract metadata from. This issue does not
    necessarily indicate a flaw in the Package constructor, since
    passing in precalculated USE can be valid for things like
    autounmask USE changes.
    
    Bug: https://bugs.gentoo.org/675748
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/package/ebuild/doebuild.py             | 12 ++++++++++++
 lib/portage/tests/ebuild/test_doebuild_fd_pipes.py | 19 ++++++++++++++++++-
 lib/portage/tests/resolver/ResolverPlayground.py   |  1 +
 3 files changed, 31 insertions(+), 1 deletion(-)