[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/11: packages: 'package-mapping' correctly recurses into 'replacement'
From: |
guix-commits |
Subject: |
04/11: packages: 'package-mapping' correctly recurses into 'replacement'. |
Date: |
Sun, 27 Sep 2020 16:55:23 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit b3fc03ee266a5f6d810d780582d458e561efccf3
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Sep 23 14:40:15 2020 +0200
packages: 'package-mapping' correctly recurses into 'replacement'.
Previously, something like:
guix build glib --with-graft=glibc=glibc@2.29
would produce a result showing that rewriting rules were not applied to
libx11@1.6.A (a replacement).
* guix/packages.scm (package-mapping): Call REPLACE instead of PROC to
'replacement'.
* tests/packages.scm ("package-input-rewriting/spec, graft"): New test.
---
guix/packages.scm | 2 +-
tests/packages.scm | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/guix/packages.scm b/guix/packages.scm
index f696945..0d0d749 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1037,7 +1037,7 @@ applied to implicit inputs as well."
(inputs (map rewrite (package-inputs p)))
(native-inputs (map rewrite (package-native-inputs p)))
(propagated-inputs (map rewrite (package-propagated-inputs p)))
- (replacement (and=> (package-replacement p) proc))
+ (replacement (and=> (package-replacement p) replace))
(properties `((,mapping-property . #t)
,@(package-properties p))))))))
diff --git a/tests/packages.scm b/tests/packages.scm
index 6fa4ad2..e31dea6 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1364,6 +1364,33 @@
(match (delete-duplicates pythons eq?)
((p) (eq? p (rewrite python))))))
+(test-equal "package-input-rewriting/spec, graft"
+ (derivation-file-name (package-derivation %store sed))
+
+ ;; Make sure replacements are rewritten.
+ (let* ((dep0 (dummy-package "dep"
+ (version "1")
+ (build-system trivial-build-system)
+ (inputs `(("coreutils" ,coreutils)))))
+ (dep1 (dummy-package "dep"
+ (version "0")
+ (build-system trivial-build-system)
+ (replacement dep0)))
+ (p0 (dummy-package "p"
+ (build-system trivial-build-system)
+ (inputs `(("dep" ,dep1)))))
+ (rewrite (package-input-rewriting/spec
+ `(("coreutils" . ,(const sed)))))
+ (p1 (rewrite p0)))
+ (match (package-inputs p1)
+ ((("dep" dep))
+ (match (package-inputs (package-replacement dep))
+ ((("coreutils" coreutils))
+ ;; COREUTILS is not 'eq?' to SED, so the most reliable way to check
+ ;; for equality is to lower to a derivation.
+ (derivation-file-name
+ (package-derivation %store coreutils))))))))
+
(test-equal "package-patched-vulnerabilities"
'(("CVE-2015-1234")
("CVE-2016-1234" "CVE-2018-4567")
- branch master updated (d753aee -> b0cd4e0), guix-commits, 2020/09/27
- 01/11: guix build: Add '--without-tests'., guix-commits, 2020/09/27
- 05/11: packages: 'package-input-rewriting' has a #:deep? parameter., guix-commits, 2020/09/27
- 08/11: doc: Move "Primary URL" after "Specifying Channel Authorizations"., guix-commits, 2020/09/27
- 11/11: gnu: qjackctl: Update to 0.6.3., guix-commits, 2020/09/27
- 06/11: doc: Update the master menu., guix-commits, 2020/09/27
- 03/11: packages: 'package-input-rewriting/spec' can rewrite implicit dependencies., guix-commits, 2020/09/27
- 02/11: packages: 'package-mapping' can recurse on implicit inputs., guix-commits, 2020/09/27
- 04/11: packages: 'package-mapping' correctly recurses into 'replacement'.,
guix-commits <=
- 07/11: doc: Promote "Channels" as chapter and reorder., guix-commits, 2020/09/27
- 09/11: doc: Move channel @cindex within their nodes., guix-commits, 2020/09/27
- 10/11: gnu: Add grokmirror., guix-commits, 2020/09/27