Subject: [bug#74958] [PATCH rust-team 1/5] build/cargo.scm: Remove '--release' from default cargo-test-flags.

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 19 Dec 2024 10:46:18 +0900

The default behavior for 'cargo test' is to build in debug mode, and many test
suites expect support for things provided in this mode such as debug
assertions (see for example:
<https://github.com/google/zerocopy/issues/2143>).

* guix/build-system/cargo.scm (cargo-build): Remove '--release' from
 #:cargo-test-flags.
* guix/build/cargo-build-system.scm (check): Likewise.

Change-Id: I8a659c25bd33bc1bdfd88e440bd00bad09a5fc01
---
 guix/build-system/cargo.scm       | 4 ++--
 guix/build/cargo-build-system.scm | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index 9850969156..452f7f78d0 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -93,7 +93,7 @@ (define* (cargo-build name inputs
                       (test-target #f)
                       (vendor-dir "guix-vendor")
                       (cargo-build-flags ''("--release"))
-                      (cargo-test-flags ''("--release"))
+                      (cargo-test-flags ''())
                       (cargo-package-flags ''("--no-metadata" "--no-verify"))
                       (features ''())
                       (skip-build? #f)
@@ -153,7 +153,7 @@ (define* (cargo-cross-build name
                             (test-target #f)
                             (vendor-dir "guix-vendor")
                             (cargo-build-flags ''("--release"))
-                            (cargo-test-flags ''("--release"))
+                            (cargo-test-flags ''())
                             (cargo-package-flags ''("--no-metadata" "--no-verify"))
                             (cargo-target (cargo-triplet (or target system)))
                             (features ''())
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 453d759470..480134402f 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -252,7 +252,7 @@ (define* (check #:key
                 parallel-build?
                 parallel-tests?
                 tests?
-                (cargo-test-flags '("--release"))
+                (cargo-test-flags '())
                 #:allow-other-keys)
   "Run tests for a given Cargo package."
   (when tests?
-- 
2.46.0