Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 918636 - sys-apps/portage-9999: possible regression in c8e599af298
Summary: sys-apps/portage-9999: possible regression in c8e599af298
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
Depends on:
Blocks: 916977
  Show dependency tree
 
Reported: 2023-11-26 23:42 UTC by Greg Kubaryk
Modified: 2023-11-28 22:52 UTC (History)
0 users

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


Attachments
output from emerge -dvuDUgj @world --with-bdeps=y (debug.txt.xz,244.07 KB, application/x-xz)
2023-11-26 23:42 UTC, Greg Kubaryk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Kubaryk 2023-11-26 23:42:45 UTC
Created attachment 875755 [details]
output from emerge -dvuDUgj @world --with-bdeps=y

After c8e599af298, pkg_pretend crashes when binpkgs print a message about pre-checks.

myparams {'recurse': True, 'binpkg_respect_use': 'auto', 'autounmask': True, 'autounmask_keep_use': False, 'autounmask_keep_license': True, 'autounmask_keep_keywords': True, 'autounmask_keep_masks': True, 'bdeps': 'y', 'ignore_soname_deps': 'y', 'dynamic_deps': True, 'implicit_system_deps': True, 'selective': True, 'deep': True, 'binpkg_changed_deps': 'auto'}

>>> Running pre-merge checks for media-libs/mesa-23.3.0_rc5

 * Fetching in the background:
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 1308, in emerge_main
    return run_action(emerge_config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 4013, in run_action
    retval = action_build(emerge_config, spinner=spinner)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/actions.py", line 677, in action_build
    retval = mergetask.merge()
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/Scheduler.py", line 1148, in merge
    rval = self._merge()
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/Scheduler.py", line 1588, in _merge
    rval = self._sched_iface.run_until_complete(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/portage/util/_eventloop/asyncio_event_loop.py", line 149, in _run_until_complete
    return self._loop.run_until_complete(future)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/_emerge/Scheduler.py", line 960, in _run_pkg_pretend
    out.einfo(l)
  File "/usr/lib/python3.11/site-packages/portage/output.py", line 690, in einfo
    self._write(out, colorize("INFO", " * ") + msg + "\n")
                     ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
TypeError: can only concatenate str (not "NoneType") to str
[ERROR] Task was destroyed but it is pending!
task: <Task cancelling name='Task-4' coro=<PipeLogger._io_loop() running at /usr/lib/python3.11/site-packages/portage/util/_async/PipeLogger.py:98> wait_for=<Future cancelled> cb=[PipeLogger._io_loop_done()]>
[ERROR] Task was destroyed but it is pending!
task: <Task cancelling name='Task-2' coro=<PipeLogger._io_loop() running at /usr/lib/python3.11/site-packages/portage/util/_async/PipeLogger.py:98> wait_for=<Future cancelled> cb=[PipeLogger._io_loop_done()]>
[ERROR] Task was destroyed but it is pending!
task: <Task cancelling name='Task-3' coro=<BuildLogger._main() done, defined at /usr/lib/python3.11/site-packages/portage/util/_async/BuildLogger.py:98> wait_for=<Future cancelled> cb=[BuildLogger._main_exit()]>
[ERROR] Task was destroyed but it is pending!
task: <Task cancelling name='Task-5' coro=<SpawnProcess._main() done, defined at /usr/lib/python3.11/site-packages/_emerge/SpawnProcess.py:187> wait_for=<Future cancelled> cb=[SpawnProcess._main_exit()]>
Comment 1 Zac Medico gentoo-dev 2023-11-27 00:06:24 UTC
It looks like fetcher.pkg_path is None, but that's strange because BinpkgFetcher initializes it in the constructor here:

lib/_emerge/BinpkgFetcher.py:        self.pkg_path = self.pkg_allocated_path + ".partial"
Comment 2 Zac Medico gentoo-dev 2023-11-27 01:12:49 UTC
It's actually a BinpkgPrefetcher instance which doesn't initialize self.pkg_path until it's started. Will fix...
Comment 3 Zac Medico gentoo-dev 2023-11-27 01:28:02 UTC
Similar code in lib/_emerge/Binpkg.py has the same bug, but it runs later there so it's harder to trigger.
Comment 4 Greg Kubaryk 2023-11-27 02:31:13 UTC
patch applies cleanly to c8e599af298 and resolves the issue
Comment 5 Larry the Git Cow gentoo-dev 2023-11-28 22:51:44 UTC
The bug has been referenced in the following commit(s):

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

commit 9b711229ef913e8772e9a3a1cce744c87ee468cf
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-11-27 01:55:04 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-11-28 22:47:53 +0000

    Cancel prefetchers that have not started yet
    
    Cancel prefetchers that have not started yet. This will cause the
    parallel-fetch SequentialTaskQueue to simply discard them, and
    a regular fetcher will be instantiated immediately. This prevents
    errors when accessing the pkg_path attribute of BinpkgPrefetcher
    instances that have not started yet.
    
    Bug: https://bugs.gentoo.org/918636
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/_emerge/Binpkg.py        | 6 +++++-
 lib/_emerge/CompositeTask.py | 8 +++++++-
 lib/_emerge/EbuildBuild.py   | 4 ++++
 lib/_emerge/Scheduler.py     | 8 +++++++-
 4 files changed, 23 insertions(+), 3 deletions(-)
Comment 6 Zac Medico gentoo-dev 2023-11-28 22:52:29 UTC
Thanks for testing!