[gentoo-commits] proj/portage:master commit in: lib/_emerge/, lib/portage/util/_async/

2024-03-04 Thread Zac Medico
commit: 6f9a10d38259dd61b948837e193b047464791845
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Mar  4 05:31:08 2024 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Mar  4 05:33:44 2024 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=6f9a10d3

SpawnProcess: Optimize away null input for create_pipe=False

When create_pipe=False support was added in commit e8b31c86eaed,
a null input file descriptor was used for PipeLogger and BuildLogger
instances. Optimize this away, eliminating the unnecessary loggers.

Fixes: e8b31c86eaed ("ForkProcess: Prevent redundant pipe and set_term_size 
recursion")
Bug: https://bugs.gentoo.org/916566
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/SpawnProcess.py| 51 +-
 lib/portage/util/_async/ForkProcess.py |  7 ++---
 2 files changed, 28 insertions(+), 30 deletions(-)

diff --git a/lib/_emerge/SpawnProcess.py b/lib/_emerge/SpawnProcess.py
index 9fc12c42e5..513a7b2fe4 100644
--- a/lib/_emerge/SpawnProcess.py
+++ b/lib/_emerge/SpawnProcess.py
@@ -79,10 +79,7 @@ class SpawnProcess(SubProcess):
 # SpawnProcess will have created a pipe earlier, so it
 # would be redundant to do it here (it could also trigger
 # spawn recursion via set_term_size as in bug 923750).
-# Use /dev/null for master_fd, triggering early return
-# of _main, followed by _async_waitpid.
-# TODO: Optimize away the need for master_fd here.
-master_fd = os.open(os.devnull, os.O_RDONLY)
+master_fd = None
 slave_fd = None
 can_log = False
 
@@ -166,23 +163,27 @@ class SpawnProcess(SubProcess):
 self._registered = True
 
 def _start_main_task(self, pr, log_file_path=None, stdout_fd=None):
-build_logger = BuildLogger(
-env=self.env,
-log_path=log_file_path,
-log_filter_file=self.log_filter_file,
-scheduler=self.scheduler,
-)
-build_logger.start()
-
-pipe_logger = PipeLogger(
-background=self.background,
-scheduler=self.scheduler,
-input_fd=pr,
-log_file_path=build_logger.stdin,
-stdout_fd=stdout_fd,
-)
-
-pipe_logger.start()
+if pr is None:
+build_logger = None
+pipe_logger = None
+else:
+build_logger = BuildLogger(
+env=self.env,
+log_path=log_file_path,
+log_filter_file=self.log_filter_file,
+scheduler=self.scheduler,
+)
+build_logger.start()
+
+pipe_logger = PipeLogger(
+background=self.background,
+scheduler=self.scheduler,
+input_fd=pr,
+log_file_path=build_logger.stdin,
+stdout_fd=stdout_fd,
+)
+
+pipe_logger.start()
 
 self._main_task_cancel = functools.partial(
 self._main_cancel, build_logger, pipe_logger
@@ -198,18 +199,18 @@ class SpawnProcess(SubProcess):
 await self._pty_ready
 self._pty_ready = None
 try:
-if pipe_logger.poll() is None:
+if pipe_logger is not None and pipe_logger.poll() is None:
 await pipe_logger.async_wait()
-if build_logger.poll() is None:
+if build_logger is not None and build_logger.poll() is None:
 await build_logger.async_wait()
 except asyncio.CancelledError:
 self._main_cancel(build_logger, pipe_logger)
 raise
 
 def _main_cancel(self, build_logger, pipe_logger):
-if pipe_logger.poll() is None:
+if pipe_logger is not None and pipe_logger.poll() is None:
 pipe_logger.cancel()
-if build_logger.poll() is None:
+if build_logger is not None and build_logger.poll() is None:
 build_logger.cancel()
 
 def _main_exit(self, main_task):

diff --git a/lib/portage/util/_async/ForkProcess.py 
b/lib/portage/util/_async/ForkProcess.py
index ebcbd94107..e6cfdefb88 100644
--- a/lib/portage/util/_async/ForkProcess.py
+++ b/lib/portage/util/_async/ForkProcess.py
@@ -91,11 +91,8 @@ class ForkProcess(SpawnProcess):
 # When called via process.spawn, SpawnProcess
 # will have created a pipe earlier, so it would be
 # redundant to do it here (it could also trigger spawn
-# recursion via set_term_size as in bug 923750). Use
-# /dev/null for master_fd, triggering early return
-# of _main, followed by _async_waitpid.
-# TODO: Optimize away the need for master_fd here.
-master_fd = os.open(os.devnull, os.O_RDONLY)
+# recursion via set_term_si

[gentoo-commits] proj/portage:master commit in: lib/_emerge/, lib/portage/util/_async/

2024-02-05 Thread Zac Medico
commit: e8b31c86eaed645a8740fb2844e2935aee161e43
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Feb  5 05:55:11 2024 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Feb  6 01:30:21 2024 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e8b31c86

ForkProcess: Prevent redundant pipe and set_term_size recursion

When process.spawn is updated to call ForkProcess
for bug 916566, it needs to avoid recursion via
set_term_size.

Bug: https://bugs.gentoo.org/916566
Bug: https://bugs.gentoo.org/923750
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/SpawnProcess.py| 31 ---
 lib/portage/util/_async/ForkProcess.py | 28 +++-
 2 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/lib/_emerge/SpawnProcess.py b/lib/_emerge/SpawnProcess.py
index 7f4a23892b..716e94d665 100644
--- a/lib/_emerge/SpawnProcess.py
+++ b/lib/_emerge/SpawnProcess.py
@@ -41,7 +41,7 @@ class SpawnProcess(SubProcess):
 )
 
 __slots__ = (
-("args", "log_filter_file")
+("args", "create_pipe", "log_filter_file")
 + _spawn_kwarg_names
 + (
 "_main_task",
@@ -60,15 +60,30 @@ class SpawnProcess(SubProcess):
 else:
 self.fd_pipes = self.fd_pipes.copy()
 fd_pipes = self.fd_pipes
+log_file_path = None
 
 if fd_pipes or self.logfile or not self.background:
-master_fd, slave_fd = self._pipe(fd_pipes)
+if self.create_pipe is not False:
+master_fd, slave_fd = self._pipe(fd_pipes)
 
-can_log = self._can_log(slave_fd)
-if can_log:
-log_file_path = self.logfile
+can_log = self._can_log(slave_fd)
+if can_log:
+log_file_path = self.logfile
 else:
-log_file_path = None
+if self.logfile:
+raise NotImplementedError(
+"logfile conflicts with create_pipe=False"
+)
+# When called via process.spawn and ForkProcess._start,
+# SpawnProcess will have created a pipe earlier, so it
+# would be redundant to do it here (it could also trigger
+# spawn recursion via set_term_size as in bug 923750).
+# Use /dev/null for master_fd, triggering early return
+# of _main, followed by _async_waitpid.
+# TODO: Optimize away the need for master_fd here.
+master_fd = os.open(os.devnull, os.O_RDONLY)
+slave_fd = None
+can_log = False
 
 null_input = None
 if not self.background or 0 in fd_pipes:
@@ -97,7 +112,9 @@ class SpawnProcess(SubProcess):
 
 fd_pipes_orig = fd_pipes.copy()
 
-if log_file_path is not None or self.background:
+if slave_fd is None:
+pass
+elif log_file_path is not None or self.background:
 fd_pipes[1] = slave_fd
 fd_pipes[2] = slave_fd
 

diff --git a/lib/portage/util/_async/ForkProcess.py 
b/lib/portage/util/_async/ForkProcess.py
index 3acbe34fc6..cb240d0712 100644
--- a/lib/portage/util/_async/ForkProcess.py
+++ b/lib/portage/util/_async/ForkProcess.py
@@ -75,12 +75,29 @@ class ForkProcess(SpawnProcess):
 self.fd_pipes.setdefault(0, portage._get_stdin().fileno())
 self.fd_pipes.setdefault(1, sys.__stdout__.fileno())
 self.fd_pipes.setdefault(2, sys.__stderr__.fileno())
-stdout_fd = os.dup(self.fd_pipes[1])
+if self.create_pipe is not False:
+stdout_fd = os.dup(self.fd_pipes[1])
 
 if self._HAVE_SEND_HANDLE:
-master_fd, slave_fd = self._pipe(self.fd_pipes)
-self.fd_pipes[1] = slave_fd
-self.fd_pipes[2] = slave_fd
+if self.create_pipe is not False:
+master_fd, slave_fd = self._pipe(self.fd_pipes)
+self.fd_pipes[1] = slave_fd
+self.fd_pipes[2] = slave_fd
+else:
+if self.logfile:
+raise NotImplementedError(
+"logfile conflicts with create_pipe=False"
+)
+# When called via process.spawn, SpawnProcess
+# will have created a pipe earlier, so it would be
+# redundant to do it here (it could also trigger spawn
+# recursion via set_term_size as in bug 923750). Use
+# /dev/null for master_fd, triggering early return
+# of _main, followed by _async_waitpid.
+# TODO: Optimize away the need for master_fd here.
+master_fd = os.open(os.devnull, os.O_RDONLY)
+   

[gentoo-commits] proj/portage:master commit in: lib/_emerge/, lib/portage/util/_async/

2021-09-20 Thread Zac Medico
commit: 5d61d0f8d72b27213896f052ef4abb2337b922bf
Author: Zac Medico  gentoo  org>
AuthorDate: Tue Sep 21 04:53:52 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Sep 21 05:33:50 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=5d61d0f8

Binpkg: convert compat coroutine to async

Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/Binpkg.py  | 10 --
 lib/portage/util/_async/AsyncTaskFuture.py |  4 +++-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/_emerge/Binpkg.py b/lib/_emerge/Binpkg.py
index 0f37063f0..c7dde69bd 100644
--- a/lib/_emerge/Binpkg.py
+++ b/lib/_emerge/Binpkg.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import functools
@@ -15,7 +15,6 @@ from _emerge.SpawnProcess import SpawnProcess
 from portage.eapi import eapi_exports_replace_vars
 from portage.util import ensure_dirs
 from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
-from portage.util.futures.compat_coroutine import coroutine
 import portage
 from portage import os
 from portage import shutil
@@ -305,8 +304,7 @@ class Binpkg(CompositeTask):
 self._unpack_metadata_exit,
 )
 
-@coroutine
-def _unpack_metadata(self, loop=None):
+async def _unpack_metadata(self, loop=None):
 
 dir_path = self.settings["PORTAGE_BUILDDIR"]
 
@@ -327,7 +325,7 @@ class Binpkg(CompositeTask):
 portage.prepare_build_dirs(self.settings["ROOT"], self.settings, 1)
 self._writemsg_level(">>> Extracting info\n")
 
-yield self._bintree.dbapi.unpack_metadata(
+await self._bintree.dbapi.unpack_metadata(
 self.settings, infloc, loop=self.scheduler
 )
 check_missing_metadata = ("CATEGORY", "PF")
@@ -378,7 +376,7 @@ class Binpkg(CompositeTask):
 background=self.background, scheduler=self.scheduler, 
settings=self.settings
 )
 env_extractor.start()
-yield env_extractor.async_wait()
+await env_extractor.async_wait()
 if env_extractor.returncode != os.EX_OK:
 raise portage.exception.PortageException(
 "failed to extract environment for {}".format(self.pkg.cpv)

diff --git a/lib/portage/util/_async/AsyncTaskFuture.py 
b/lib/portage/util/_async/AsyncTaskFuture.py
index f87a7f90a..0cd034c97 100644
--- a/lib/portage/util/_async/AsyncTaskFuture.py
+++ b/lib/portage/util/_async/AsyncTaskFuture.py
@@ -1,10 +1,11 @@
-# Copyright 2018 Gentoo Foundation
+# Copyright 2018-2021 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import os
 import signal
 
 from _emerge.AsynchronousTask import AsynchronousTask
+from portage.util.futures import asyncio
 
 
 class AsyncTaskFuture(AsynchronousTask):
@@ -16,6 +17,7 @@ class AsyncTaskFuture(AsynchronousTask):
 __slots__ = ("future",)
 
 def _start(self):
+self.future = asyncio.ensure_future(self.future, self.scheduler)
 self.future.add_done_callback(self._done_callback)
 
 def _cancel(self):



[gentoo-commits] proj/portage:master commit in: lib/_emerge/, lib/portage/util/_async/

2021-03-07 Thread Zac Medico
commit: 77e545e0955930606eb7e73d3970d8c0706fd8a8
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Mar  7 14:55:49 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Mar  7 15:12:42 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=77e545e0

EbuildPhase: Use async and await syntax

Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/EbuildPhase.py| 28 ---
 lib/portage/util/_async/SchedulerInterface.py | 10 --
 2 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py
index e4c0428a6..26c770d29 100644
--- a/lib/_emerge/EbuildPhase.py
+++ b/lib/_emerge/EbuildPhase.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import functools
@@ -21,7 +21,6 @@ from portage.util._dyn_libs.soname_deps_qa import (
 )
 from portage.package.ebuild.prepare_build_dirs import (_prepare_workdir,
_prepare_fake_distdir, _prepare_fake_filesdir)
-from portage.util.futures.compat_coroutine import coroutine
 from portage.util import writemsg
 from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
 from portage.util._async.BuildLogger import BuildLogger
@@ -70,11 +69,10 @@ class EbuildPhase(CompositeTask):
_locked_phases = ("setup", "preinst", "postinst", "prerm", "postrm")
 
def _start(self):
-   future = 
asyncio.ensure_future(self._async_start(loop=self.scheduler), 
loop=self.scheduler)
+   future = asyncio.ensure_future(self._async_start(), 
loop=self.scheduler)
self._start_task(AsyncTaskFuture(future=future), 
self._async_start_exit)
 
-   @coroutine
-   def _async_start(self, loop=None):
+   async def _async_start(self):
 
need_builddir = self.phase not in 
EbuildProcess._phases_without_builddir
 
@@ -132,7 +130,7 @@ class EbuildPhase(CompositeTask):
# Force background=True for this header since it's 
intended
# for the log and it doesn't necessarily need to be 
visible
# elsewhere.
-   yield self._elog('einfo', msg, background=True, 
loop=self.scheduler)
+   await self._elog('einfo', msg, background=True)
 
if self.phase == 'package':
if 'PORTAGE_BINPKG_TMPFILE' not in self.settings:
@@ -402,8 +400,7 @@ class EbuildPhase(CompositeTask):
self.returncode = 1
self.wait()
 
-   @coroutine
-   def _elog(self, elog_funcname, lines, background=None, loop=None):
+   async def _elog(self, elog_funcname, lines, background=None):
if background is None:
background = self.background
out = io.StringIO()
@@ -434,12 +431,12 @@ class EbuildPhase(CompositeTask):

_set_nonblocking(build_logger.stdin.fileno())
log_file = build_logger.stdin
 
-   yield self.scheduler.async_output(msg, 
log_file=log_file,
-   background=background, 
loop=self.scheduler)
+   await self.scheduler.async_output(msg, 
log_file=log_file,
+   background=background)
 
if build_logger is not None:
build_logger.stdin.close()
-   yield build_logger.async_wait()
+   await build_logger.async_wait()
except asyncio.CancelledError:
if build_logger is not None:
build_logger.cancel()
@@ -487,7 +484,7 @@ class _PostPhaseCommands(CompositeTask):
 
if 'qa-unresolved-soname-deps' in 
self.settings.features:
# This operates on REQUIRES metadata generated 
by the above function call.
-   future = 
asyncio.ensure_future(self._soname_deps_qa(loop=self.scheduler), 
loop=self.scheduler)
+   future = 
asyncio.ensure_future(self._soname_deps_qa(), loop=self.scheduler)
# If an unexpected exception occurs, then this 
will raise it.
future.add_done_callback(lambda future: 
future.cancelled() or future.result())

self._start_task(AsyncTaskFuture(future=future), self._default_final_exit)
@@ -496,12 +493,11 @@ class _PostPhaseCommands(CompositeTask):
else:
self._default_final_exit(task)
 
-   @coroutine
-   def _soname_deps_qa(self, loop=None):
+   async def _soname_deps_qa(self):

[gentoo-commits] proj/portage:master commit in: lib/_emerge/, lib/portage/util/_async/, lib/portage/package/ebuild/_config/, ...

2020-04-07 Thread Zac Medico
commit: 17df30bdfb72a157f9e34f3c2efa1e59389861d4
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Apr  8 04:34:56 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Apr  8 05:29:45 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=17df30bd

Revert "Rename PORTAGE_LOG_FILTER_FILE_CMD from PORTAGE_LOG_FILTER_FILE"

This reverts commit e24859eaa03ec86e10d842296f5570dd98bed4b7.

Bug: https://bugs.gentoo.org/716636
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/AbstractEbuildProcess.py   | 2 +-
 lib/_emerge/EbuildPhase.py | 2 +-
 lib/portage/package/ebuild/_config/special_env_vars.py | 4 ++--
 lib/portage/util/_async/BuildLogger.py | 2 +-
 man/make.conf.5| 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/_emerge/AbstractEbuildProcess.py 
b/lib/_emerge/AbstractEbuildProcess.py
index cc1ea0f1a..6b2c2f81b 100644
--- a/lib/_emerge/AbstractEbuildProcess.py
+++ b/lib/_emerge/AbstractEbuildProcess.py
@@ -181,7 +181,7 @@ class AbstractEbuildProcess(SpawnProcess):
null_fd = os.open('/dev/null', os.O_RDONLY)
self.fd_pipes[0] = null_fd
 
-   self.log_filter_file = 
self.settings.get('PORTAGE_LOG_FILTER_FILE_CMD')
+   self.log_filter_file = 
self.settings.get('PORTAGE_LOG_FILTER_FILE')
 
try:
yield SpawnProcess._async_start(self)

diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py
index fbb040ffd..927a74b98 100644
--- a/lib/_emerge/EbuildPhase.py
+++ b/lib/_emerge/EbuildPhase.py
@@ -420,7 +420,7 @@ class EbuildPhase(CompositeTask):
if log_path:
build_logger = 
BuildLogger(env=self.settings.environ(),
log_path=log_path,
-   
log_filter_file=self.settings.get('PORTAGE_LOG_FILTER_FILE_CMD'),
+   
log_filter_file=self.settings.get('PORTAGE_LOG_FILTER_FILE'),
scheduler=self.scheduler)
yield build_logger.async_start()
log_file = build_logger.stdin

diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py 
b/lib/portage/package/ebuild/_config/special_env_vars.py
index c6f88f08c..dd8105123 100644
--- a/lib/portage/package/ebuild/_config/special_env_vars.py
+++ b/lib/portage/package/ebuild/_config/special_env_vars.py
@@ -175,7 +175,7 @@ environ_filter += [
"PORTAGE_RO_DISTDIRS",
"PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
"PORTAGE_RSYNC_RETRIES", "PORTAGE_SSH_OPTS", "PORTAGE_SYNC_STALE",
-   "PORTAGE_USE", "PORTAGE_LOG_FILTER_FILE_CMD",
+   "PORTAGE_USE", "PORTAGE_LOG_FILTER_FILE",
"PORTAGE_LOGDIR", "PORTAGE_LOGDIR_CLEAN",
"QUICKPKG_DEFAULT_OPTS", "REPOMAN_DEFAULT_OPTS",
"RESUMECOMMAND", "RESUMECOMMAND_FTP",
@@ -205,7 +205,7 @@ default_globals = {
 }
 
 validate_commands = ('PORTAGE_BZIP2_COMMAND', 'PORTAGE_BUNZIP2_COMMAND',
-   'PORTAGE_LOG_FILTER_FILE_CMD',
+   'PORTAGE_LOG_FILTER_FILE',
 )
 
 # To enhance usability, make some vars case insensitive

diff --git a/lib/portage/util/_async/BuildLogger.py 
b/lib/portage/util/_async/BuildLogger.py
index 49f1321fb..4873d9750 100644
--- a/lib/portage/util/_async/BuildLogger.py
+++ b/lib/portage/util/_async/BuildLogger.py
@@ -14,7 +14,7 @@ class BuildLogger(AsynchronousTask):
Write to a log file, with compression support provided by PipeLogger.
If the log_filter_file parameter is specified, then it is interpreted
as a command to execute which filters log output (see the
-   PORTAGE_LOG_FILTER_FILE_CMD variable in make.conf(5)). The stdin 
property
+   PORTAGE_LOG_FILTER_FILE variable in make.conf(5)). The stdin property
provides access to a writable binary file stream (refers to a pipe)
that log content should be written to (usually redirected from
subprocess stdout and stderr streams).

diff --git a/man/make.conf.5 b/man/make.conf.5
index 467a9d394..baecd283a 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -979,7 +979,7 @@ with an integer pid. For example, a value of "ionice \-c 3 
\-p \\${PID}"
 will set idle io priority. For more information about ionice, see
 \fBionice\fR(1). This variable is unset by default.
 .TP
-.B PORTAGE_LOG_FILTER_FILE_CMD
+.B PORTAGE_LOG_FILTER_FILE
 This variable specifies a command that filters build log output to a
 log file. In order to filter ANSI escape codes from build logs,
 \fBansifilter\fR(1) is a convenient setting for this variable.



[gentoo-commits] proj/portage:master commit in: lib/_emerge/, lib/portage/util/_async/, lib/portage/tests/util/futures/, ...

2020-04-07 Thread Zac Medico
commit: 28adac2b67f46e11b4cf9116761d888e91e55f3c
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Apr  8 05:00:56 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Apr  8 05:29:48 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=28adac2b

Revert "SpawnProcess: use async_start method (bug 709746)"

This reverts commit 5c40c3e7ec180c9c7d1eea521d69487177c7f519.

Bug: https://bugs.gentoo.org/716636
Signed-off-by: Zac Medico  gentoo.org>

 lib/_emerge/AbstractEbuildProcess.py  |  2 +-
 lib/_emerge/AsynchronousLock.py   | 15 +++
 lib/_emerge/BinpkgExtractorAsync.py   |  9 ++---
 lib/_emerge/BinpkgFetcher.py  |  9 ++---
 lib/_emerge/EbuildFetcher.py  |  9 ++---
 lib/_emerge/SpawnProcess.py   |  8 ++--
 lib/portage/dbapi/bintree.py  |  4 ++--
 lib/portage/tests/util/futures/test_iter_completed.py |  6 +-
 lib/portage/util/_async/AsyncFunction.py  |  9 ++---
 lib/portage/util/_async/FileDigester.py   |  9 ++---
 10 files changed, 19 insertions(+), 61 deletions(-)

diff --git a/lib/_emerge/AbstractEbuildProcess.py 
b/lib/_emerge/AbstractEbuildProcess.py
index 09b76830d..fd8a40cc1 100644
--- a/lib/_emerge/AbstractEbuildProcess.py
+++ b/lib/_emerge/AbstractEbuildProcess.py
@@ -182,7 +182,7 @@ class AbstractEbuildProcess(SpawnProcess):
self.fd_pipes[0] = null_fd
 
try:
-   yield SpawnProcess._async_start(self)
+   SpawnProcess._start(self)
finally:
if null_fd is not None:
os.close(null_fd)

diff --git a/lib/_emerge/AsynchronousLock.py b/lib/_emerge/AsynchronousLock.py
index 9efaaceac..aed1bcb15 100644
--- a/lib/_emerge/AsynchronousLock.py
+++ b/lib/_emerge/AsynchronousLock.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2020 Gentoo Authors
+# Copyright 2010-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import fcntl
@@ -21,7 +21,6 @@ from portage.exception import TryAgain
 from portage.localization import _
 from portage.locks import lockfile, unlockfile
 from portage.util import writemsg_level
-from portage.util.futures.compat_coroutine import coroutine
 from _emerge.AbstractPollTask import AbstractPollTask
 from _emerge.AsynchronousTask import AsynchronousTask
 from _emerge.SpawnProcess import SpawnProcess
@@ -44,10 +43,6 @@ class AsynchronousLock(AsynchronousTask):
_use_process_by_default = True
 
def _start(self):
-   self.scheduler.run_until_complete(self._async_start())
-
-   @coroutine
-   def _async_start(self):
 
if not self._force_async:
try:
@@ -70,7 +65,7 @@ class AsynchronousLock(AsynchronousTask):
_force_dummy=self._force_dummy)
 
self._imp.addExitListener(self._imp_exit)
-   yield self._imp.async_start()
+   self._imp.start()
 
def _imp_exit(self, imp):
# call exit listeners
@@ -188,10 +183,6 @@ class _LockProcess(AbstractPollTask):
('_acquired', '_kill_test', '_proc', '_files', '_unlock_future')
 
def _start(self):
-   self.scheduler.run_until_complete(self._async_start())
-
-   @coroutine
-   def _async_start(self):
in_pr, in_pw = os.pipe()
out_pr, out_pw = os.pipe()
self._files = {}
@@ -220,7 +211,7 @@ class _LockProcess(AbstractPollTask):
fd_pipes={0:out_pr, 1:in_pw, 
2:sys.__stderr__.fileno()},
scheduler=self.scheduler)
self._proc.addExitListener(self._proc_exit)
-   yield self._proc.async_start()
+   self._proc.start()
os.close(out_pr)
os.close(in_pw)
 

diff --git a/lib/_emerge/BinpkgExtractorAsync.py 
b/lib/_emerge/BinpkgExtractorAsync.py
index 5f4caa794..3733bdeb5 100644
--- a/lib/_emerge/BinpkgExtractorAsync.py
+++ b/lib/_emerge/BinpkgExtractorAsync.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import logging
@@ -10,7 +10,6 @@ from portage.util.compression_probe import (
compression_probe,
_compressors,
 )
-from portage.util.futures.compat_coroutine import coroutine
 from portage.process import find_binary
 from portage.util import (
shlex_split,
@@ -28,10 +27,6 @@ class BinpkgExtractorAsync(SpawnProcess):
_shell_binary = portage.const.BASH_BINARY
 
def _start(self):
-   self.scheduler.run_until_complete(self._async_start())
-
-   @coroutine
-   def _async_start(self):