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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 90285158089 for ; Sun, 22 Oct 2023 22:46:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CC6492BC013; Sun, 22 Oct 2023 22:46:26 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AB8D52BC013 for ; Sun, 22 Oct 2023 22:46:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8E3EE335CA6 for ; Sun, 22 Oct 2023 22:46:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AF03F1105 for ; Sun, 22 Oct 2023 22:46:23 +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: <1698014702.e9d6782ca18b2f30d97b4859419bf7da4da01bab.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: e9d6782ca18b2f30d97b4859419bf7da4da01bab X-VCS-Branch: master Date: Sun, 22 Oct 2023 22:46:23 +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: 18ebb7b4-191d-4cec-aeda-353c5882161a X-Archives-Hash: c8051d479597b308f37ed00780427f94 commit: e9d6782ca18b2f30d97b4859419bf7da4da01bab Author: Zac Medico gentoo org> AuthorDate: Sun Oct 22 21:24:47 2023 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Oct 22 22:45:02 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9d6782c doebuild: Make _fetch_subprocess compatible with spawn Before it failed like this with the multiprocessing spawn start method: AttributeError: Can't pickle local object 'doebuild.._fetch_subprocess' Bug: https://bugs.gentoo.org/916139 Signed-off-by: Zac Medico gentoo.org> lib/portage/package/ebuild/doebuild.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/portage/package/ebuild/doebuild.py b/lib/portage/package/ebuild/doebuild.py index b967fc061f..ba166173a8 100644 --- a/lib/portage/package/ebuild/doebuild.py +++ b/lib/portage/package/ebuild/doebuild.py @@ -1305,21 +1305,6 @@ def doebuild( if mf is not None: dist_digests = mf.getTypeDigests("DIST") - def _fetch_subprocess(fetchme, mysettings, listonly, dist_digests): - # For userfetch, drop privileges for the entire fetch call, in - # order to handle DISTDIR on NFS with root_squash for bug 601252. - if _want_userfetch(mysettings): - _drop_privs_userfetch(mysettings) - - return fetch( - fetchme, - mysettings, - listonly=listonly, - fetchonly=fetchonly, - allow_missing_digests=False, - digests=dist_digests, - ) - loop = asyncio._safe_loop() if loop.is_running(): # Called by EbuildFetchonly for emerge --pretend --fetchonly. @@ -1340,6 +1325,7 @@ def doebuild( mysettings, listonly, dist_digests, + fetchonly, ) ) if not success: @@ -1589,6 +1575,22 @@ def doebuild( portage._doebuild_manifest_exempt_depend -= 1 +def _fetch_subprocess(fetchme, mysettings, listonly, dist_digests, fetchonly): + # For userfetch, drop privileges for the entire fetch call, in + # order to handle DISTDIR on NFS with root_squash for bug 601252. + if _want_userfetch(mysettings): + _drop_privs_userfetch(mysettings) + + return fetch( + fetchme, + mysettings, + listonly=listonly, + fetchonly=fetchonly, + allow_missing_digests=False, + digests=dist_digests, + ) + + def _check_temp_dir(settings): if "PORTAGE_TMPDIR" not in settings or not os.path.isdir( settings["PORTAGE_TMPDIR"]