[bug#77093,rust-team,v3,05/17] build/cargo: Set default value of arguments for build phases.

Message ID 6bb7dff08560eab1521f718dde1ee870b41cd323.1742713356.git.hako@ultrarare.space
State New
Headers
Series [bug#77093,rust-team,v3,01/17] build/cargo: Pass ‘--offline’ to cargo. |

Commit Message

Hilton Chain March 23, 2025, 7:28 a.m. UTC
  This makes it easier to use these phases in other bulid systems.

* guix/build/cargo-build-system.scm (unpack-rust-crates,configure,build,package)
(install): Set default value of arguments.

Change-Id: I1dde1b063d8eee57967903abd2fce94574211a0a
---
 guix/build/cargo-build-system.scm | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
  

Patch

diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 67311fc850..15eda8396c 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -76,7 +76,8 @@  (define (crate-src? path)
                                             " | cut -d/ -f2"
                                             " | grep -q '^Cargo.toml$'")))))
 
-(define* (unpack-rust-crates #:key inputs vendor-dir #:allow-other-keys)
+(define* (unpack-rust-crates #:key inputs (vendor-dir "guix-vendor")
+                             #:allow-other-keys)
   (define (inputs->rust-inputs inputs)
     "Filter using the label part from INPUTS."
     (filter (lambda (input)
@@ -139,7 +140,7 @@  (define* (check-for-pregenerated-files #:key parallel-build? #:allow-other-keys)
 
 (define* (configure #:key inputs
                     target system
-                    cargo-target
+                    (cargo-target #f)
                     (vendor-dir "guix-vendor")
                     #:allow-other-keys)
   "Vendor Cargo.toml dependencies as guix inputs."
@@ -258,7 +259,7 @@  (define* (patch-cargo-checksums #:key
 
 (define* (build #:key
                 parallel-build?
-                skip-build?
+                (skip-build? #f)
                 (features '())
                 (cargo-build-flags '("--release"))
                 #:allow-other-keys)
@@ -298,8 +299,8 @@  (define* (check #:key
 
 (define* (package #:key
                   source
-                  skip-build?
-                  install-source?
+                  (skip-build? #f)
+                  (install-source? #t)
                   (cargo-package-crates '())
                   (cargo-package-flags '("--no-metadata" "--no-verify"))
                   (vendor-dir "guix-vendor")
@@ -374,9 +375,9 @@  (define* (package #:key
 (define* (install #:key
                   inputs
                   outputs
-                  skip-build?
-                  install-source?
-                  features
+                  (skip-build? #f)
+                  (install-source? #t)
+                  (features '())
                   (cargo-install-paths '())
                   #:allow-other-keys)
   "Install a given Cargo package."