guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gexp: Lowering a <computed-file> honors SYSTEM and TARGET.


From: guix-commits
Subject: 01/03: gexp: Lowering a <computed-file> honors SYSTEM and TARGET.
Date: Sat, 5 Jan 2019 06:41:15 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 9ec154f51f52ee3702c611637e96ccb0d59f543a
Author: Ludovic Courtès <address@hidden>
Date:   Sat Jan 5 00:01:18 2019 +0100

    gexp: Lowering a <computed-file> 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.
---
 guix/gexp.scm  |  7 ++++---
 tests/gexp.scm | 20 +++++++++++++++++++-
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index 88cabc8..febd72a 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <address@hidden>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès 
<address@hidden>
 ;;; Copyright © 2018 Clément Lassieur <address@hidden>
 ;;; Copyright © 2018 Jan Nieuwenhuizen <address@hidden>
 ;;;
@@ -388,8 +388,9 @@ This is the declarative counterpart of 'gexp->derivation'."
          (mlet %store-monad ((guile (lower-object guile system
                                                   #:target target)))
            (apply gexp->derivation name gexp #:guile-for-build guile
-                  options))
-         (apply gexp->derivation name gexp options)))))
+                  #:system system #:target target options))
+         (apply gexp->derivation name gexp
+                #:system system #:target target options)))))
 
 (define-record-type <program-file>
   (%program-file name gexp guile path)
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 35a76a4..c4b437c 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 <address@hidden>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès 
<address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1171,6 +1171,24 @@
                      (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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]