aboutsummaryrefslogtreecommitdiff
path: root/tests/packages.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-11-29 14:19:55 +0000
committerChristopher Baines <mail@cbaines.net>2020-11-29 17:34:18 +0000
commitff01206345e2306cc633db48e0b29eab9077091a (patch)
tree25c7ee17005dadc9bf4fae3f0873e03a4704f782 /tests/packages.scm
parented2545f0fa0e2ad99d5a0c45f532c539b299b9fb (diff)
parent7c2e67400ffaef8eb6f30ef7126c976ee3d7e36c (diff)
downloadguix-ff01206345e2306cc633db48e0b29eab9077091a.tar
guix-ff01206345e2306cc633db48e0b29eab9077091a.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index a9560a99a3..a867f2fd6d 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1463,6 +1463,49 @@
(eq? foo grep)
(eq? bar dep))))))
+(test-assert "package-input-rewriting/spec, identity"
+ ;; Make sure that 'package-input-rewriting/spec' doesn't gratuitously
+ ;; introduce variants. In this case, the LIBFFI propagated input should not
+ ;; be duplicated when passing GOBJECT through REWRITE.
+ ;; See <https://issues.guix.gnu.org/43890>.
+ (let* ((libffi (dummy-package "libffi"
+ (build-system trivial-build-system)))
+ (glib (dummy-package "glib"
+ (build-system trivial-build-system)
+ (propagated-inputs `(("libffi" ,libffi)))))
+ (gobject (dummy-package "gobject-introspection"
+ (build-system trivial-build-system)
+ (inputs `(("glib" ,glib)))
+ (propagated-inputs `(("libffi" ,libffi)))))
+ (rewrite (package-input-rewriting/spec
+ `(("glib" . ,identity)))))
+ (and (= (length (package-transitive-inputs gobject))
+ (length (package-transitive-inputs (rewrite gobject))))
+ (string=? (derivation-file-name
+ (package-derivation %store (rewrite gobject)))
+ (derivation-file-name
+ (package-derivation %store gobject))))))
+
+(test-assert "package-input-rewriting, identity"
+ ;; Similar to the test above, but with 'package-input-rewriting'.
+ ;; See <https://issues.guix.gnu.org/43890>.
+ (let* ((libffi (dummy-package "libffi"
+ (build-system trivial-build-system)))
+ (glib (dummy-package "glib"
+ (build-system trivial-build-system)
+ (propagated-inputs `(("libffi" ,libffi)))))
+ (gobject (dummy-package "gobject-introspection"
+ (build-system trivial-build-system)
+ (inputs `(("glib" ,glib)))
+ (propagated-inputs `(("libffi" ,libffi)))))
+ (rewrite (package-input-rewriting `((,glib . ,glib)))))
+ (and (= (length (package-transitive-inputs gobject))
+ (length (package-transitive-inputs (rewrite gobject))))
+ (string=? (derivation-file-name
+ (package-derivation %store (rewrite gobject)))
+ (derivation-file-name
+ (package-derivation %store gobject))))))
+
(test-equal "package-patched-vulnerabilities"
'(("CVE-2015-1234")
("CVE-2016-1234" "CVE-2018-4567")