From 67cdb3fd9196abc2053e80721d34fc722bb6e3a4 Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Wed, 12 Jan 2022 21:49:55 -0600 Subject: [PATCH 1/6] Fixes typo. --- doc/asdf.texinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo index b9dc5496..ae5166e6 100644 --- a/doc/asdf.texinfo +++ b/doc/asdf.texinfo @@ -4335,7 +4335,7 @@ Here is the grammar of the SEXP DSL for @code{asdf-output-translations} configuration: @verbatim -;; A configuration is single SEXP starting with keyword :source-registry +;; A configuration is single SEXP starting with keyword :output-translations ;; followed by a list of directives. CONFIGURATION := (:output-translations DIRECTIVE ...) -- GitLab From 05cbb4e31f15159a6cf8a00a848cdee89c8a38e2 Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Wed, 12 Jan 2022 22:32:29 -0600 Subject: [PATCH 2/6] Adds FAQ item on customizing paths for sources and binaries. --- doc/asdf.texinfo | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo index ae5166e6..4ed5da8b 100644 --- a/doc/asdf.texinfo +++ b/doc/asdf.texinfo @@ -260,6 +260,7 @@ Issues with using and extending ASDF to define systems * How do I work with readtables?:: * How can I capture ASDF's output?:: * LOAD-PATHNAME has a weird value:: +* How can I produce a binary at a specific path from sources at a specific path?:: ASDF development FAQs @@ -6182,6 +6183,7 @@ interpretation of its source configuration as it happens. * How do I work with readtables?:: * How can I capture ASDF's output?:: * LOAD-PATHNAME has a weird value:: +* How can I produce a binary at a specific path from sources at a specific path?:: @end menu @node How can I cater for unit-testing in my system?, How can I cater for documentation generation in my system?, Issues with using and extending ASDF to define systems, Issues with using and extending ASDF to define systems @@ -6472,7 +6474,7 @@ Output from ASDF and ASDF extensions are sent to the CL stream @code{*standard-output*}, so rebinding that stream around calls to @code{asdf:operate} should redirect all output from ASDF operations. -@node LOAD-PATHNAME has a weird value, , How can I capture ASDF's output?, Issues with using and extending ASDF to define systems +@node LOAD-PATHNAME has a weird value, How can I produce a binary at a specific path from sources at a specific path?, How can I capture ASDF's output?, Issues with using and extending ASDF to define systems @subsection *LOAD-PATHNAME* and *LOAD-TRUENAME* have weird values, help! @vindex *LOAD-PATHNAME* @vindex *LOAD-TRUENAME* @@ -6503,6 +6505,43 @@ in a macro expansion or other compile-time evaluated context. @end enumerate +@node How can I produce a binary at a specific path from sources at a specific path?, , LOAD-PATHNAME has a weird value, Issues with using and extending ASDF to define systems +@subsection How can I produce a binary at a specific path from sources at a specific path? + +Especially when integrating with outside build systems, it's useful to have +fine-grained control over where ASDF puts output files. The following is an +example of a build script that takes the directory to find the source and the +path to put the resulting binary at, and compiles a system there. + +@example +(in-package :cl-user) + +;; Tell ASDF where to find your source files. This may not be necessary if +;; you've already configured this elsewhere. +(asdf:initialize-source-registry + `(:source-registry + :inherit-configuration + (:directory ,(uiop:getenv-absolute-directory "SRC")))) + +;; Don't translate pathnames in the output directory. Without this, the binary +;; will end up somewhere under ~/.cache, most likely. +(let* ((out (uiop:getenv-pathname "OUT")) + (out-dir (uiop:pathname-directory-pathname out))) + (asdf:initialize-output-translations + `(:output-translations + :inherit-configuration + (,out-dir nil)))) + +;; Set the output pathname when building the system. +(defmethod asdf:output-files ((o asdf:image-op) (system (eql (asdf:find-system @var{foo})))) + (declare (ignorable system)) + (list (uiop:getenv-pathname "OUT"))) + +;; Build the system. +(asdf:operate 'asdf:program-op @var{foo}) +(uiop:quit) +@end example + @node ASDF development FAQs, , Issues with using and extending ASDF to define systems, FAQ @section ASDF development FAQs -- GitLab From 51529b97d55b9714a930f9603f55f68b1ab5697c Mon Sep 17 00:00:00 2001 From: Eric Timmons Date: Sun, 6 Feb 2022 18:42:19 +0000 Subject: [PATCH 3/6] Modify ASDF:OUTPUT-FILES in example. Use the flag return value to avoid translation of output file. --- doc/asdf.texinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo index 4ed5da8b..ccba62cf 100644 --- a/doc/asdf.texinfo +++ b/doc/asdf.texinfo @@ -6535,7 +6535,7 @@ path to put the resulting binary at, and compiles a system there. ;; Set the output pathname when building the system. (defmethod asdf:output-files ((o asdf:image-op) (system (eql (asdf:find-system @var{foo})))) (declare (ignorable system)) - (list (uiop:getenv-pathname "OUT"))) + (values (list (uiop:getenv-pathname "OUT")) t)) ;; Build the system. (asdf:operate 'asdf:program-op @var{foo}) -- GitLab From d3e462ddf9ad7c371ebdd039e4f24f9101735b3a Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Sun, 6 Feb 2022 12:45:31 -0600 Subject: [PATCH 4/6] Remove unnecessary configuration. Don't need to change output translations when we use the translation-inhibiting return value for OUTPUT-FILES. --- doc/asdf.texinfo | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo index ccba62cf..c6c570f6 100644 --- a/doc/asdf.texinfo +++ b/doc/asdf.texinfo @@ -995,7 +995,7 @@ for defining @emph{operations} on @emph{components}, it also provides a generic function @code{operate}, so you may arbitrarily operate on your systems beyond the default operations. (At the interactive REPL, users often use its shorter alias @code{oos}, -which stands for operate-on-system, a name inherited from @code{mk-defsystem}.) +which stands for @code{operate-on-system}, a name inherited from @code{mk-defsystem}.) You'll use @code{operate} whenever you want to do something beyond compiling, loading and testing. @@ -6523,15 +6523,6 @@ path to put the resulting binary at, and compiles a system there. :inherit-configuration (:directory ,(uiop:getenv-absolute-directory "SRC")))) -;; Don't translate pathnames in the output directory. Without this, the binary -;; will end up somewhere under ~/.cache, most likely. -(let* ((out (uiop:getenv-pathname "OUT")) - (out-dir (uiop:pathname-directory-pathname out))) - (asdf:initialize-output-translations - `(:output-translations - :inherit-configuration - (,out-dir nil)))) - ;; Set the output pathname when building the system. (defmethod asdf:output-files ((o asdf:image-op) (system (eql (asdf:find-system @var{foo})))) (declare (ignorable system)) -- GitLab From d802f1aaa85636e92135e36486a30299dcc8a5f1 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Sun, 6 Feb 2022 12:46:44 -0600 Subject: [PATCH 5/6] Replace OPERATE with OPERATE-ON-SYSTEM. --- doc/asdf.texinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo index c6c570f6..a66910bc 100644 --- a/doc/asdf.texinfo +++ b/doc/asdf.texinfo @@ -6529,7 +6529,7 @@ path to put the resulting binary at, and compiles a system there. (values (list (uiop:getenv-pathname "OUT")) t)) ;; Build the system. -(asdf:operate 'asdf:program-op @var{foo}) +(asdf:operate-on-system 'asdf:program-op @var{foo}) (uiop:quit) @end example -- GitLab From b529533794b5ac5baeaaed173c541f43ec55cf90 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Sun, 6 Feb 2022 12:59:59 -0600 Subject: [PATCH 6/6] Miscellaneous edits. * Add index entries. * Add cross-references. * Tweak node name * Tweak code for layout in pdf. --- doc/asdf.texinfo | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo index a66910bc..90d5772e 100644 --- a/doc/asdf.texinfo +++ b/doc/asdf.texinfo @@ -260,7 +260,7 @@ Issues with using and extending ASDF to define systems * How do I work with readtables?:: * How can I capture ASDF's output?:: * LOAD-PATHNAME has a weird value:: -* How can I produce a binary at a specific path from sources at a specific path?:: +* How can I produce a binary at a specific path from sources at a specific path:: ASDF development FAQs @@ -2484,7 +2484,7 @@ Then one defines @code{perform} methods on @end deftp - +@cindex bundle operations @deftp Operation compile-bundle-op @deftpx Operation monolithic-compile-bundle-op @deftpx Operation load-bundle-op @@ -2612,6 +2612,8 @@ prepending a prelude and the @code{uiop} library before the @code{asdf/defsystem} system itself. @end deftp +See also FAQ entries @pxref{What happened to the bundle operations} and @pxref{How can I produce a binary at a specific path from sources at a specific path}. + @node Creating new operations, , Predefined operations of ASDF, Operations @comment node-name, next, previous, up @@ -5894,6 +5896,8 @@ so ASDF 3 doesn't try (anymore) and loses any configuration from ASDF 2. @tindex monolithic-compile-bundle-op @tindex monolithic-load-bundle-op @tindex monolithic-deliver-asd-op +@cindex bundle operations +@tindex program-op @code{asdf-ecl} and its short-lived successor @code{asdf-bundle} are no more, having been replaced by code now built into ASDF 3. @@ -6183,7 +6187,7 @@ interpretation of its source configuration as it happens. * How do I work with readtables?:: * How can I capture ASDF's output?:: * LOAD-PATHNAME has a weird value:: -* How can I produce a binary at a specific path from sources at a specific path?:: +* How can I produce a binary at a specific path from sources at a specific path:: @end menu @node How can I cater for unit-testing in my system?, How can I cater for documentation generation in my system?, Issues with using and extending ASDF to define systems, Issues with using and extending ASDF to define systems @@ -6474,7 +6478,7 @@ Output from ASDF and ASDF extensions are sent to the CL stream @code{*standard-output*}, so rebinding that stream around calls to @code{asdf:operate} should redirect all output from ASDF operations. -@node LOAD-PATHNAME has a weird value, How can I produce a binary at a specific path from sources at a specific path?, How can I capture ASDF's output?, Issues with using and extending ASDF to define systems +@node LOAD-PATHNAME has a weird value, How can I produce a binary at a specific path from sources at a specific path, How can I capture ASDF's output?, Issues with using and extending ASDF to define systems @subsection *LOAD-PATHNAME* and *LOAD-TRUENAME* have weird values, help! @vindex *LOAD-PATHNAME* @vindex *LOAD-TRUENAME* @@ -6505,8 +6509,10 @@ in a macro expansion or other compile-time evaluated context. @end enumerate -@node How can I produce a binary at a specific path from sources at a specific path?, , LOAD-PATHNAME has a weird value, Issues with using and extending ASDF to define systems +@node How can I produce a binary at a specific path from sources at a specific path, , LOAD-PATHNAME has a weird value, Issues with using and extending ASDF to define systems @subsection How can I produce a binary at a specific path from sources at a specific path? +@cindex bundle operations +@tindex program-op Especially when integrating with outside build systems, it's useful to have fine-grained control over where ASDF puts output files. The following is an @@ -6516,15 +6522,16 @@ path to put the resulting binary at, and compiles a system there. @example (in-package :cl-user) -;; Tell ASDF where to find your source files. This may not be necessary if -;; you've already configured this elsewhere. +;; Tell ASDF where to find your source files. This may not +;; be necessary if you've already configured this elsewhere. (asdf:initialize-source-registry `(:source-registry :inherit-configuration (:directory ,(uiop:getenv-absolute-directory "SRC")))) ;; Set the output pathname when building the system. -(defmethod asdf:output-files ((o asdf:image-op) (system (eql (asdf:find-system @var{foo})))) +(defmethod asdf:output-files ((o asdf:image-op) + (system (eql (asdf:find-system @var{foo})))) (declare (ignorable system)) (values (list (uiop:getenv-pathname "OUT")) t)) -- GitLab