From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cv1dU-00061Z-Td for guix-patches@gnu.org; Mon, 03 Apr 2017 09:03:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cv1dT-00019w-OI for guix-patches@gnu.org; Mon, 03 Apr 2017 09:03:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60047) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cv1dT-00019s-LW for guix-patches@gnu.org; Mon, 03 Apr 2017 09:03:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cv1dT-0007Wm-EA for guix-patches@gnu.org; Mon, 03 Apr 2017 09:03:07 -0400 Subject: bug#26346: [PATCH 12/17] build-system/asdf: Always pre-load the system's definition file. Resent-Message-ID: From: Andy Patterson Date: Mon, 3 Apr 2017 09:01:29 -0400 Message-Id: <20170403130134.18881-12-ajpatter@uwaterloo.ca> In-Reply-To: <20170403130134.18881-1-ajpatter@uwaterloo.ca> References: <20170403003732.1c3b8afb@uwaterloo.ca> <20170403130134.18881-1-ajpatter@uwaterloo.ca> In-Reply-To: <20170403003732.1c3b8afb@uwaterloo.ca> References: <20170403003732.1c3b8afb@uwaterloo.ca> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 26346@debbugs.gnu.org * guix/build-system/asdf.scm (asdf-build)[builder]: Pass a default `#:asd-file' argument to the build procedure, using the system's name. * guix/build/asdf-build-system.scm (build, check): Adjust to assume that `asd-file' will always be a string. * guix/build/lisp-utils.scm (compile-system, system-dependencies) (test-system): Likewise. --- guix/build-system/asdf.scm | 2 +- guix/build/asdf-build-system.scm | 11 ++--------- guix/build/lisp-utils.scm | 27 +++++++++------------------ 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm index ab571c9b4..6709238e1 100644 --- a/guix/build-system/asdf.scm +++ b/guix/build-system/asdf.scm @@ -294,7 +294,7 @@ set up using CL source package conventions." (derivation->output-path source)) ((source) source) (source source)) - #:asd-file ,asd-file + #:asd-file ,(or asd-file (string-append system-name ".asd")) #:asd-system-name ,system-name #:system ,system #:tests? ,tests? diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm index 0fe01bd6b..cea7b87e8 100644 --- a/guix/build/asdf-build-system.scm +++ b/guix/build/asdf-build-system.scm @@ -115,17 +115,11 @@ valid." (translations (wrap-output-translations `(,(output-translation source-path out)))) - (asd-file (and=> asd-file - (cut source-asd-file out asd-system-name <>)))) + (asd-file (source-asd-file out asd-system-name asd-file))) (setenv "ASDF_OUTPUT_TRANSLATIONS" (replace-escaped-macros (format #f "~S" translations))) - ;; We don't need this if we have the asd file, and it can mess with the - ;; load ordering we're trying to enforce - (unless asd-file - (prepend-to-source-registry (string-append source-path "//"))) - (setenv "HOME" out) ; ecl's asdf sometimes wants to create $HOME/.cache (compile-system asd-system-name asd-file) @@ -141,8 +135,7 @@ valid." #:allow-other-keys) "Test the system." (let* ((out (library-output outputs)) - (asd-file (and=> asd-file - (cut source-asd-file out asd-system-name <>)))) + (asd-file (source-asd-file out asd-system-name asd-file))) (if tests? (test-system asd-system-name asd-file) (format #t "test suite not run~%"))) diff --git a/guix/build/lisp-utils.scm b/guix/build/lisp-utils.scm index 2d730570a..3f7a6f77c 100644 --- a/guix/build/lisp-utils.scm +++ b/guix/build/lisp-utils.scm @@ -112,15 +112,12 @@ with PROGRAM." (define (compile-system system asd-file) "Use a lisp implementation to compile SYSTEM using asdf. Load ASD-FILE -first if SYSTEM is defined there." +first." (lisp-eval-program `(progn (require :asdf) - (in-package :asdf) - ,@(if asd-file - `((load ,asd-file)) - '()) - (in-package :cl-user) + (let ((*package* (find-package :asdf))) + (load ,asd-file)) (funcall (find-symbol (symbol-name :operate) (symbol-name :asdf)) @@ -131,15 +128,13 @@ first if SYSTEM is defined there." (define (system-dependencies system asd-file) "Return the dependencies of SYSTEM, as reported by -asdf:system-depends-on. First load the system's ASD-FILE, if necessary." +asdf:system-depends-on. First load the system's ASD-FILE." (define deps-file ".deps.sexp") (define program `(progn (require :asdf) - ,@(if asd-file - `((let ((*package* (find-package :asdf))) - (load ,asd-file))) - '()) + (let ((*package* (find-package :asdf))) + (load ,asd-file)) (with-open-file (stream ,deps-file :direction :output) (format stream @@ -183,16 +178,12 @@ asdf:system-depends-on. First load the system's ASD-FILE, if necessary." '()))) (define (test-system system asd-file) - "Use a lisp implementation to test SYSTEM using asdf. Load ASD-FILE first -if SYSTEM is defined there." + "Use a lisp implementation to test SYSTEM using asdf. Load ASD-FILE first." (lisp-eval-program `(progn (require :asdf) - (in-package :asdf) - ,@(if asd-file - `((load ,asd-file)) - '()) - (in-package :cl-user) + (let ((*package* (find-package :asdf))) + (load ,asd-file)) (funcall (find-symbol (symbol-name :test-system) (symbol-name :asdf)) -- 2.11.1