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 34EE1138350 for ; Mon, 2 Mar 2020 16:53:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4B48EE082B; Mon, 2 Mar 2020 16:53:06 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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 25D42E082B for ; Mon, 2 Mar 2020 16:53:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 C15BC34F49D for ; Mon, 2 Mar 2020 16:53:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 31D24144 for ; Mon, 2 Mar 2020 16:53:02 +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: <1583167875.0bf72716cacc7f79abb61ad3ce33332c743809c9.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/package/ebuild/doebuild.py X-VCS-Directories: lib/portage/package/ebuild/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 0bf72716cacc7f79abb61ad3ce33332c743809c9 X-VCS-Branch: master Date: Mon, 2 Mar 2020 16:53:02 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7a4b7009-b55f-4b7c-8485-2f937ba6426e X-Archives-Hash: 4469c55575f510773c6c97af0a50ff93 commit: 0bf72716cacc7f79abb61ad3ce33332c743809c9 Author: Zac Medico gentoo org> AuthorDate: Mon Mar 2 16:49:33 2020 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Mar 2 16:51:15 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0bf72716 doebuild: avoid emerge --pretend --fetchonly event loop recursion Fixes: ec654122c0eb ("fetch: drop privileges early for NFS root_squash (bug 601252)") Bug: https://bugs.gentoo.org/601252 Signed-off-by: Zac Medico gentoo.org> lib/portage/package/ebuild/doebuild.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/portage/package/ebuild/doebuild.py b/lib/portage/package/ebuild/doebuild.py index 384a3e632..75fcb8a51 100644 --- a/lib/portage/package/ebuild/doebuild.py +++ b/lib/portage/package/ebuild/doebuild.py @@ -1095,8 +1095,16 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0, digests=dist_digests) loop = asyncio._safe_loop() - if not loop.run_until_complete(loop.run_in_executor(ForkExecutor(loop=loop), - _fetch_subprocess, fetchme, mysettings, listonly, dist_digests)): + if loop.is_running(): + # Called by EbuildFetchonly for emerge --pretend --fetchonly. + success = fetch(fetchme, mysettings, listonly=listonly, + fetchonly=fetchonly, allow_missing_digests=False, + digests=dist_digests) + else: + success = loop.run_until_complete( + loop.run_in_executor(ForkExecutor(loop=loop), + _fetch_subprocess, fetchme, mysettings, listonly, dist_digests)) + if not success: # Since listonly mode is called by emerge --pretend in an # asynchronous context, spawn_nofetch would trigger event loop # recursion here, therefore delegate execution of pkg_nofetch