unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andy Patterson <ajpatter@uwaterloo.ca>
To: 32582@debbugs.gnu.org
Subject: [bug#32582] [PATCH 4/5] build-system/asdf: Adopt asdf conventions.
Date: Thu, 30 Aug 2018 01:36:31 -0400	[thread overview]
Message-ID: <20180830053632.26414-4-ajpatter@uwaterloo.ca> (raw)
In-Reply-To: <20180830012813.7830cfc6@uwaterloo.ca>

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.
---
 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 7c0a68ca9..6470cfec9 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)
-- 
2.18.0

  parent reply	other threads:[~2018-08-30  5:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30  5:28 [bug#32582] [PATCH 0/5] Fix slynk on sbcl Andy Patterson
2018-08-30  5:36 ` [bug#32582] [PATCH 1/5] build-system/asdf: Handle all asdf dependency specifications Andy Patterson
2018-08-30  5:36 ` [bug#32582] [PATCH 2/5] build-system/asdf: Log lisp system invocations Andy Patterson
2018-08-30  5:36 ` [bug#32582] [PATCH 3/5] build-system/asdf: Use invoke Andy Patterson
2018-08-30  5:36 ` Andy Patterson [this message]
2018-08-30  5:36 ` [bug#32582] [PATCH 5/5] gnu: sbcl-slynk: Fix the build Andy Patterson
2018-09-19  5:14 ` [bug#32582] [PATCH 0/5] Fix slynk on sbcl Andy Patterson
2018-09-19 16:26   ` bug#32582: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180830053632.26414-4-ajpatter@uwaterloo.ca \
    --to=ajpatter@uwaterloo.ca \
    --cc=32582@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).