From 9ec154f51f52ee3702c611637e96ccb0d59f543a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 5 Jan 2019 00:01:18 +0100 Subject: gexp: Lowering a honors SYSTEM and TARGET. * guix/gexp.scm (computed-file-compiler): Pass #:system and #:target to 'gexp->derivation'. * tests/gexp.scm ("lower-object, computed-file, #:system"): New test. --- tests/gexp.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/gexp.scm b/tests/gexp.scm index 35a76a496e..c4b437cd49 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -1171,6 +1171,24 @@ (define (contents=? file str) (string=? (readlink (string-append comp "/text")) text))))))) +(test-equal "lower-object, computed-file, #:system" + '("mips64el-linux") + (run-with-store %store + (let* ((exp #~(symlink #$coreutils #$output)) + (computed (computed-file "computed" exp + #:guile %bootstrap-guile))) + ;; Make sure that the SYSTEM argument to 'lower-object' is honored. + (mlet* %store-monad ((drv (lower-object computed "mips64el-linux")) + (refs (references* (derivation-file-name drv)))) + (return (delete-duplicates + (filter-map (lambda (file) + (and (string-suffix? ".drv" file) + (let ((drv (read-derivation-from-file + file))) + (derivation-system drv)))) + (cons (derivation-file-name drv) + refs)))))))) + (test-assert "lower-object & gexp-input-error?" (guard (c ((gexp-input-error? c) (gexp-error-invalid-input c))) -- cgit v1.2.3