From patchwork Fri Oct 13 15:47:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 54808 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6123E27BBE9; Fri, 13 Oct 2023 16:49:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 94FF927BBE2 for ; Fri, 13 Oct 2023 16:49:24 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrKPd-0000Ag-RD; Fri, 13 Oct 2023 11:49:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrKP8-0008Hz-NE for guix-patches@gnu.org; Fri, 13 Oct 2023 11:48:47 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrKP8-0005sD-83; Fri, 13 Oct 2023 11:48:46 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrKPP-0007NU-5y; Fri, 13 Oct 2023 11:49:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66525] [PATCH 3/7] gnu: python-dbusmock: Remove dependency on (guix build syscalls). Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, marius@gnu.org, me@bonfacemunyoki.com, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Fri, 13 Oct 2023 15:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66525 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66525@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , jgart X-Debbugs-Original-Xcc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , jgart Received: via spool by 66525-submit@debbugs.gnu.org id=B66525.169721212628201 (code B ref 66525); Fri, 13 Oct 2023 15:49:03 +0000 Received: (at 66525) by debbugs.gnu.org; 13 Oct 2023 15:48:46 +0000 Received: from localhost ([127.0.0.1]:47169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrKP8-0007Kj-0z for submit@debbugs.gnu.org; Fri, 13 Oct 2023 11:48:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrKP2-0007Ix-TR for 66525@debbugs.gnu.org; Fri, 13 Oct 2023 11:48:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrKOa-0005na-Hq; Fri, 13 Oct 2023 11:48:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=t1RT1DZq0hG7cWg6Bw2AiHlmJCh5PHtIVFoUjgwN43U=; b=AlU1EY5xSpwFfCvcYRFI +lwMvUvbp3VpQ5jw0muMoWyk8dpiuuN5jiCly1Lp04Wpo4jC9wKmBPwAL2SWYZcv1zYAizYlPn8Ho YMfMGEDWkKGf13TFwPLPuoyZyTZ45Ys9F7xsi387cAw7/i0kfMdlLL9T89SeFstU/Ipw1OHWk8Y8i jkc8KO3/ZEd22Pq4bKapsNhQm51ZS/qJ3+10KYD+9f9MyaxDB5fRhG0XQ16Do0uzvJ//dB/uFdZN+ 63HepcdEkMTD5lyc5os39c25Rqu09FNb6NwrEAXYaQiMkjyLLYVpf5S03cRhlO4cTK/4VMcW+hpPa uFAbMCKzf1goxQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 13 Oct 2023 17:47:46 +0200 Message-ID: <14bf42fc8911d464d5a9f7cadc11ba05b4f54b07.1697211312.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Having a dependency on (guix build syscalls) this deep in the stack would make it much harder to change syscalls.scm. * gnu/packages/python-xyz.scm (python-dbusmock)[native-inputs]: Remove TINY. [arguments]: Remove #:imported-modules, and remove (guix build syscalls) from #:modules. Rewrite ‘check’ phase to reap processes from the build process itself. --- gnu/packages/python-xyz.scm | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 07984adb8e..e871951def 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -27156,12 +27156,10 @@ (define-public python-dbusmock "1nwl0gzzds2g1w1gfxfzlgrkb5hr1rrdyn619ml25c6b1rjyfk3g")))) (build-system python-build-system) (arguments - `(#:imported-modules (,@%python-build-system-modules - (guix build syscalls)) - #:modules ((guix build python-build-system) - (guix build syscalls) + `(#:modules ((guix build python-build-system) (guix build utils) (ice-9 match)) + #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-paths @@ -27177,20 +27175,20 @@ (define-public python-dbusmock (when tests? (match (primitive-fork) (0 ;child process - (set-child-subreaper!) - ;; Use tini so that signals are properly handled and - ;; doubly-forked processes get reaped; otherwise, - ;; python-dbusmock would waste time polling for the dbus - ;; processes it spawns to be reaped, in vain. - (execlp "tini" "--" "pytest" "-vv")) - (pid - (match (waitpid pid) - ((_ . status) - (unless (zero? status) - (error "`pytest' exited with status" - status)))))))))))) + (execlp "pytest" "pytest" "-vv")) + (pytest-pid + (let loop () + ;; Reap child processes; otherwise, python-dbusmock would + ;; waste time polling for the dbus processes it spawns to + ;; be reaped, in vain. + (match (waitpid WAIT_ANY) + ((pid . status) + (if (= pid pytest-pid) + (unless (zero? status) + (error "`pytest' exited with status" status)) + (loop))))))))))))) (native-inputs - (list dbus python-pytest tini which)) + (list dbus python-pytest which)) (inputs (list dbus)) (propagated-inputs