GNU bug report logs -
#71941
Broken `map-derivation' procedure
Previous Next
Full log
View this message in rfc822 format
* tests/derivations.scm ("map-derivation, modules"): New test.
Change-Id: I4cc18a643a9b64caeea0ae16456bdbdb56ea8c4e
---
tests/derivations.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 72ea9aa9cc..ffe921b284 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012-2024 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,6 +21,7 @@
(define-module (test-derivations)
#:use-module (guix derivations)
+ #:use-module (guix gexp)
#:use-module (guix store)
#:use-module (guix utils)
#:use-module ((gcrypt hash) #:prefix gcrypt:)
@@ -1483,6 +1485,29 @@ (define %coreutils
(and (build-derivations %store (list (pk 'remapped* drv2)))
(call-with-input-file out get-string-all))))
+(test-assert "map-derivation, modules"
+ (let* ((bash-drv (package-derivation %store (@ (gnu packages bash) bash)))
+ (bash-input (car (derivation-inputs bash-drv)))
+ (bash-input-drv (derivation-input-derivation bash-input))
+ (drv-with-modules (run-with-store %store
+ (gexp->derivation "derivation-with-modules"
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+ (mkdir-p (string-append #$output
+ "/bin")))))))
+ (bash-mapped-1 (map-derivation %store bash-drv
+ `((,bash-input-drv . ,drv-with-modules))))
+ (bash-mapped-2 (map-derivation %store bash-mapped-1
+ `((,drv-with-modules . ,bash-input-drv))))
+ (is-input? (lambda (in drv)
+ (not (null? (filter (lambda (input)
+ (eq? in (derivation-input-derivation input)))
+ (derivation-inputs drv)))))))
+ (and
+ (not (is-input? bash-input-drv bash-mapped-1))
+ (is-input? bash-input-drv bash-mapped-2))))
+
(test-end)
;; Local Variables:
--
2.48.1
This bug report was last modified 110 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.