diff mbox series

[bug#49531,core-updates,4/4] cargo-build-system: Accept new-style package inputs.

Message ID 598b53d80d66a229502d235507047a7717a15e8d.1626067919.git.iskarian@mgsn.dev
State New
Headers show
Series import: {utils, go, crate}: Emit new-style package inputs. | expand

Commit Message

Sarah Morgensen July 12, 2021, 5:48 a.m. UTC
Sanitize cargo's inputs here since the package field sanitizers don't
know about them.

* guix/packages.scm (sanitize-inputs): Export procedure.
* guix/build-system/cargo.scm (package-cargo-inputs)
(package-cargo-development-inputs)
(lower): Sanitize inputs before using them.
---
 guix/build-system/cargo.scm | 9 ++++++---
 guix/packages.scm           | 2 ++
 2 files changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index 60c35eed07..a0aa9ad704 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -6,6 +6,7 @@ 
 ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -128,13 +129,13 @@  to NAME and VERSION."
 (define (package-cargo-inputs p)
   (apply
     (lambda* (#:key (cargo-inputs '()) #:allow-other-keys)
-      cargo-inputs)
+      (sanitize-inputs cargo-inputs))
     (package-arguments p)))
 
 (define (package-cargo-development-inputs p)
   (apply
     (lambda* (#:key (cargo-development-inputs '()) #:allow-other-keys)
-      cargo-development-inputs)
+      (sanitize-inputs cargo-development-inputs))
     (package-arguments p)))
 
 (define (crate-closure inputs)
@@ -259,7 +260,9 @@  any dependent crates. This can be a benefits:
                         ,@(standard-packages)))
          (build-inputs `(("cargo" ,rust "cargo")
                          ("rustc" ,rust)
-                         ,@(expand-crate-sources cargo-inputs cargo-development-inputs)
+                         ,@(expand-crate-sources
+                            (sanitize-inputs cargo-inputs)
+                            (sanitize-inputs cargo-development-inputs))
                          ,@native-inputs))
          (outputs outputs)
          (build cargo-build)
diff --git a/guix/packages.scm b/guix/packages.scm
index dfb4c680be..56118edf16 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -7,6 +7,7 @@ 
 ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -117,6 +118,7 @@ 
             prepend                               ;syntactic keyword
             replace                               ;syntactic keyword
             modify-inputs
+            sanitize-inputs
 
             package-direct-sources
             package-transitive-sources