guix-commits
[Top][All Lists]
Advanced

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

06/07: build-system/asdf: Adopt asdf conventions.


From: Ludovic Courtès
Subject: 06/07: build-system/asdf: Adopt asdf conventions.
Date: Wed, 19 Sep 2018 12:25:39 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 5f6908d664c3af6bd1805a769640ba5240602230
Author: Andy Patterson <address@hidden>
Date:   Thu Aug 30 01:36:31 2018 -0400

    build-system/asdf: Adopt asdf conventions.
    
    The asdf documentation specifies that asdf:load-asd should be preferred to
    calling load on a system definition file.
    
    * guix/build/lisp-utils.scm (compile-system): Replace load with 
asdf:load-asd.
    (system-dependencies): Likewise.
    (test-system): Likewise.
    
    Signed-off-by: Ludovic Courtès <address@hidden>
---
 guix/build/lisp-utils.scm | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm
index 7c0a68c..6470cfe 100644
--- a/guix/build/lisp-utils.scm
+++ b/guix/build/lisp-utils.scm
@@ -152,8 +152,7 @@ with PROGRAM."
 first."
   (lisp-eval-program
    `((require :asdf)
-     (let ((*package* (find-package :asdf)))
-       (load ,asd-file))
+     (asdf:load-asd (truename ,asd-file) :name ,(normalize-string system))
      (asdf:operate 'asdf:compile-bundle-op ,system))))
 
 (define (system-dependencies system asd-file)
@@ -162,8 +161,7 @@ asdf:system-depends-on.  First load the system's ASD-FILE."
   (define deps-file ".deps.sexp")
   (define program
     `((require :asdf)
-      (let ((*package* (find-package :asdf)))
-        (load ,asd-file))
+      (asdf:load-asd (truename ,asd-file) :name ,(normalize-string system))
       (with-open-file
        (stream ,deps-file :direction :output)
        (format stream
@@ -203,19 +201,18 @@ asdf:system-depends-on.  First load the system's 
ASD-FILE."
 Also load TEST-ASD-FILE if necessary."
   (lisp-eval-program
    `((require :asdf)
-     (let ((*package* (find-package :asdf)))
-       (load ,asd-file)
-       ,@(if test-asd-file
-             `((load ,test-asd-file))
-             ;; Try some likely files.
-             (map (lambda (file)
-                    `(when (uiop:file-exists-p ,file)
-                       (load ,file)))
-                  (list
-                   (string-append system "-tests.asd")
-                   (string-append system "-test.asd")
-                   "tests.asd"
-                   "test.asd"))))
+     (asdf:load-asd (truename ,asd-file) :name ,(normalize-string system))
+     ,@(if test-asd-file
+           `((asdf:load-asd (truename ,test-asd-file)))
+           ;; Try some likely files.
+           (map (lambda (file)
+                  `(when (uiop:file-exists-p ,file)
+                     (asdf:load-asd (truename ,file))))
+                (list
+                 (string-append system "-tests.asd")
+                 (string-append system "-test.asd")
+                 "tests.asd"
+                 "test.asd")))
      (asdf:test-system ,system))))
 
 (define (string->lisp-keyword . strings)



reply via email to

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