From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4HE3MPeLWGc4kQAAqHPOHw:P1 (envelope-from ) for ; Tue, 10 Dec 2024 18:44:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 4HE3MPeLWGc4kQAAqHPOHw (envelope-from ) for ; Tue, 10 Dec 2024 19:44:07 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=TBVm3O+B; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=D4yCmHJL; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733856247; a=rsa-sha256; cv=none; b=i/ha/aSsW3LeesCZXIBc/xAMcumXsNXDwE4GcZXGs7PV/lSpkp4z1Uma8Z1m2V6e7Fbit+ oDChdpRb3jcfC1LP+wJvEi4iXGPChG6E/jby+QfW3i4v0rNjdQ+CuF7JXmD9slouEERwMj SHrwa6um/3xjFJL6+fGBPXoPbnwfBetRtxNp/W96UExDTOyESQf93miNQBWsr/SIt2Fbg5 V+wt0BUNLZTJMUvqZm8gh7tbIQolPFe/OME5Br/ws3ayfp6G636hDavBFrHz3e52ILAcnt 8YquOavEXgOvaX/g3SpkH/Pkt+4O3ZzIMjEm5rYegXOsrkGD1qTr4Vy2K6tILw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=TBVm3O+B; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=D4yCmHJL; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733856247; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=fnUD2hNVUiEeHN5cg1ybkqeIOGWLCH/BRQuj92TH4Bg=; b=jLaH0LoUFh8IiCRx17vyUQYJ6SRfA6f9xDEPxkCUXz9iNsON6ORe5w0YyPigAthZWUr816 YoeKuOyv3FPnU+UMjdy064Bl8ev2LYVK6XxeaG9Kns6Sv1lUyMRZlKqP1cnA3oaJ25iCuC O4Xmt4sfuXSa4Fq/PF4m7nIgwoGY5oyGohpcbPud4srj8lfg6iZOAWzw5uuJOya4OdiEhd fuILusPLiM2X/3UDQxe7sBy1BzSyuHY7LZrNIhrnvOyINLg1sqZeOWtqldeT4IIdsNBfrL 1G3kQ0wivf1mW0kH8Igighp+Wjs1tuclqMO2QbrBf6w/ZOihk5gMgtYZJkOziw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 14AB784202 for ; Tue, 10 Dec 2024 19:44:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tL2KR-0001Zm-D4; Tue, 10 Dec 2024 10:39:15 -0500 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 1tL2KH-0001Z8-9j for guix-patches@gnu.org; Tue, 10 Dec 2024 10:39:05 -0500 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 1tL2KF-0001Oz-67 for guix-patches@gnu.org; Tue, 10 Dec 2024 10:39:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=fnUD2hNVUiEeHN5cg1ybkqeIOGWLCH/BRQuj92TH4Bg=; b=TBVm3O+BmZNLboQeW4G7wuv095tuQyxbaslj+HxUqvtzumj06hECui4nRw6I/peW3Gz8ITMFbtwn4OcL99CQ//PobOrEFhPWrgsMuHohwJXGTNOEvHvPhKgVp8vit62qXP24BwhADEZa7ZQFJHvdhcMlusTkA+xvmXknc9JdPwcXR4YwHNPPTgu/UVQbIpKFFgh5OrRmEMOleDWZVV4udc2TV26lT5bE41Q/mC9twAhSP0k3ZVjXgigDFOg7UDmnPr13d1L6iFHXYo/fuJvCLelBVHj0xhMHsfWIhyLmQWqUjxevkLk4vcWUC69ZT0a2S3eJepCI3d2dHkcVdNBTMA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tL2KE-0007e6-0b for guix-patches@gnu.org; Tue, 10 Dec 2024 10:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74767] [PATCH rust-team 02/23] build/cargo: Honor #:parallel-build? and #:parallel-tests? arguments. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Dec 2024 15:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74767 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 74767@debbugs.gnu.org Received: via spool by 74767-submit@debbugs.gnu.org id=B74767.173384510929266 (code B ref 74767); Tue, 10 Dec 2024 15:39:01 +0000 Received: (at 74767) by debbugs.gnu.org; 10 Dec 2024 15:38:29 +0000 Received: from localhost ([127.0.0.1]:59130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tL2Jg-0007bx-FR for submit@debbugs.gnu.org; Tue, 10 Dec 2024 10:38:28 -0500 Received: from mail-wm1-f44.google.com ([209.85.128.44]:54418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tL2Jc-0007bg-Na for 74767@debbugs.gnu.org; Tue, 10 Dec 2024 10:38:26 -0500 Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-434ab114753so38245915e9.0 for <74767@debbugs.gnu.org>; Tue, 10 Dec 2024 07:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733845044; x=1734449844; darn=debbugs.gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=fnUD2hNVUiEeHN5cg1ybkqeIOGWLCH/BRQuj92TH4Bg=; b=D4yCmHJLM1tj1jyJBqNL/NEQu2kLFHUFfkNKqf8xyMlLH/s+ZeXmC01rvMcdlZn4Jh 3OWevyGIxGTKPARtJxnCBXw5OenN6xpD26rtntgEwKRq57VCh0DZBIPf7LuAbSzLms9z ALT1G8soAHoZvFQd/l3iKCqvbqpDUdkLxmKooNZ81T++t3iamlUI330zqmVWLH7oACF8 6/KV2/IkhVZZ7FD+n2b1/8wlpeL5qjLQeHp/7IVY9V7v8A9DqwFbAYzjVDXpXZKh3UtG iykwaNE+cMav/7TmTQS1TRwJpRjA6ll0eiWMw5xVkVgPFADUGkQfqJFJ271/yaCCywdh s8QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733845044; x=1734449844; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fnUD2hNVUiEeHN5cg1ybkqeIOGWLCH/BRQuj92TH4Bg=; b=uPPrW8lJ7GmeVPwSnQzmJWNz+PL1IMh59kvv4sW2tFANSJcW0bY0x73gSx+8Y/Q/vc b/WBy0eU1PZtL5GtPw0enwOiftYq/2mzCm3WMdnXqizEtkOD2++4V8kPugGHPdNXLhlu p+h00IeInlpf8uGVZk/ExMU60/kHjlXHvIoKcI0WgSyVDAkMe3/HBkVlLDjP8oUF8nE8 xrvfHrq9B56vvSPt5+tigd2EEg5l30fag8iMZK+q1Vsf9dRp3butwoJrdQU9aWhIyWLJ g19MTM4l40sC6i2X3znt4JcP7deNqC/G4sKdtDnP0upPwBIXXxbGGKL8xj72V9BNEeOg 58dw== X-Gm-Message-State: AOJu0YzwcYyIAYwnnc8RDNC24f27jq7FtZ6mAwi5pobhJd+nU3zwXLW1 tWIlRB8QPR3EH3/pY4AiwOnQmmHfPBOVQDEl0tgnaMETXnL+icNo X-Gm-Gg: ASbGncsX1ZJQcfWKGs+wG9pd2ava7KvMjPh3pn8NJAqBT0VuKHoSwr91Rd4roB8Pnpj lUqg3fCVuCruLvs5XAT49dLbzLlOqt9qHe5pGut8IaYi9VpOpPVixHuyKqYJrasGynF7Wh2gbte /2jMnphikzA0+LF81mJJadPuKuKy4GAbSXdFVevomaSi9kY2ceZ/oRgOWOoGyv3xVZnjlv58Yn7 G7Bo/yMSOyVbbVZtA/E+wlIWN7bdgyZsxAyJ360SEBkFnvuscxS0w== X-Google-Smtp-Source: AGHT+IH93RJKZPOsgxC3Yh1Htoe4PtVzeKLxwCtCA7V2H++BURz9QesodpzmUqW9j0wi3KUz0R9wug== X-Received: by 2002:a05:600c:3b96:b0:434:feb1:adcf with SMTP id 5b1f17b1804b1-434fffa845dmr39311125e9.25.1733845043556; Tue, 10 Dec 2024 07:37:23 -0800 (PST) Received: from localhost ([31.210.180.118]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4361968eed5sm10798515e9.42.2024.12.10.07.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:37:22 -0800 (PST) Date: Tue, 10 Dec 2024 17:37:20 +0200 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Maxim Cournoyer , 74767@debbugs.gnu.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rtGxNn5lh7xLFbUi" Content-Disposition: inline In-Reply-To: X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.38 X-Spam-Score: -7.38 X-Migadu-Queue-Id: 14AB784202 X-Migadu-Scanner: mx12.migadu.com X-TUID: n1RUxsj5pDtJ --rtGxNn5lh7xLFbUi Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Should probably have cargo test not honor both parallel-build and parallel-tests at the same time. Also, currently the builds and tests try to use all the cores available, so if parallel-{build,tests} is false it should go down to 1. On Tue, Dec 10, 2024 at 11:21:05PM +0900, Maxim Cournoyer wrote: > * guix/build-system/cargo.scm (cargo-build): Add #:parallel-build? and > #:parallel-tests? arguments. > (cargo-cross-build): Likewise. > * guix/build/cargo-build-system.scm (build): Honor them. > (check): Likewise. >=20 > Change-Id: Idbee7aa3a6a7cd0fc222082837390b83cc8e8c07 > --- > guix/build-system/cargo.scm | 9 +++++++++ > guix/build/cargo-build-system.scm | 23 ++++++++++++++++++++--- > 2 files changed, 29 insertions(+), 3 deletions(-) >=20 > diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm > index f24ff6195e..ea841a34eb 100644 > --- a/guix/build-system/cargo.scm > +++ b/guix/build-system/cargo.scm > @@ -6,6 +6,7 @@ > ;;; Copyright =C2=A9 2019 Ivan Petkov > ;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka > ;;; Copyright =C2=A9 2021, 2024 Efraim Flashner > +;;; Copyright =C2=A9 2024 Maxim Cournoyer > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -95,6 +96,8 @@ (define* (cargo-build name inputs > (cargo-package-flags ''("--no-metadata" "--no-veri= fy")) > (features ''()) > (skip-build? #f) > + (parallel-build? #t) > + (parallel-tests? #t) > (install-source? #t) > (phases '%standard-phases) > (outputs '("out")) > @@ -122,6 +125,8 @@ (define* (cargo-build name inputs > #:cargo-target #$(cargo-triplet system) > #:features #$(sexp->gexp features) > #:skip-build? #$skip-build? > + #:parallel-build? #$parallel-build? > + #:parallel-tests? #$parallel-tests? > #:install-source? #$install-source? > #:tests? #$(and tests? (not skip-build?)) > #:phases #$(if (pair? phases) > @@ -152,6 +157,8 @@ (define* (cargo-cross-build name > (cargo-target (cargo-triplet (or target syst= em))) > (features ''()) > (skip-build? #f) > + (parallel-build? #t) > + (parallel-tests? #t) > (install-source? (not (target-mingw? target)= )) > (phases '%standard-phases) > (outputs '("out")) > @@ -181,6 +188,8 @@ (define* (cargo-cross-build name > #:cargo-target #$(cargo-triplet (or target system= )) > #:features #$(sexp->gexp features) > #:skip-build? #$skip-build? > + #:parallel-build? #$parallel-build? > + #:parallel-tests? #$parallel-tests? > #:install-source? #$install-source? > #:tests? #$(and tests? (not skip-build?)) > #:phases #$(if (pair? phases) > diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-s= ystem.scm > index 84897393d9..d125ff20ca 100644 > --- a/guix/build/cargo-build-system.scm > +++ b/guix/build/cargo-build-system.scm > @@ -5,6 +5,7 @@ > ;;; Copyright =C2=A9 2019-2024 Efraim Flashner > ;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka > ;;; Copyright =C2=A9 2020 Marius Bakke > +;;; Copyright =C2=A9 2024 Maxim Cournoyer > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -239,19 +240,35 @@ (define* (build #:key > (or skip-build? > (apply invoke > `("cargo" "build" > + ,@(if parallel-build? > + (list "-j" (number->string (parallel-job-count))) > + '()) > ,@(if (null? features) > '() > `("--features" ,(string-join features))) > ,@cargo-build-flags)))) > =20 > (define* (check #:key > + parallel-build? > + parallel-tests? > tests? > (cargo-test-flags '("--release")) > #:allow-other-keys) > "Run tests for a given Cargo package." > - (if tests? > - (apply invoke "cargo" "test" cargo-test-flags) > - #t)) > + (when tests? > + (apply invoke > + `("cargo" "test" > + ,@(if parallel-build? > + (list "-j" (number->string (parallel-job-count))) > + '()) > + ,@cargo-test-flags > + ,@(if parallel-tests? > + (append (if (member "--" cargo-test-flags) > + '() > + '("--")) > + (list "--test-threads" > + (number->string (parallel-job-count)))) > + '()))))) > =20 > (define* (package #:key > source > --=20 > 2.46.0 >=20 >=20 >=20 --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --rtGxNn5lh7xLFbUi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmdYYCwACgkQQarn3Mo9 g1F3/w//fPp4kGE89Fo7Hkxo2PCcQsGhNIVrr36VxN5NX/JeMWT5+fKP4zhEPlOe aeLuAiw1E8uANaLqLQhWuRu/TxUo53MnDMvqExO7tFWXiQrxFTiNAHsAPbyjB7CL Jgud0vzMprAq+6oHSiWNfLIgWO0QO+O+cp8DFkTHUztV0iZzUeZizF08XMnNdn4p iUGTl8RyxHmJrqd3daGxyVrfBYcsK5PjSjZYZrhcNy1E7JzNPUuyAS/gmuiIBDGp 6x0bGxqOBh5GOVE9hstxbqk0aD0OPQlKyWA9+dEN4yWCLg2DLUwCYQQdm3uOuH7Z aPiYCRkNwbpcpSux13QQu5kLx1attFVpKotBIDID1ThdOX9TqY2RW0YFr6WpOHtu vunQF/f+ESZY3cV2YuvAGBxU4MEh5vTifQtHHIUwJBPwB+jN5OE2J2on4qKLyMxJ Jnl+JbCCTt+dURVAitkixmZI2E71oT+lD4mXVfJ0OBAtmYYFTbORBElx2M6Omofe ASyLLov7N1I8i/Pn6ltLFDv6wOg0VID76ZqA4fAalymjfvSu70lOohLDwbmzeTI+ sJP78HK7EGEW02q0YEeFLCa8JUBMPVCGYRlxNZAYdJElwHDCn0McgrXW3eZvxGqz JZFMag0TNwAYHa62CL8GK0wtqUKPUT9g+NtHbjIRZNa2x12/7VQ= =DwQY -----END PGP SIGNATURE----- --rtGxNn5lh7xLFbUi--