From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 385EA1382C5 for ; Sun, 13 May 2018 05:04:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 81F35E09FB; Sun, 13 May 2018 05:04:25 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 59A71E09FB for ; Sun, 13 May 2018 05:04:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8B380335C94 for ; Sun, 13 May 2018 05:04:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 55DFB3E for ; Sun, 13 May 2018 05:04:22 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1526187201.5497d9033e180a759ed97e5aab920d6ec6ea26cd.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/EbuildFetcher.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 5497d9033e180a759ed97e5aab920d6ec6ea26cd X-VCS-Branch: master Date: Sun, 13 May 2018 05:04:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e3281543-61a7-4b59-8fbe-ebbb89064fa3 X-Archives-Hash: 98407e0246945c6845a221a1fc818ffb commit: 5497d9033e180a759ed97e5aab920d6ec6ea26cd Author: Zac Medico gentoo org> AuthorDate: Sun May 13 04:52:47 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun May 13 04:53:21 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5497d903 _EbuildFetcherProcess: fix event loop recursion (bug 655378) Get SRC_URI metadata asynchronously in order to avoid event loop recursion in doebuild_environment. Bug: https://bugs.gentoo.org/655378 pym/_emerge/EbuildFetcher.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py index 7c2cb3a58..3b30ebb59 100644 --- a/pym/_emerge/EbuildFetcher.py +++ b/pym/_emerge/EbuildFetcher.py @@ -60,13 +60,26 @@ class EbuildFetcher(CompositeTask): self._async_wait() return + # First get the SRC_URI metadata (it's not cached in self.pkg.metadata + # because some packages have an extremely large SRC_URI value). + self._start_task( + AsyncTaskFuture( + future=self.pkg.root_config.trees["porttree"].dbapi.\ + async_aux_get(self.pkg.cpv, ["SRC_URI"], myrepo=self.pkg.repo, + loop=self.scheduler)), + self._start_with_metadata) + + def _start_with_metadata(self, aux_get_task): + self._assert_current(aux_get_task) + self._fetcher_proc.src_uri, = aux_get_task.future.result() self._start_task(self._fetcher_proc, self._default_final_exit) class _EbuildFetcherProcess(ForkProcess): __slots__ = ("config_pool", "ebuild_path", "fetchonly", "fetchall", - "pkg", "prefetch", "_digests", "_manifest", "_settings", "_uri_map") + "pkg", "prefetch", "src_uri", "_digests", "_manifest", + "_settings", "_uri_map") def async_already_fetched(self, settings): result = self.scheduler.create_future() @@ -172,6 +185,7 @@ class _EbuildFetcherProcess(ForkProcess): settings = self.config_pool.allocate() settings.setcpv(self.pkg) + settings.configdict["pkg"]["SRC_URI"] = self.src_uri portage.doebuild_environment(ebuild_path, 'fetch', settings=settings, db=portdb)