GNU bug report logs - #67947
[PATCH 0/3 rust-team] guix: cargo-build-system: Add test keys.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Jaeme Sifat <jaeme@HIDDEN>; Keywords: patch; dated Thu, 21 Dec 2023 05:27:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 67947 <at> debbugs.gnu.org:


Received: (at 67947) by debbugs.gnu.org; 21 Dec 2023 05:33:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 21 00:33:07 2023
Received: from localhost ([127.0.0.1]:42242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGBgB-0008FU-1u
	for submit <at> debbugs.gnu.org; Thu, 21 Dec 2023 00:33:07 -0500
Received: from mailtransmit04.runbox.com ([2a0c:5a00:149::25]:39560)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jaeme@HIDDEN>) id 1rGBfz-0008Eb-2b
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 00:33:05 -0500
Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com)
 by mailtransmit04.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <jaeme@HIDDEN>) id 1rGBfp-000fYP-NN
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 06:32:45 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Transfer-Encoding:Content-Type:MIME-Version:
 References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From;
 bh=RLkSlGOZ+bjyRJbXe4T41o8f/sJhZh1eaua2JpOnie4=; b=IXPvxWbQz7yEWk8p1Q4wMkKMP7
 Ra465sCbPXZ8ddAbRqmVA7N8UsIdqCF+1F9mRVjp4KElq1TGmQDGdQoua3CCwlAwAzik8eDi/xndV
 UNOiBJvGcHVN8wR6HCooA2DydlHw9cpPtxLo2XHhEyCKuLLnBQQC6yzjI9taifvgAI5H7dmkiV6BF
 lvR+s0ttNtW1OiTvxHzPhDTwoMvYRzskCcoK59ireon4vSUmOmdxUWgmq+EqE5GzB3qqI38eCoSjc
 1JW9CR5EcqMmNtpgFU4s84lL3Jd5TrbrzRcTcfIl6yjQAw0WsTTRdWFR1s48LQ0648yJW8CCLsJtm
 a1pZArhQ==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <jaeme@HIDDEN>) id 1rGBfp-0005qJ-FS
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 06:32:45 +0100
Received: by submission03.runbox with esmtpsa [Authenticated ID (1176697)]
 (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.93) id 1rGBfm-008kIc-Ld; Thu, 21 Dec 2023 06:32:43 +0100
From: Jaeme Sifat <jaeme@HIDDEN>
To: 67947 <at> debbugs.gnu.org
Subject: [PATCH 3/3] guix: Add copyright notice.
Date: Thu, 21 Dec 2023 00:28:42 -0500
Message-ID: <bccff746827ec141eb3fc8d4399710f4bcc6cf3d.1703135457.git.jaeme@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1703135457.git.jaeme@HIDDEN>
References: <cover.1703135457.git.jaeme@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Efraim Flashner <efraim@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67947
Cc: Jaeme Sifat <jaeme@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* guix/build-system/cargo.scm: Add copyright notice.
* guix/build/cargo-build-system.scm: Add copyright notice.

Change-Id: I1ccffda9ce10e9bbe75ba573b7de763d0c42d899
---
 guix/build-system/cargo.scm       | 1 +
 guix/build/cargo-build-system.scm | 1 +
 2 files changed, 2 insertions(+)

diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index 7878a3bd6d..ef78a18b5f 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2021 Efraim Flashner <efraim@HIDDEN>
+;;; Copyright © 2023 Jaeme Sifat <jaeme@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 5abedfc726..3c74d11911 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2019-2023 Efraim Flashner <efraim@HIDDEN>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@HIDDEN>
 ;;; Copyright © 2020 Marius Bakke <marius@HIDDEN>
+;;; Copyright © 2023 Jaeme Sifat <jaeme@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
-- 
2.41.0





Information forwarded to efraim@HIDDEN, guix-patches@HIDDEN:
bug#67947; Package guix-patches. Full text available.

Message received at 67947 <at> debbugs.gnu.org:


Received: (at 67947) by debbugs.gnu.org; 21 Dec 2023 05:32:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 21 00:32:02 2023
Received: from localhost ([127.0.0.1]:42236 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGBf8-0008DX-IF
	for submit <at> debbugs.gnu.org; Thu, 21 Dec 2023 00:32:02 -0500
Received: from mailtransmit04.runbox.com ([2a0c:5a00:149::25]:38936)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jaeme@HIDDEN>) id 1rGBf4-0008Cw-40
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 00:32:01 -0500
Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com)
 by mailtransmit04.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <jaeme@HIDDEN>) id 1rGBes-000fTz-1M
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 06:31:46 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To
 :Message-ID:Date:Subject:Cc:To:From;
 bh=l6WIy4lpg1XNSvsAZvGc0qEYLXt4GkAwHslarYKOQaM=; b=QpsX1aiDHUC55QY8rJWbBUzD+M
 4F9PObrFG0FJjNYEdLJvOw8qTcobr0miTvt6jPU9ycAx8a6nW88F0UYI7kbWQluVHWRb9GXSblf50
 C7wuoh6dwhBt5DWvS4Ipkh87lRychNa/z8tE3iTdkTTkyi7HWKniTQlft6PQLgJPOSdO+8tut/Aoj
 Um0+06cxnqwgPOqlzar/BFgbE/hFpMaUaSH6lGXkr5yjcXFmSwj93RSXE6tFQpm6c/uau/dJqXxyD
 oNpf1t8qE7X0aZT08z0n+YGWdfivI9eaDin0gC7z16BIBXQKavY3CYmzN2OLUY/+IAyydw8GCO5Rh
 2RZzBK4g==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <jaeme@HIDDEN>) id 1rGBer-0003ip-NL
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 06:31:45 +0100
Received: by submission03.runbox with esmtpsa [Authenticated ID (1176697)]
 (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.93) id 1rGBeh-008kIc-8X; Thu, 21 Dec 2023 06:31:35 +0100
From: Jaeme Sifat <jaeme@HIDDEN>
To: 67947 <at> debbugs.gnu.org
Subject: [PATCH 2/3] guix: build-system: cargo: Add cargo-test-targets.
Date: Thu, 21 Dec 2023 00:28:41 -0500
Message-ID: <413c758092a856dae0c8e8b2e02a36dd1649e4cb.1703135457.git.jaeme@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1703135457.git.jaeme@HIDDEN>
References: <cover.1703135457.git.jaeme@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Efraim Flashner <efraim@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67947
Cc: Jaeme Sifat <jaeme@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

In addition to adding a key for skipping tests, there ought be a key for
specifying which test target(s) should be ran without having to edit
the #:cargo-test-flags key directly.

* guix/build-system/cargo.scm (cargo-build): Add cargo-test-targets.
* guix/build-system/cargo.scm (builder): Add cargo-test-targets.
* guix/build-system/cargo.scm (cargo-cross-build): Add cargo-test-targets.
* guix/build/cargo-build-system.scm (check): Add cargo-test-targets.

Change-Id: Ibdf3cffd2b0f3fdbfe269189975c739192c14f64
---
 guix/build-system/cargo.scm       |  4 ++++
 guix/build/cargo-build-system.scm | 25 +++++++++++++++++--------
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index d2a45f0609..7878a3bd6d 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -86,6 +86,7 @@ (define* (cargo-build name inputs
                       (vendor-dir "guix-vendor")
                       (cargo-build-flags ''("--release"))
                       (cargo-test-flags ''("--release"))
+                      (cargo-test-targets ''())
                       (cargo-skip-tests ''())
                       (cargo-package-flags ''("--no-metadata" "--no-verify"))
                       (features ''())
@@ -113,6 +114,7 @@ (define* (cargo-build name inputs
                        #:vendor-dir #$vendor-dir
                        #:cargo-build-flags #$(sexp->gexp cargo-build-flags)
                        #:cargo-test-flags #$(sexp->gexp cargo-test-flags)
+                       #:cargo-test-targets #$(sexp->gexp cargo-test-targets)
                        #:cargo-skip-tests #$(sexp->gexp cargo-skip-tests)
                        #:cargo-package-flags #$(sexp->gexp cargo-package-flags)
                        #:features #$(sexp->gexp features)
@@ -143,6 +145,7 @@ (define* (cargo-cross-build name
                             (vendor-dir "guix-vendor")
                             (cargo-build-flags ''("--release"))
                             (cargo-test-flags ''("--release"))
+                            (cargo-test-targets ''())
                             (cargo-skip-tests ''())
                             (cargo-package-flags ''("--no-metadata" "--no-verify"))
                             (features ''())
@@ -172,6 +175,7 @@ (define* (cargo-cross-build name
                        #:vendor-dir #$vendor-dir
                        #:cargo-build-flags #$(sexp->gexp cargo-build-flags)
                        #:cargo-test-flags #$(sexp->gexp cargo-test-flags)
+                       #:cargo-test-targets #$(sexp->gexp cargo-test-targets)
                        #:cargo-skip-tests #$(sexp->gexp cargo-skip-tests)
                        #:cargo-package-flags #$(sexp->gexp cargo-package-flags)
                        #:features #$(sexp->gexp features)
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 7cdb2a72d3..5abedfc726 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -258,19 +258,28 @@ (define* (build #:key
 
 (define* (check #:key
                 tests?
+                cargo-test-targets
                 cargo-skip-tests
                 (cargo-test-flags '("--release"))
                 #:allow-other-keys)
   "Run tests for a given Cargo package."
   (if tests?
-      (if cargo-skip-tests
-          (let ((test-lst (map (lambda (test)
-                              (string-append "--skip=" test))
-                            cargo-skip-tests)))
-            (apply invoke "cargo" "test" (append
-                                          cargo-test-flags
-                                          (cons* "--" test-lst))))
-          (apply invoke "cargo" "test" cargo-test-flags))
+      (let* ((cargo-test-targets-flags
+              (when cargo-test-targets
+                (map (lambda (section)
+                       (string-append "--" section))
+                     cargo-test-targets)))
+             (cargo-skip-tests-flags
+              (when cargo-skip-tests
+                (map (lambda (test)
+                       (string-append "--skip=" test))
+                     cargo-skip-tests)))
+             (cargo-test-flags
+              (append cargo-test-flags
+                      cargo-test-targets-flags
+                      '("--")
+                      cargo-skip-tests-flags)))
+        (apply invoke "cargo" "test" cargo-test-flags))
       #t))
 
 (define* (package #:key
-- 
2.41.0





Information forwarded to efraim@HIDDEN, guix-patches@HIDDEN:
bug#67947; Package guix-patches. Full text available.

Message received at 67947 <at> debbugs.gnu.org:


Received: (at 67947) by debbugs.gnu.org; 21 Dec 2023 05:30:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 21 00:30:38 2023
Received: from localhost ([127.0.0.1]:42230 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGBdl-00079I-Pj
	for submit <at> debbugs.gnu.org; Thu, 21 Dec 2023 00:30:38 -0500
Received: from mailtransmit05.runbox.com ([2a0c:5a00:149::26]:42418)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jaeme@HIDDEN>) id 1rGBdj-0006tA-QQ
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 00:30:36 -0500
Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com)
 by mailtransmit05.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <jaeme@HIDDEN>) id 1rGBda-000Zju-0n
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 06:30:26 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To
 :Message-ID:Date:Subject:Cc:To:From;
 bh=m3SYMzewRF5DPXhMRjD2BQq4TBIXqGAZG84Cq1QRQCc=; b=W6TyAgczB/Ur2F3vN9EI4udQGO
 JnpAwgYYET9C03kex2xVZvOocpuk9p41oSf5gXQyMB6+75DcXazad8cfzv+cVzjkpIhfm/TtEcfGy
 woSGnzOJJ7yX5WXJTsLvIwjmLWDj2HuBMaJ9gxxnGosxk0uk35qA4/sACFkUKyr/oVzFr5/rg/uJJ
 uaBq+MnWdJEMLqkLwGbh7et5lGWjX2SopYyENwQXo5oUiSJ6ox2bMIAEMUmorGjmAtvMllqnEEYXz
 CBwX2ZNIiNMXKMU9T/6q16E2Xeik0FLS7Rcifmw/XEDK5HK3kJgmZFu+LXprDW81Xf2BUqJpA1SJW
 PTf18fIA==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <jaeme@HIDDEN>) id 1rGBdZ-0003fu-HW
 for 67947 <at> debbugs.gnu.org; Thu, 21 Dec 2023 06:30:25 +0100
Received: by submission03.runbox with esmtpsa [Authenticated ID (1176697)]
 (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.93) id 1rGBdP-008kIc-VV; Thu, 21 Dec 2023 06:30:16 +0100
From: Jaeme Sifat <jaeme@HIDDEN>
To: 67947 <at> debbugs.gnu.org
Subject: [PATCH 1/3] guix: build-system: cargo: Add cargo-skip-tests.
Date: Thu, 21 Dec 2023 00:28:40 -0500
Message-ID: <a6fe9279323eb1fac32153134c5a0bf34ce8cb17.1703135457.git.jaeme@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1703135457.git.jaeme@HIDDEN>
References: <cover.1703135457.git.jaeme@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Efraim Flashner <efraim@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67947
Cc: Jaeme Sifat <jaeme@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

The #:cargo-skip-tests key accepts a list of strings that represent the names
of tests to be skipped by passing the "--skip=<test-name>" to cargo test. This
is so that the packager doesn't have to edit #:cargo-test-flags directly when
trying to skip tests.

* guix/build-system/cargo.scm (cargo-build): Add cargo-skip-tests.
* guix/build-system/cargo.scm (builder): Add cargo-skip-tests.
* guix/build-system/cargo.scm (cargo-cross-build): Add cargo-skip-tests.
* guix/build/cargo-build-system.scm (check): Add cargo-skip-tests.

Change-Id: I2f64370cf29b9495a33a8e072ab930b8635e742d
---
 guix/build-system/cargo.scm       |  4 ++++
 guix/build/cargo-build-system.scm | 10 +++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index c029cc1dda..d2a45f0609 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -86,6 +86,7 @@ (define* (cargo-build name inputs
                       (vendor-dir "guix-vendor")
                       (cargo-build-flags ''("--release"))
                       (cargo-test-flags ''("--release"))
+                      (cargo-skip-tests ''())
                       (cargo-package-flags ''("--no-metadata" "--no-verify"))
                       (features ''())
                       (skip-build? #f)
@@ -112,6 +113,7 @@ (define* (cargo-build name inputs
                        #:vendor-dir #$vendor-dir
                        #:cargo-build-flags #$(sexp->gexp cargo-build-flags)
                        #:cargo-test-flags #$(sexp->gexp cargo-test-flags)
+                       #:cargo-skip-tests #$(sexp->gexp cargo-skip-tests)
                        #:cargo-package-flags #$(sexp->gexp cargo-package-flags)
                        #:features #$(sexp->gexp features)
                        #:skip-build? #$skip-build?
@@ -141,6 +143,7 @@ (define* (cargo-cross-build name
                             (vendor-dir "guix-vendor")
                             (cargo-build-flags ''("--release"))
                             (cargo-test-flags ''("--release"))
+                            (cargo-skip-tests ''())
                             (cargo-package-flags ''("--no-metadata" "--no-verify"))
                             (features ''())
                             (skip-build? #f)
@@ -169,6 +172,7 @@ (define* (cargo-cross-build name
                        #:vendor-dir #$vendor-dir
                        #:cargo-build-flags #$(sexp->gexp cargo-build-flags)
                        #:cargo-test-flags #$(sexp->gexp cargo-test-flags)
+                       #:cargo-skip-tests #$(sexp->gexp cargo-skip-tests)
                        #:cargo-package-flags #$(sexp->gexp cargo-package-flags)
                        #:features #$(sexp->gexp features)
                        #:skip-build? #$skip-build?
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index ffb2ec898e..7cdb2a72d3 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -258,11 +258,19 @@ (define* (build #:key
 
 (define* (check #:key
                 tests?
+                cargo-skip-tests
                 (cargo-test-flags '("--release"))
                 #:allow-other-keys)
   "Run tests for a given Cargo package."
   (if tests?
-      (apply invoke "cargo" "test" cargo-test-flags)
+      (if cargo-skip-tests
+          (let ((test-lst (map (lambda (test)
+                              (string-append "--skip=" test))
+                            cargo-skip-tests)))
+            (apply invoke "cargo" "test" (append
+                                          cargo-test-flags
+                                          (cons* "--" test-lst))))
+          (apply invoke "cargo" "test" cargo-test-flags))
       #t))
 
 (define* (package #:key
-- 
2.41.0





Information forwarded to efraim@HIDDEN, guix-patches@HIDDEN:
bug#67947; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Dec 2023 05:26:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 21 00:26:48 2023
Received: from localhost ([127.0.0.1]:42221 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGBa4-0005RS-3U
	for submit <at> debbugs.gnu.org; Thu, 21 Dec 2023 00:26:48 -0500
Received: from lists.gnu.org ([2001:470:142::17]:42814)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jaeme@HIDDEN>) id 1rGBZz-0005R9-27
 for submit <at> debbugs.gnu.org; Thu, 21 Dec 2023 00:26:46 -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 <jaeme@HIDDEN>) id 1rGBZp-0008Cf-Nf
 for guix-patches@HIDDEN; Thu, 21 Dec 2023 00:26:33 -0500
Received: from mailtransmit05.runbox.com ([2a0c:5a00:149::26])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jaeme@HIDDEN>) id 1rGBZm-0007uk-UJ
 for guix-patches@HIDDEN; Thu, 21 Dec 2023 00:26:33 -0500
Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com)
 by mailtransmit05.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <jaeme@HIDDEN>) id 1rGBZg-000ZII-3j
 for guix-patches@HIDDEN; Thu, 21 Dec 2023 06:26:24 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:
 Subject:Cc:To:From; bh=LDhWpb8GBpRo89cL809LBL6RKj6EP7H+RF/nRi0Ihiw=; b=ZvveMw
 mFrc+sVerfFDtcAqySLzhTrf4HRd2SQ7dUmlTM3VwgaEZnoKKP98RrFByMQNyukhDeu2w/FW45JSD
 XXBCmSt3ITb9FDd0niEP+h7+uD/UJJFqhGIX30L6c0UnXdP92dOG7J3pWa13qp5Oh/s1V8965YFqD
 wdqSLb1pO3EaFfr6nTA4DjW4yHDCHpSuJ+pcCGW53VVdo89oWw11VNY7AoffUdOialHq53JZIs8uO
 +GUJd1FMKDkhV9qdeUCnLWFBA6BHos07S5JoiHnpwcNMw5nDiSlXYf70bqI95imVMMwwwVREw4dPs
 sohTQq0yVyM9wSqJw3opySSuR/Gw==;
Received: from [10.9.9.73] (helo=submission02.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <jaeme@HIDDEN>) id 1rGBZc-0003La-Gj
 for guix-patches@HIDDEN; Thu, 21 Dec 2023 06:26:23 +0100
Received: by submission02.runbox with esmtpsa [Authenticated ID (1176697)]
 (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.93) id 1rGBZQ-009cXA-OQ; Thu, 21 Dec 2023 06:26:09 +0100
From: Jaeme Sifat <jaeme@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/3 rust-team] guix: cargo-build-system: Add test keys.
Date: Thu, 21 Dec 2023 00:11:23 -0500
Message-ID: <cover.1703135457.git.jaeme@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
X-Debbugs-Cc: Efraim Flashner <efraim@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a0c:5a00:149::26; envelope-from=jaeme@HIDDEN;
 helo=mailtransmit05.runbox.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: Jaeme Sifat <jaeme@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

I propose adding two new keys for the 'check phase of the
cargo-build-system. One is #:cargo-skip-tests which accepts a list of
strings representing the names of the tests to be skipped and the
other is #:cargo-test-targets which accepts a list of strings
representing the test targets to be ran.

The goal of adding these two keys is to make it so that the packager
doesn't have to interface directly with #:cargo-test-flags which is
set to --release mode by default. I believe that this leads to cleaner
looking build definitions that should be easier to bind to something
say, a web-based package definition editor that exists right now.

These patches are just a draft of this feature I cooked up. Here's
what they should look like in action with the rust-alsa crate:

--8<---------------cut here---------------start------------->8---
(define-public rust-alsa-0.8
  (package
    ...
    (build-system cargo-build-system)
    (arguments
     `(#:cargo-test-targets
       (list "lib"
             "bins"
             "tests")
       #:cargo-skip-tests
       (list "pcm::drop"
             "pcm::info_from_default"
             "pcm::playback_to_default"
             "pcm::record_from_default"
             "seq::print_seqs"
             "seq::seq_loopback"
             "seq::seq_portsubscribeiter"
             "seq::seq_subscribe")
       #:cargo-inputs
       (("rust-alsa-sys" ,rust-alsa-sys-0.3)
        ("rust-bitflags" ,rust-bitflags-2)
        ("rust-libc" ,rust-libc-0.2)
        ("rust-nix" ,rust-nix-0.26))))
     ...))
--8<---------------cut here---------------end--------------->8---

I would like to hear the feedback on this change and its
implementation. Of course, if this change is accepted, then there
ought to be an update to the Rust crates section of 'Contributing' in
the Guix manual that details this.

Jaeme Sifat (3):
  guix: build-system: cargo: Add cargo-skip-tests.
  guix: build-system: cargo: Add cargo-test-targets.
  guix: Add copyright notice.

 guix/build-system/cargo.scm       |  9 +++++++++
 guix/build/cargo-build-system.scm | 20 +++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)


base-commit: 49a7a95ba44e231e9e15a274f9a96de6fa012daf
--
2.41.0




Acknowledgement sent to Jaeme Sifat <jaeme@HIDDEN>:
New bug report received and forwarded. Copy sent to efraim@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to efraim@HIDDEN, guix-patches@HIDDEN:
bug#67947; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.