[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/28: build-system/asdf: Always pre-load the system's definition file.
From: |
Ricardo Wurmus |
Subject: |
12/28: build-system/asdf: Always pre-load the system's definition file. |
Date: |
Tue, 16 May 2017 09:24:35 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit 0186a463d0f352eef485326cf57619d23a26734e
Author: Andy Patterson <address@hidden>
Date: Mon Apr 3 09:01:29 2017 -0400
build-system/asdf: Always pre-load the system's definition file.
* 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 553bbe4..f842fdc 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 20116a4..4f3fc16 100644
--- a/guix/build/asdf-build-system.scm
+++ b/guix/build/asdf-build-system.scm
@@ -118,17 +118,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)
@@ -144,8 +138,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 2d73057..3f7a6f7 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))
- 04/28: build-system/asdf: Make it possible to use "lib" as the build output., (continued)
- 04/28: build-system/asdf: Make it possible to use "lib" as the build output., Ricardo Wurmus, 2017/05/16
- 17/28: gnu: sbcl-slynk-boot0: Give the package an appropriate name., Ricardo Wurmus, 2017/05/16
- 21/28: gnu: java-stringtemplate-3: Do not hardcode version string., Ricardo Wurmus, 2017/05/16
- 25/28: gnu: stringtemplate4: Prettify "generate-grammar" phase., Ricardo Wurmus, 2017/05/16
- 18/28: build-system/asdf: Handle tests defined in external systems., Ricardo Wurmus, 2017/05/16
- 14/28: gnu: Add cl-unicode., Ricardo Wurmus, 2017/05/16
- 06/28: build-system/asdf: Use asdf to determine dependencies., Ricardo Wurmus, 2017/05/16
- 05/28: gnu: cl-stumpwm: Build the library in "lib" and the program in "bin"., Ricardo Wurmus, 2017/05/16
- 11/28: build-system/asdf: Pass the system name as an argument to the builder., Ricardo Wurmus, 2017/05/16
- 23/28: gnu: java-stringtemplate-3: Use return value in build phase., Ricardo Wurmus, 2017/05/16
- 12/28: build-system/asdf: Always pre-load the system's definition file.,
Ricardo Wurmus <=
- 09/28: build-system/asdf: Make #:lisp a package argument., Ricardo Wurmus, 2017/05/16
- 26/28: gnu: Rename stringtemplate4 to java-stringtemplate., Ricardo Wurmus, 2017/05/16
- 13/28: build-system/asdf: Handle unusually-named systems., Ricardo Wurmus, 2017/05/16
- 19/28: doc: Update the documentation for the asdf build systems., Ricardo Wurmus, 2017/05/16
- 22/28: gnu: java-stringtemplate-3: Enable tests., Ricardo Wurmus, 2017/05/16
- 15/28: build-system/asdf: Simplify the use of lisp-eval-program., Ricardo Wurmus, 2017/05/16
- 27/28: gnu: Rename stringtemplate4-4.0.6 to java-stringtemplate-4.0.6., Ricardo Wurmus, 2017/05/16
- 20/28: gnu: Rename stringtemplate3 to java-stringtemplate-3., Ricardo Wurmus, 2017/05/16
- 16/28: build-system/asdf: Retain references to source files for binary outputs., Ricardo Wurmus, 2017/05/16
- 10/28: build-system/asdf: Parameterize the lisp type and implementation globally., Ricardo Wurmus, 2017/05/16