Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 828966 - sys-apps/portage-3.0.29: NameError name 'self' is not defined
Summary: sys-apps/portage-3.0.29: NameError name 'self' is not defined
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:
Depends on:
Blocks:
 
Reported: 2021-12-12 00:57 UTC by Andrew Udvare
Modified: 2021-12-12 08:13 UTC (History)
1 user (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 Andrew Udvare 2021-12-12 00:57:59 UTC
I am getting a consistent error when using the ebuild command with an ebuild I am working on. There is an erroneous line in doebuild.py that references self when it probably should just call writemsg.


Reproducible: Always

Steps to Reproduce:
1. Run ebuild <ebuild that will trigger check_dyn_libs_inconsistent() returning True> install
2. It must successfully build and reach install phase
Actual Results:  
Exception in callback AsynchronousTask._exit_listener_cb(<bound method...7f8d6bdda2c0>>)
handle: <Handle AsynchronousTask._exit_listener_cb(<bound method...7f8d6bdda2c0>>)>
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.9/site-packages/_emerge/AsynchronousTask.py", line 210, in _exit_listener_cb
    listener(self)
  File "/usr/lib/python3.9/site-packages/_emerge/EbuildPhase.py", line 568, in _commands_exit
    _post_src_install_soname_symlinks(self.settings, out)
  File "/usr/lib/python3.9/site-packages/portage/package/ebuild/doebuild.py", line 3099, in _post_src_install_soname_symlinks
    self._writemsg_level(
NameError: name 'self' is not defined
Terminated

Expected Results:  
Should not fail.

Lines 3085 to 3106:

    if soname_deps.provides is not None:
        with io.open(
            _unicode_encode(
                os.path.join(build_info_dir, "PROVIDES"),
                encoding=_encodings["fs"],
                errors="strict",
            ),
            mode="w",
            encoding=_encodings["repo.content"],
            errors="strict",
        ) as f:
            f.write(soname_deps.provides)
    else:
        if check_dyn_libs_inconsistent(image_dir, soname_deps.provides):
            self._writemsg_level(
                colorize(
                    "BAD",
                    "!!! Error! Installing dynamic libraries (.so) with blank PROVIDES!",
                ),
                noiselevel=-1,
                level=logging.ERROR,
            )

This is the only time self._writemsg_level is written in this file and it is not within a class method. I think it was supposed to be writemsg.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-12 01:02:53 UTC
Thanks, fixed in git earlier, I'll make a release this evening (within next few hours). Apologies for the error.
Comment 2 Larry the Git Cow gentoo-dev 2021-12-12 08:13:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82fde90c8a9f82d2f5a18424100b0676fcb71f73

commit 82fde90c8a9f82d2f5a18424100b0676fcb71f73
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-12 08:09:20 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-12 08:13:31 +0000

    sys-apps/portage: add 3.0.30
    
    Closes: https://bugs.gentoo.org/828844
    Closes: https://bugs.gentoo.org/828966
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.30.ebuild | 267 +++++++++++++++++++++++++++++++++
 2 files changed, 268 insertions(+)