> >>> Running pre-merge checks for acct-group/adm-0 > >>> Running pre-merge checks for acct-group/wheel-0 > ^CException in callback AsynchronousTask._exit_listener_cb(<bound method...7fd3904f19d0>>) > handle: <Handle AsynchronousTask._exit_listener_cb(<bound method...7fd3904f19d0>>)> > Traceback (most recent call last): > File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run > self._context.run(self._callback, *self._args) > File "/usr/lib/python3.8/site-packages/_emerge/AsynchronousTask.py", line 201, in _exit_listener_cb > listener(self) > File "/usr/lib/python3.8/site-packages/_emerge/EbuildPhase.py", line 224, in _ebuild_exit > self._ebuild_exit_unlocked(ebuild_process) > File "/usr/lib/python3.8/site-packages/_emerge/EbuildPhase.py", line 268, in _ebuild_exit_unlocked > self._die_hooks() > File "/usr/lib/python3.8/site-packages/_emerge/EbuildPhase.py", line 376, in _die_hooks > self._start_task(die_hooks, self._die_hooks_exit) > File "/usr/lib/python3.8/site-packages/_emerge/CompositeTask.py", line 113, in _start_task > task.start() > File "/usr/lib/python3.8/site-packages/_emerge/AsynchronousTask.py", line 30, in start > self._start() > File "/usr/lib/python3.8/site-packages/_emerge/MiscFunctionsProcess.py", line 29, in _start > AbstractEbuildProcess._start(self) > File "/usr/lib/python3.8/site-packages/_emerge/AbstractEbuildProcess.py", line 169, in _start > self._start_post_builddir_lock(start_ipc_daemon=start_ipc_daemon) > File "/usr/lib/python3.8/site-packages/_emerge/AbstractEbuildProcess.py", line 200, in _start_post_builddir_lock > SpawnProcess._start(self) > File "/usr/lib/python3.8/site-packages/_emerge/SpawnProcess.py", line 132, in _start > build_logger.start() > File "/usr/lib/python3.8/site-packages/_emerge/AsynchronousTask.py", line 30, in start > self._start() > File "/usr/lib/python3.8/site-packages/portage/util/_async/BuildLogger.py", line 77, in _start > pipe_logger.start() > File "/usr/lib/python3.8/site-packages/_emerge/AsynchronousTask.py", line 30, in start > self._start() > File "/usr/lib/python3.8/site-packages/portage/util/_async/PipeLogger.py", line 36, in _start > self._log_file = open(_unicode_encode(log_file_path, > FileNotFoundError: [Errno 2] No such file or directory: b'/var/tmp/portage/acct-group/wheel-0/temp/build.log' > Terminated
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=bfe550f69ac4e0126412bc83f7e6f6f0d1c6dc1f commit bfe550f69ac4e0126412bc83f7e6f6f0d1c6dc1f Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2021-05-01 23:38:50 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-05-01 23:49:07 +0000 PipeLogger: handle FileNotFoundError when cancelled during _start Bug: https://bugs.gentoo.org/787542 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/util/_async/PipeLogger.py | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-)
(In reply to Zac Medico from comment #0) > > >>> Running pre-merge checks for acct-group/adm-0 > > >>> Running pre-merge checks for acct-group/wheel-0 > > ^CException in callback AsynchronousTask._exit_listener_cb(<bound method...7fd3904f19d0>>) > > handle: <Handle AsynchronousTask._exit_listener_cb(<bound method...7fd3904f19d0>>)> > > Traceback (most recent call last): > > File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run > > self._context.run(self._callback, *self._args) > > File "/usr/lib/python3.8/site-packages/_emerge/AsynchronousTask.py", line 201, in _exit_listener_cb > > listener(self) > > File "/usr/lib/python3.8/site-packages/_emerge/EbuildPhase.py", line 224, in _ebuild_exit > > self._ebuild_exit_unlocked(ebuild_process) > > File "/usr/lib/python3.8/site-packages/_emerge/EbuildPhase.py", line 268, in _ebuild_exit_unlocked > > self._die_hooks() It looks like it called die hooks when ${T} did not exist, which is guaranteed to fail.
We can skip die hooks if ${T} is missing, since it implies that there are no hooks to execute.
Since die hooks are called from the _ebuild_exit_unlocked method, it's not even safe to use ${T} since the build directory is not locked.
The die hooks need to be triggered from the EbuildPhase _ebuild_exit method, before the build directory is unlocked: > def _ebuild_exit(self, ebuild_process): > self._assert_current(ebuild_process) > if self._ebuild_lock is None: > self._ebuild_exit_unlocked(ebuild_process) > else: > self._start_task( > AsyncTaskFuture(future=self._ebuild_lock.async_unlock()), > functools.partial(self._ebuild_exit_unlocked, ebuild_process))