Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916336 - >=sys-apps/portage-3.0.54-r1 crashes with error AttributeError: 'Blocker' object has no attribute 'cpv'
Summary: >=sys-apps/portage-3.0.54-r1 crashes with error AttributeError: 'Blocker' obj...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, PullRequest
Depends on: 916256
Blocks:
  Show dependency tree
 
Reported: 2023-10-27 12:13 UTC by Sebastian Pipping
Modified: 2023-11-06 21:42 UTC (History)
5 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 Sebastian Pipping gentoo-dev 2023-10-27 12:13:50 UTC
I saw this with 3.0.54-r1 yesterday:

=====================
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.10/emerge", line 57, in main
    retval = emerge_main()
  File "/usr/lib/python3.10/site-packages/_emerge/main.py", line 1306, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib/python3.10/site-packages/_emerge/actions.py", line 4020, in run_action
    retval = action_build(emerge_config, spinner=spinner)
  File "/usr/lib/python3.10/site-packages/_emerge/actions.py", line 546, in action_build
    mydepgraph.display_problems()
  File "/usr/lib/python3.10/site-packages/_emerge/depgraph.py", line 10593, in display_problems
    self._show_ignored_binaries()
  File "/usr/lib/python3.10/site-packages/_emerge/depgraph.py", line 1229, in _show_ignored_binaries
    self._show_ignored_binaries_respect_use(ignored_binaries["respect_use"])
  File "/usr/lib/python3.10/site-packages/_emerge/depgraph.py", line 1237, in _show_ignored_binaries_respect_use
    merging = {pkg.cpv for pkg in self._dynamic_config._displayed_list}
  File "/usr/lib/python3.10/site-packages/_emerge/depgraph.py", line 1237, in <setcomp>
    merging = {pkg.cpv for pkg in self._dynamic_config._displayed_list}
AttributeError: 'Blocker' object has no attribute 'cpv'
=====================

My command was "emerge -u --tree --deep --changed-use -kg @world --pretend" and EMERGE_DEFAULT_OPTS adds "--keep-going --ask --verbose --complete-graph -j 3 --dynamic-deps y --verbose-conflicts" to that.

Adding as a blocker to bug #916256 just in case it's not fixed and fixable for 3.0.55, please feel free to drop.  Could be related to bug #915842.
Comment 1 matoro archtester 2023-10-27 14:30:50 UTC
This is happening for me also without --pretend.

$ portageq envvar EMERGE_DEFAULT_OPTS
--usepkg --autounmask=n --backtrack=300 --complete-graph --with-bdeps=y --keep-going
$ sudo -E emerge -avuDN1 --keep-going @world

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

Calculating dependencies... done!
Dependency resolution took 38.75 s (backtrack: 0/300).

[ebuild  NS    ] media-libs/webrtc-audio-processing-1.3:1::gentoo [0.3.1-r1:0::gentoo] USE="(-static-libs%)" ABI_X86="(64) -32 (-x32)" 860 KiB
[ebuild     U  ] dev-python/alembic-1.12.1::gentoo [1.12.0::gentoo] USE="-doc -test" PYTHON_TARGETS="python3_11 -pypy3 -python3_10 -python3_12" 1,173 KiB
[ebuild     U  ] dev-lang/zig-0.11.0-r1:0.11::gentoo [0.11.0:0.11::gentoo] USE="-doc" 0 KiB
[ebuild     U  ] media-libs/libpulse-16.99.1::gentoo [16.1-r4::gentoo] USE="X asyncns dbus glib -doc -gtk (-selinux) -systemd -test -valgrind" ABI_X86="(64) -32 (-x32)" 1,529 KiB
[ebuild     U  ] media-sound/pulseaudio-daemon-16.99.1::gentoo [16.1-r8::gentoo] USE="X alsa alsa-plugin asyncns bluetooth dbus elogind gdbm glib orc ssl udev webrtc-aec -aptx -equalizer -fftw -gstreamer -jack -ldac -lirc -ofono-headset (-oss) (-selinux) -sox (-system-wide) -systemd -tcpd -test -valgrind -zeroconf" 0 KiB
[blocks b      ] <media-sound/pulseaudio-daemon-16.99.1 ("<media-sound/pulseaudio-daemon-16.99.1" is soft blocking media-libs/libpulse-16.99.1)

Total: 5 packages (4 upgrades, 1 in new slot), Size of downloads: 3,560 KiB
Conflict: 1 block (all satisfied)

WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:

dev-python/setuptools-scm:0

  (dev-python/setuptools-scm-8.0.4:0/0::gentoo, ebuild scheduled for merge) USE="-test" ABI_X86="(64)" PYTHON_TARGETS="python3_11 -pypy3 -python3_10 -python3_12" conflicts with
    <dev-python/setuptools-scm-8[python_targets_python3_11(-)] required by (dev-python/setuptools_scm_git_archive-1.4-r1-4:0/0::gentoo, installed) USE="-test" ABI_X86="(64)" PYTHON_TARGETS="python3_11 -pypy3 -python3_10"
    ^                          ^                              

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/emerge", line 57, in main
    retval = emerge_main()
             ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/main.py", line 1306, in emerge_main
    return run_action(emerge_config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 4020, in run_action
    retval = action_build(emerge_config, spinner=spinner)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 475, in action_build
    mydepgraph.display_problems()
  File "/usr/lib/python3.11/site-packages/_emerge/depgraph.py", line 10593, in display_problems
    self._show_ignored_binaries()
  File "/usr/lib/python3.11/site-packages/_emerge/depgraph.py", line 1229, in _show_ignored_binaries
    self._show_ignored_binaries_respect_use(ignored_binaries["respect_use"])
  File "/usr/lib/python3.11/site-packages/_emerge/depgraph.py", line 1237, in _show_ignored_binaries_respect_use
    merging = {pkg.cpv for pkg in self._dynamic_config._displayed_list}
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/depgraph.py", line 1237, in <setcomp>
    merging = {pkg.cpv for pkg in self._dynamic_config._displayed_list}
               ^^^^^^^
AttributeError: 'Blocker' object has no attribute 'cpv'
Comment 2 matoro archtester 2023-10-27 14:35:24 UTC
Issue not present with =sys-apps/portage-3.0.53.
Comment 3 Eli Schwartz 2023-10-27 14:41:21 UTC
This is my code crashing that I added in https://github.com/gentoo/portage/pull/1148

It is supposed to filter the list (whenever it is displayed, including both with and without pretend) that follows:


```
The following binary packages have been ignored due to non matching USE:
```

I guess when I wrote it I didn't see any blocker packages ;) and I assumed that everything in that list was a Package? I seem to recall the docs suggested this too.

My bad. It should be easy to filter out with a small addition to the setcomp, though.
Comment 4 Larry the Git Cow gentoo-dev 2023-11-06 15:58:00 UTC
The bug has been referenced in the following commit(s):

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

commit a6853d5493b7bed37e60c2e3b7536b209500ba3f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-11-02 13:59:05 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-06 15:57:56 +0000

    emerge: account for EROOT in _show_ignored_binaries_respect_use
    
    Zac suggested this when reviewing the fix for bug #916336.
    
    Bug: https://bugs.gentoo.org/916336
    Signed-off-by: Sam James <sam@gentoo.org>

 lib/_emerge/depgraph.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

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

commit 262b8c9213c6698be4a7e2ce88536568899e6c2a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-10-30 05:30:04 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-06 15:57:56 +0000

    emerge: fix binpkg-respect-use notice with blockers
    
    Items in _dynamic_config._displayed_list might be blockers, so filter those out.
    
    Bug: https://bugs.gentoo.org/916336
    Fixes: bb82666b48e18f448661a1a8bf6a39b773cc4b1c
    Signed-off-by: Sam James <sam@gentoo.org>

 NEWS                                        |  2 +
 lib/_emerge/depgraph.py                     |  6 +-
 lib/portage/tests/resolver/test_useflags.py | 87 +++++++++++++++++++++++++++++
 3 files changed, 94 insertions(+), 1 deletion(-)
Comment 5 Larry the Git Cow gentoo-dev 2023-11-06 21:42:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0baf5e0bd0879f55a87111ced2140262dbec689b

commit 0baf5e0bd0879f55a87111ced2140262dbec689b
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-11-06 21:41:33 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-06 21:41:33 +0000

    sys-apps/portage: add 3.0.55
    
    Closes: https://bugs.gentoo.org/916256
    Closes: https://bugs.gentoo.org/915842
    Closes: https://bugs.gentoo.org/916247
    Closes: https://bugs.gentoo.org/916336
    Closes: https://bugs.gentoo.org/916601
    Closes: https://bugs.gentoo.org/916614
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.55.ebuild | 238 +++++++++++++++++++++++++++++++++
 2 files changed, 239 insertions(+)