From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5814A59CA9 for ; Sun, 27 Mar 2016 00:13:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9D20E21C03B; Sun, 27 Mar 2016 00:13:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 287F721C027 for ; Sun, 27 Mar 2016 00:13:54 +0000 (UTC) Received: from localhost.localdomain (ip68-5-185-102.oc.oc.cox.net [68.5.185.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 3D8D63409D0; Sun, 27 Mar 2016 00:13:52 +0000 (UTC) From: Zac Medico To: gentoo-portage-dev@lists.gentoo.org Cc: Zac Medico Subject: [gentoo-portage-dev] [PATCH v2] EbuildBuild: call _record_binpkg_info earlier (bug 578204) Date: Sat, 26 Mar 2016 17:13:28 -0700 Message-Id: <1459037608-21109-1-git-send-email-zmedico@gentoo.org> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1459035602-5898-1-git-send-email-zmedico@gentoo.org> References: <1459035602-5898-1-git-send-email-zmedico@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: 2ffce1bb-3ba3-4b13-9887-c326dae3f3db X-Archives-Hash: 8d432b1b008ca347139804066a2a726c Replace exit listener usage with a TaskSequence instance, in order to guarantee that _record_binpkg_info executes immediately after EbuildBinpkg. This approach is similar to that used to fix bug 562264. X-Gentoo-bug: 578204 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=578204 --- [PATCH v2] Eliminated nested TaskSequence instance. pym/_emerge/EbuildBuild.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 95c14e4..ac786b0 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import io import _emerge.emergelog +from _emerge.AsynchronousTask import AsynchronousTask from _emerge.EbuildExecuter import EbuildExecuter from _emerge.EbuildPhase import EbuildPhase from _emerge.EbuildBinpkg import EbuildBinpkg @@ -325,8 +326,12 @@ class EbuildBuild(CompositeTask): pkg=self.pkg, scheduler=self.scheduler, settings=self.settings) binpkg_tasks.add(task) - task.addExitListener( - self._record_binpkg_info) + # Guarantee that _record_binpkg_info is called + # immediately after EbuildBinpkg. Note that + # task.addExitListener does not provide the + # necessary guarantee (see bug 578204). + binpkg_tasks.add(self._RecordBinpkgInfo( + ebuild_binpkg=task, ebuild_build=self)) if binpkg_tasks: self._start_task(binpkg_tasks, self._buildpkg_exit) @@ -335,6 +340,14 @@ class EbuildBuild(CompositeTask): self._final_exit(build) self.wait() + class _RecordBinpkgInfo(AsynchronousTask): + + __slots__ = ('ebuild_binpkg', 'ebuild_build',) + + def _start(self): + self.ebuild_build._record_binpkg_info(self.ebuild_binpkg) + AsynchronousTask._start(self) + def _buildpkg_exit(self, packager): """ Released build dir lock when there is a failure or -- 2.7.2