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 734B3138262 for ; Wed, 18 May 2016 16:33:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AA365E087C; Wed, 18 May 2016 16:33:11 +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 4B590E087C for ; Wed, 18 May 2016 16:33:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D87BB33BEE9 for ; Wed, 18 May 2016 16:33:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B80D8964 for ; Wed, 18 May 2016 16:33:07 +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: <1463589098.c5c5cabc4e25922710a911833cae69ad0ee2ef7a.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/EbuildBuild.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: c5c5cabc4e25922710a911833cae69ad0ee2ef7a X-VCS-Branch: master Date: Wed, 18 May 2016 16:33:07 +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: 3714c5e8-5e86-432c-9be4-eb08ac10a7f3 X-Archives-Hash: 64b565f691db351ca76e76fc3e9e951d commit: c5c5cabc4e25922710a911833cae69ad0ee2ef7a Author: Zac Medico gentoo org> AuthorDate: Sat Mar 26 22:52:44 2016 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed May 18 16:31:38 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c5c5cabc EbuildBuild: call _record_binpkg_info earlier (bug 578204) Schedule _record_binpkg_info as a member of a TaskSequence, in order to guarantee that it executes immediately after EbuildBinpkg (and before the tasks that follow). 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 Acked-by: Alexander Berntsen gentoo.org> pym/_emerge/EbuildBuild.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 95c14e4..001f55f 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,19 @@ class EbuildBuild(CompositeTask): self._final_exit(build) self.wait() + class _RecordBinpkgInfo(AsynchronousTask): + """ + This class wraps the EbuildBuild _record_binpkg_info method + with an AsynchronousTask interface, so that it can be + scheduled as a member of a TaskSequence. + """ + + __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