guix-commits
[Top][All Lists]
Advanced

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

01/02: gnu: Remove '%final-inputs' references at the top level.


From: Ludovic Courtès
Subject: 01/02: gnu: Remove '%final-inputs' references at the top level.
Date: Fri, 4 Nov 2016 14:36:12 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit fb77c61422ae2d03c0bf655d96b0e88f5f8001da
Author: Ludovic Courtès <address@hidden>
Date:   Fri Nov 4 15:16:11 2016 +0100

    gnu: Remove '%final-inputs' references at the top level.
    
    Due to circular dependencies, referring to bindings exported by other
    modules from the top level is frowned upon.  This patch addresses one of
    the remaining cases.
    
    * gnu/packages/base.scm (%final-inputs): New procedure.
    * gnu/packages/cross-base.scm: Remove (gnu packages commencement) import.
    (cross-gcc): Use the new '%final-inputs'.
    * gnu/packages/make-bootstrap.scm: Remove (gnu packages commencement) 
import.
    (package-with-relocatable-glibc): Use the new '%final-inputs'.
---
 gnu/packages/base.scm           |    6 ++++++
 gnu/packages/cross-base.scm     |    5 ++---
 gnu/packages/make-bootstrap.scm |    5 ++---
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index a476837..012a807 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -1003,4 +1003,10 @@ program.  It supports a wide variety of different 
encodings.")
          (proc  (module-ref iface 'canonical-package)))
     (proc package)))
 
+(define-public (%final-inputs)
+  "Return the list of \"final inputs\"."
+  ;; Avoid circular dependency by lazily resolving 'commencement'.
+  (let ((iface (resolve-interface '(gnu packages commencement))))
+    (module-ref iface '%final-inputs)))
+
 ;;; base.scm ends here
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 3bd30fd..0000a3a 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -23,7 +23,6 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages base)
-  #:use-module (gnu packages commencement)
   #:use-module (gnu packages linux)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -257,11 +256,11 @@ GCC that does not target a libc; otherwise, target that 
libc."
 
        ;; Call it differently so that the builder can check whether the "libc"
        ;; input is #f.
-       ("libc-native" ,@(assoc-ref %final-inputs "libc"))
+       ("libc-native" ,@(assoc-ref (%final-inputs) "libc"))
 
        ;; Remaining inputs.
        ,@(let ((inputs (append (package-inputs %xgcc)
-                               (alist-delete "libc" %final-inputs))))
+                               (alist-delete "libc" (%final-inputs)))))
            (if libc
                `(("libc" ,libc)
                  ("xkernel-headers"                ;the target headers
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 336ad2e..f2bae77 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -23,7 +23,6 @@
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system gnu)
   #:use-module ((gnu packages) #:select (search-patch))
-  #:use-module ((gnu packages commencement) #:select (%final-inputs))
   #:use-module (gnu packages base)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages bash)
@@ -101,14 +100,14 @@ for `sh' in $PATH, and without nscd, and with static NSS 
modules."
                                           (cross-binutils target)
                                           (cross-bootstrap-libc)))
             ("cross-binutils" ,(cross-binutils target))
-            ,@%final-inputs))
+            ,@(%final-inputs)))
         `(("libc" ,(glibc-for-bootstrap))
           ("gcc" ,(package (inherit gcc)
                     (outputs '("out")) ; all in one so libgcc_s is easily found
                     (inputs
                      `(("libc",(glibc-for-bootstrap))
                        ,@(package-inputs gcc)))))
-          ,@(fold alist-delete %final-inputs '("libc" "gcc")))))
+          ,@(fold alist-delete (%final-inputs) '("libc" "gcc")))))
 
   (package-with-explicit-inputs p inputs
                                 (current-source-location)



reply via email to

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