ASDF: Another System Definition Facility: Manual For Version 3.3.3.3
ASDF: Another System Definition Facility: Manual For Version 3.3.3.3
ASDF: Another System Definition Facility: Manual For Version 3.3.3.3
Facility
Manual for Version 3.3.3.3
This manual describes ASDF, a system definition facility for Common Lisp programs and
libraries.
You can find the latest version of this manual at https://common-lisp.net/project/
asdf/asdf.html.
ASDF Copyright
c 2001-2019 Daniel Barlow and contributors.
This manual Copyright
c 2001-2019 Daniel Barlow and contributors.
This manual revised
c 2009-2019 Robert P. Goldman and Francois-Rene Rideau.
Permission is hereby granted, free of charge, to any person obtaining a copy of this soft-
ware and associated documentation files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONIN-
FRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
i
Table of Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
3 Loading ASDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.1 Loading a pre-installed ASDF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Checking whether ASDF is loaded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.3 Upgrading ASDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.4 Replacing your implementation’s ASDF . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.5 Loading ASDF from source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4 Configuring ASDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.1 Configuring ASDF to find your systems . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 Configuring ASDF to find your systems — old style . . . . . . . . . . . . . 7
4.3 Configuring where ASDF stores object files . . . . . . . . . . . . . . . . . . . . . 8
4.4 Resetting the ASDF configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5 Using ASDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.1 Loading a system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.2 Convenience Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.3 Moving on. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
10 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
10.1 ASDF errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
10.2 Compilation error and warning handling . . . . . . . . . . . . . . . . . . . . . . 60
13 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
13.1 “Where do I report a bug?” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
13.2 Mailing list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
13.3 “What has changed between ASDF 1, ASDF 2, and ASDF 3?” . . 70
13.3.1 What are ASDF 1, ASDF 2, and ASDF 3? . . . . . . . . . . . . . . . 70
13.3.2 How do I detect the ASDF version? . . . . . . . . . . . . . . . . . . . . . . 71
13.3.3 ASDF can portably name files in subdirectories . . . . . . . . . . 71
13.3.4 Output translations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
13.3.5 Source Registry Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
13.3.6 Usual operations are made easier to the user . . . . . . . . . . . . . 72
13.3.7 Many bugs have been fixed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
13.3.8 ASDF itself is versioned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
13.3.9 ASDF can be upgraded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
13.3.10 Decoupled release cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
13.3.11 Pitfalls of the transition to ASDF 2 . . . . . . . . . . . . . . . . . . . . . 74
13.3.12 Pitfalls of the upgrade to ASDF 3 . . . . . . . . . . . . . . . . . . . . . . 75
13.3.13 What happened to the bundle operations? . . . . . . . . . . . . . . 76
13.4 Issues with installing the proper version of ASDF . . . . . . . . . . . . . 77
13.4.1 “My Common Lisp implementation comes with an
outdated version of ASDF. What to do?” . . . . . . . . . . . . . . . . . . . . . . 77
13.4.2 “I’m a Common Lisp implementation vendor. When
and how should I upgrade ASDF?” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
iv
Ongoing Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Variable Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
1 Introduction
ASDF, or Another System Definition Facility, is a build system: a tool for specifying how
systems of Common Lisp software are made up of components (sub-systems and files), and
how to operate on these components in the right order so that they can be compiled, loaded,
tested, etc. If you are new to ASDF, see Chapter 2 [the quick start guide], page 2.
ASDF presents three faces: one for users of Common Lisp software who want to reuse
other people’s code, one for writers of Common Lisp software who want to specify how
to build their systems, and one for implementers of Common Lisp extensions who want
to extend the build system. For more specifics, see Chapter 5 [Using ASDF], page 10, to
learn how to use ASDF to load a system. See Chapter 6 [Defining systems with defsystem],
page 13, to learn how to define a system of your own. See Chapter 7 [The object model of
ASDF], page 28, for a description of the ASDF internals and how to extend ASDF.
Note that ASDF is not a tool for library and system installation; it plays a role like
make or ant, not like a package manager. In particular, ASDF should not to be confused
with Quicklisp or ASDF-Install, that attempt to find and download ASDF systems for you.
Despite what the name might suggest, ASDF-Install was never a part of ASDF; it was always
a separate piece of software. ASDF-Install has also been unmaintained and obsolete for a
very long time. We recommend you use Quicklisp (http://www.quicklisp.org/) instead,
a Common Lisp package manager which works well and is being actively maintained. If you
want to download software from version control instead of tarballs, so you may more easily
modify it, we recommend clbuild (http://common-lisp.net/project/clbuild/). As for
where on your filesystem to install Common Lisp software, we recommend subdirectories of
~/common-lisp/: starting with ASDF 3.1.2 (2014), this hierarchy is included in the default
source-registry configuration.
Finally, note that this manual is incomplete. All the bases are covered, but many
advanced topics are only barely alluded to, and there is not much in terms of examples. The
source code remains the ultimate source of information, free software systems in Quicklisp
remain the best source of examples, and the mailing-list the best place to ask for help.
2
3 Loading ASDF
1
NB: all implementations except GNU CLISP also accept (require "ASDF"), (require ’asdf) and
(require :asdf). For portability’s sake, you should use (require "asdf").
Chapter 3: Loading ASDF 4
distributed with the ASDF source repository, or the code of cl-launch (https://cliki.
net/cl-launch).
6
4 Configuring ASDF
For standard use cases, ASDF should work pretty much out of the box. We recommend
you skim the sections on configuring ASDF to find your systems and choose the method
of installing Lisp software that works best for you. Then skip directly to See Chapter 5
[Using ASDF], page 10. That will probably be enough. You are unlikely to have to worry
about the way ASDF stores object files, and resetting the ASDF configuration is usually
only needed in corner cases.
your implementation provides an earlier variant of ASDF 3, you might want to specify
(:tree (:home "common-lisp/")) for bootstrap purposes, then install a recent source
tree of ASDF under ~/common-lisp/asdf/.
If you prefer to use a “link farm”, which is faster to use but costlier to manage than a
recursive traversal, say at /home/luser/.asd-link-farm/, then you may instead (or
additionally) create a file 42-asd-link-farm.conf, containing the line: (:directory
"/home/luser/.asd-link-farm/")
ASDF will automatically read your configuration the first time you try to find a system.
If necessary, you can reset the source-registry configuration with:
(asdf:clear-source-registry)
• In earlier versions of ASDF, the system source registry was configured using a global
variable, asdf:*central-registry*. For more details about this, see the following
section, Section 4.2 [Configuring ASDF to find your systems — old style], page 7.
Unless you need to understand this, skip directly to Section 4.3 [Configuring where
ASDF stores object files], page 8.
Note that your Operating System distribution or your system administrator may already
have configured system-managed libraries for you.
For example, let’s say you want ASDF to find the .asd file /home/me/src/foo/foo.asd.
In your Lisp initialization file, you could have the following:
(require "asdf")
(push "/home/me/src/foo/" asdf:*central-registry*)
Note the trailing slash: when searching for a system, ASDF will evaluate each entry
of the central registry and coerce the result to a pathname.5 The trailing directory name
separator is necessary to tell Lisp that you’re discussing a directory rather than a file. If
you leave it out, ASDF is likely to look in /home/me/src/ instead of /home/me/src/foo/
as you intended, and fail to find your system definition. Modern versions of ASDF will issue
an error and offer you to remove such entries from the central-registry.
Typically there are a lot of .asd files, and a common idiom was to put symbolic links
to all of one’s .asd files in a common directory and push that directory (the “link farm”)
onto asdf:*central-registry*, instead of pushing each individual system directory.
ASDF knows to follow symlinks to the actual location of the systems.6
For example, if #p"/home/me/cl/systems/" is an element of *central-registry*, you
could set up the system foo as follows:
$ cd /home/me/cl/systems/
$ ln -s ~/src/foo/foo.asd .
This old style for configuring ASDF is not recommended for new users, but it is supported
for old users, and for users who want a simple way to programmatically control what
directories are added to the ASDF search path.
Note that before ASDF 2, other ASDF add-ons offered the same functionality, each in
subtly different and incompatible ways: ASDF-Binary-Locations, cl-launch, common-lisp-
controller. ASDF-Binary-Locations is now not needed anymore and should not be used.
cl-launch 3.000 and common-lisp-controller 7.2 have been updated to delegate object file
placement to ASDF.
clear-configuration [Function]
Undoes any ASDF configuration regarding source-registry or output-translations.
5 Using ASDF
not necessarily load any of them in the current image; on most systems, it will not
load all compiled files in the current image. This function exists for symmetry with
load-system but is not recommended unless you are writing build scripts and know
what you’re doing. But then, you might be interested in program-op rather than
compile-op.
test-system system &rest keys &key force force-not verbose version [Function]
&allow-other-keys
Apply operate with the operation test-op, the system, and any provided keyword
arguments. See [test-op], page 30.
cl:require and require-system are appropriate to load code that is not being
modified during the current programming session. cl:require will notably load the
implementation-provided extension modules; require-system won’t, unless they are
also defined as systems somehow, which SBCL and MKCL do. require-system
may also be used to load any number of ASDF systems that the user isn’t either
developing or debugging, for which a previously installed version is deemed to be
satisfactory; cl:require on the above-mentioned implementations will delegate to
require-system and may load them as well. But for code that you are actively de-
veloping, debugging, or otherwise modifying, you should use load-system, so ASDF
will pick on your modifications and transitively re-build the modified files and every-
thing that depends on them (that the requested system itself depends on — ASDF
itself never builds anything unless it’s an explicitly requested system or the depen-
dencies thereof).
1
For the curious, the option is :force-not (already-loaded-systems).
Chapter 5: Using ASDF 12
5.3 Moving on
That’s all you need to know to use ASDF to load systems written by others. The rest of this
manual deals with writing system definitions for Common Lisp software you write yourself,
including how to extend ASDF to define new operation and component types.
13
(defsystem "hello-lisp"
:description "hello-lisp: a sample Lisp system."
:version "0.0.1"
:author "Joe User <joe@example.com>"
:licence "Public Domain"
:depends-on ("optima.ppcre" "command-line-arguments")
:components ((:file "packages")
(:file "macros" :depends-on ("packages"))
(:file "hello" :depends-on ("macros"))))
Some notes about this example:
• The defsystem form defines a system named hello-lisp that contains three source
files: packages.lisp, macros.lisp and hello.lisp.
• The .lisp suffix is implicit for Lisp source files. The source files are located in the
same directory as the .asd file with the system definition.
• The file macros depends on packages (presumably because the package it’s in is de-
fined in packages), and the file hello depends on macros (and hence, transitively on
packages). This means that ASDF will compile and load packages then macros before
starting the compilation of file hello.
• This example system has external dependencies on two other systems, optima.ppcre
(that provides a friendly interface to matching regular expressions), and command-line-
arguments (that provides a way to parse arguments passed from the shell command
line). To use this system, ASDF must be configured to find installed copies of these
systems; it will load them before it tries to compile and load hello-lisp.
• This system also defines a bunch of metadata. While it is optional to define these
fields (and other fields like :bug-tracker, :mailto, :long-name, :long-description,
:source-control), it is strongly recommended to define the fields :description,
:version, :author, and :licence, especially if you intend your software to be even-
tually included in Quicklisp.
• Make sure you know how the :version numbers will be parsed! Only period-separated
non-negative integers are accepted at present. See [Version specifiers], page 21.
• This file contains a single form, the defsystem declaration. No in-package form, no
asdf: package prefix, no nothing. Just the one naked defsystem form. This is what
Chapter 6: Defining systems with defsystem 14
we recommend. More complex system definition files are possible with arbitrary Lisp
code, but we recommend that you keep it simple if you can. This will make your system
definitions more robust and more future-proof.
This is all you need to know to define simple systems. The next example is much more
involved, to give you a glimpse of how you can do more complex things. However, since it’s
ultimately arbitrary Lisp code, there is no bottom to the rabbit hole.
(defsystem "foo"
:version (:read-file-form "variables" :at (3 2))
:components
((:file "package")
(:file "variables" :depends-on ("package"))
(:module "mod"
:depends-on ("package")
:serial t
:components ((:file "utils")
(:file "reader")
(:file "cooker")
(:static-file "data.raw"))
:output-files (compile-op (o c) (list "data.cooked"))
:perform (compile-op :after (o c)
(cook-data
:in (component-pathname (find-component c "data.raw"))
:out (first (output-files o c)))))
(:file "foo" :depends-on ("mod"))))
(defmethod action-description
((o compile-op) (c (eql (find-component "foo" "mod"))))
"cooking data")
Here are some notes about this example:
• The main thing this file does is define a system foo. It also contains other Lisp forms,
which we’ll examine below.
• Besides Lisp source files, this system contains a :module component named "mod",
which is a collection of three Lisp source files utils.lisp, reader.lisp, cooker.lisp
and data.raw
• Note that the :static-file does not have an implicit file type, unlike the Lisp source
files.
• This files will be located in a subdirectory of the main code directory named mod/
(this location could have been overridden to be in the same directory, or in a different
subdirectory; see the discussion of the :pathname option in Section 6.3 [The defsystem
grammar], page 16).
Chapter 6: Defining systems with defsystem 15
• The :serial t says that each sub-component of mod depends on the previous compo-
nents, so that cooker.lisp depends-on reader.lisp, which depends-on utils.lisp.
Also data.raw depends on all of them, but that doesn’t matter since it’s a static file;
on the other hand, if it appeared first, then all the Lisp files would be recompiled when
the data is modified, which is probably not what is desired in this case.
• The method-form tokens provide a shorthand for defining methods on particular com-
ponents. This part
:output-files (compile-op (o c) (list "data.cooked"))
:perform (compile-op :after (o c)
(cook-data
:in (component-pathname (find-component c "data.raw"))
:out (first (output-files o c))))
has the effect of
(defmethod output-files ((o compile-op) (c (eql ...)))
(list "data.cooked"))
(defmethod perform :after ((o compile-op) (c (eql ...)))
(cook-data
:in (component-pathname (find-component c "data.raw"))
:out (first (output-files o c))))
where ... is the component in question. In this case ... would expand to something
like
(find-component "foo" "mod")
For more details on the syntax of such forms, see Section 6.3 [The defsystem grammar],
page 16. For more details on what these methods do, see Section 7.1 [Operations],
page 28, in Chapter 7 [The object model of ASDF], page 28.
• There is an additional defmethod with a similar effect, because ASDF (as of ASDF
3.1.5) fails to accept inline-methods as above for action-description, instead only
supporting the deprecated explain interface.
• In this case, these methods describe how this module defines code that it then uses to
cook some data.
• Importantly, ASDF is told about the input and output files used by the data cooker,
and to make sure everyone agrees, the cooking function explicitly uses ASDF to access
pathnames to the input and output data.
• The file starts with a form (in-package :asdf-user), but it is actually redundant, not
necessary and not recommended. But yet more complex cases (also not recommended)
may usefully use an in-package form.
• Indeed, ASDF does not load .asd files simply with cl:load, and neither should you.
You should let ASDF find and load them when you operate on systems. If you somehow
must load a .asd file, use the same function asdf:load-asd that ASDF uses. Among
other things, it already binds the *package* to asdf-user. Recent versions of SLIME
(2013-02 and later) know to do that when you C-c C-k when you use the slime-asdf
contrib.
• You shouldn’t use an in-package form if you’re keeping things simple. You should
only use in-package (and before it, a defpackage) when you’re going to define new
Chapter 6: Defining systems with defsystem 16
classes, functions, variables, macros, etc., in the .asd file, and want to thereby avoid
name clashes. Manuals for old versions of ASDF recommended use of such an idiom
in .asd files, but as of ASDF 3, we recommend that you don’t do that anymore,
and instead define any ASDF extensions in their own system, on which you can then
declare a dependency using :defsystem-depends-on. See Section 6.3 [The defsystem
grammar], page 16.
• More generally, you can always rely on symbols from packages asdf, common-lisp
and uiop being available in .asd files — most importantly including defsystem. It
is therefore redundant and in bad taste to use a package-prefixed asdf:defsystem
symbol in a .asd file. Just use (defsystem ...). Only package-prefix it when somehow
dynamically generating system definitions from a package that doesn’t already use the
ASDF package.
• asdf-user is actually only available starting since ASDF 3, but then again, ASDF 1
and 2 did crazy things with packages that ASDF 3 has stopped doing1 , and since all
implementations provide ASDF 3, you shouldn’t care about compatibility with ASDF
2. We do not support ASDF 2 anymore, and we recommend that neither should you.
• Starting with ASDF 3.1, asdf-user uses uiop, whereas in earlier variants of ASDF 3
it only used uiop/package. We recommend you either prefix use of UIOP functions
with the package prefix uiop:, or make sure your system :depends-on ((:version
"asdf" "3.1.2")) or has a #-asdf3.1 (error "MY-SYSTEM requires ASDF 3.1.2").
• Finally, we elided most metadata, but showed how you can have ASDF automatically
extract the system’s version from a source file. In this case, the 3rd subform of the 4th
form (note that Lisp uses 0-based indexing, English uses 1-based indexing). Presum-
ably, the 4th form looks like (defparameter *foo-version* "5.6.7").
system-designator := simple-component-name
| complex-component-name
| :weakly-depends-on system-list
| :class class-name # see [System class names], page 19
| :build-pathname pathname-specifier
| :build-operation operation-name
| system-option/asdf3
| module-option
| option
# These are only available since ASDF 3 (actually its alpha release
# 2.27)
system-option/asdf3 := :homepage string
| :bug-tracker string
| :mailto string
| :long-name string
| :source-control source-control
| :version version-specifier
| :entry-point object # see [Entry point], page 24
system-list := ( simple-component-name* )
component-list := ( component-def* )
version-specifier := string
| ( :read-file-form pathname-specifier form-specifier? )
| ( :read-file-line pathname-specifier line-specifier? )
line-specifier := :at integer # base zero
form-specifier := :at [ integer | ( integer+ ) ]
feature-expression := keyword
| ( :and feature-expression* )
| ( :or feature-expression* )
| ( :not feature-expression )
operation-name := symbol
Symbols will be interpreted as convenient shorthand for the string that is their
symbol-name, converted to lower case. Put differently, a symbol may be a simple
component name designator, but the simple component name itself is the string.
Never use underscores in component names, whether written as strings or symbols.
Never use slashes (“/”) in simple component names. A slash indicates a complex com-
ponent name; see below. Using a slash improperly will cause ASDF to issue a warning.
Violating these constraints by mixing case, or including underscores in component names,
may lead to systems or components being impossible to find, because component names are
interpreted as file names. These problems will definitely occur for users who have configured
ASDF using logical pathnames.
nition is processed. Typically this is used to load an ASDF extension that is used in the
system definition.
6.3.7 Build-operation
The :build-operation option to defsystem allows the programmer to specify an operation
that will be applied, in place of load-op when make (see Section 5.2 [Convenience Functions],
page 10) is run on the system. The option value should be the name of an operation. E.g.,
:build-operation doc-op
This feature is experimental and largely untested. Use at your own risk.
If a symbol is given, it will be translated into a string, and downcased in the process.
The downcasing of symbols is unconventional, but was selected after some consideration.
The file systems we support either have lowercase as customary case (Unix, Mac, Windows)
or silently convert lowercase to uppercase (lpns), so this makes more sense than attempting
to use :case :common as argument to make-pathname, which is reported not to work on
some implementations.
Please avoid using underscores in system names, or component (module or file) names,
since underscores are not compatible with logical pathnames (see [Using logical pathnames],
page 22).
Pathname objects may be given to override the path for a component. Such ob-
jects are typically specified using reader macros such as #p or #.(make-pathname ...).
Note however, that #p... is a shorthand for #.(parse-namestring ...) and that the
behaviour of parse-namestring is completely non-portable, unless you are using Com-
mon Lisp logical-pathnames, which themselves involve other non-portable behaviour (see
[Using logical pathnames], page 22). Pathnames made with #.(make-pathname ...) can
usually be done more easily with the string syntax above. The only case that you really
need a pathname object is to override the component-type default file type for a given com-
ponent. Therefore, pathname objects should only rarely be used. Unhappily, ASDF 1 used
not to properly support parsing component names as strings specifying paths with directo-
ries, and the cumbersome #.(make-pathname ...) syntax had to be used. An alternative
to #. read-time evaluation is to use (eval ‘(defsystem ... ,pathname ...)).
Note that when specifying pathname objects, ASDF does not do any special interpreta-
tion of the pathname influenced by the component type, unlike the procedure for pathname-
specifying strings. On the one hand, you have to be careful to provide a pathname that
correctly fulfills whatever constraints are required from that component type (e.g. naming
a directory or a file with appropriate type); on the other hand, you can circumvent the file
type that would otherwise be forced upon you if you were specifying a string.
the third subform (index 2) of the second form (index 1)” in the file (mind the off-by-one
error in the English language).
System definers are encouraged to use version identifiers of the form x.y.z for major
version, minor version and patch level, where significant API incompatibilities are signaled
by an increased major number.
See Section 7.2.1 [Common attributes of components], page 37.
6.3.11 Require
Use the implementation’s own require to load the module-name.
It is good taste to use (:feature :implementation-name (:require module-name))
rather than #+implementation-name (:require module-name) to only depend on
the specified module on the specific implementation that provides it. See [Feature
dependencies], page 22.
If you wish to use logical pathnames you will have to configure the translations yourself
before they may be used. ASDF currently provides no specific support for defining logical
pathname translations.
Note that the reasons we do not recommend logical pathnames are that (1) there is no
portable way to set up logical pathnames before they are used, (2) logical pathnames are
limited to only portably use a single character case, digits and hyphens. While you can
solve the first issue on your own, describing how to do it on each of fifteen implementations
supported by ASDF is more than we can document. As for the second issue, mind that the
limitation is notably enforced on SBCL, and that you therefore can’t portably violate the
limitations but must instead define some encoding of your own and add individual mappings
to name physical pathnames that do not fit the restrictions. This can notably be a problem
when your Lisp files are part of a larger project in which it is common to name files or
directories in a way that includes the version numbers of supported protocols, or in which
files are shared with software written in different programming languages where conventions
include the use of underscores, dots or CamelCase in pathnames.
If so, here are some conventions we recommend you follow, so that users can control certain
details of execution of the Lisp in .asd files:
• Any informative output (other than warnings and errors, which are the condition sys-
tem’s to dispose of) should be sent to the standard CL stream *standard-output*, so
that users can easily control the disposition of output from ASDF operations.
(register-system-packages
"closer-mop"
'(:c2mop
:closer-common-lisp
:c2cl
Chapter 6: Defining systems with defsystem 26
:closer-common-lisp-user
:c2cl-user))
In the code above, the first form checks that we are using ASDF 3.1 or later, which provides
package-inferred-system. This is probably no longer necessary, since none of the major
lisp implementations provides an older version of ASDF.
The function register-system-packages must be called to register packages used or
provided by your system when the name of the system/file that provides the package is not
the same as the package name (converted to lower case).
Each file under the my-lib hierarchy will start with a package definition. The form
uiop:define-package is supported as well as defpackage. ASDF will compute dependen-
cies from the :use, :mix, and other importation clauses of this package definition. Take
the file interface/order.lisp as an example:
(uiop:define-package :my-lib/interface/order
(:use :closer-common-lisp
:my-lib/interface/definition
:my-lib/interface/base)
(:mix :fare-utils :uiop :alexandria)
(:export ...))
ASDF can tell that this file/system depends on system closer-mop (registered above),
my-lib/interface/definition, and my-lib/interface/base.
How can ASDF find the file interface/order.lisp from the toplevel system my-lib,
however? In the example above, interface/all.lisp (and other all.lisp) reexport all
the symbols exported from the packages at the same or lower levels of the hierarchy. This
can be easily done with uiop:define-package, which has many options that prove useful
in this context. For example:
(uiop:define-package :my-lib/interface/all
(:nicknames :my-lib-interface)
(:use :closer-common-lisp)
(:mix :fare-utils :uiop :alexandria)
(:use-reexport
:my-lib/interface/definition
:my-lib/interface/base
:my-lib/interface/order
:my-lib/interface/monad/continuation))
Thus the top level system need only depend on the my-lib/.../all systems because
ASDF detects interface/order.lisp and all other dependencies from all systems’
:use-reexport clauses, which effectively allow for “inheritance” of symbols being
exported.
ASDF also detects dependencies from :import-from clauses. You may thus import a
well-defined set of symbols from an existing package, and ASDF will know to load the
system that provides that package. In the following example, ASDF will infer that the
current system depends on foo/baz from the first :import-from. If you prefer to use any
such symbol fully qualified by a package prefix, you may declare a dependency on such a
package and its corresponding system via an :import-from clause with an empty list of
27
symbols. For example, if we preferred to use the name ‘foo/quux:bletch‘, the second, empty,
:import-from form would cause ASDF to load foo/quux.
(defpackage :foo/bar
(:use :cl)
(:import-from :foo/baz #:sym1 #:sym2)
(:import-from :foo/quux)
(:export ...))
Note that starting with ASDF 3.1.5.6 only, ASDF will look for source files under the
component-pathname (specified via the :pathname option), whereas earlier versions ignore
this option and use the system-source-directory where the .asd file resides.
28
7.1 Operations
An operation object of the appropriate type is instantiated whenever the user wants to do
something with a system like
• compile all its files
• load the files into a running lisp environment
• copy its source files somewhere else
Operations can be invoked directly, or examined to see what their effects would be
without performing them. There are a bunch of methods specialised on operation and
component type that actually do the grunt work. Operations are invoked on systems via
operate (see [operate], page 29).
1
Historically, the function that built a plan was called traverse, and returned a list of actions; it was
deprecated in favor of make-plan (that returns a plan object) when the plan objects were introduced
with ASDF 3; the old function is kept for backward compatibility and debugging purposes only, and
may be removed in the near future.
2
The term action was used by Kent Pitman in his article, “The Description of Large Systems,” (see
[Bibliography], page 86), and we suspect might be traced to make. Although the term was only used by
ASDF hackers starting with ASDF 2, the concept was there since the very beginning of ASDF 1, just
not clearly articulated.
Chapter 7: The Object model of ASDF 29
ASDF contains a number of pre-defined operation classes for common, and even fairly
uncommon tasks that you might want to do with it. In addition, ASDF contains “abstract”
operation classes that programmers can use as building blocks to define ASDF extensions.
We discuss these in turn below.
Operations are invoked on systems via operate.
operate operation component &rest initargs &key force [Generic function]
force-not verbose &allow-other-keys
oos operation component &rest initargs &key [Generic function]
&allow-other-keys
operate invokes operation on system. oos is a synonym for operate (it stands for
operate-on-system).
operation is an operation designator: it can be an operation object itself, or, typically,
a symbol that is passed to make-operation (which will call make-instance), to create
the operation object. component is a component designator: it can be a component
object itself, or, typically, a string or symbol (to be string-downcased) that names
a system, more rarely a list of strings or symbols that designate a subcomponent of
a system.
The ability to pass initargs to make-operation is now deprecated, and will be re-
moved. For more details, see [make-operation], page 29. Note that dependencies may
cause the operation to invoke other operations on the system or its components: the
new operations may or may not be created with the same initargs as the original one
(for the moment).
If force is :all, then all systems are forced to be recompiled even if not modified
since last compilation. If force is t, then only the system being loaded is forced to
be recompiled even if not modified since last compilation, but other systems are not
affected. If force is a list, then it specifies a list of systems that are forced to be
recompiled even if not modified since last compilation. If force-not is :all, then all
systems are forced not to be recompiled even if modified since last compilation. If
force-not is t, then all systems but the system being loaded are forced not to be
recompiled even if modified since last compilation (note: this was changed in ASDF
3.1.2). If force-not is a list, then it specifies a list of systems that are forced not to
be recompiled even if modified since last compilation.
Both force and force-not apply to systems that are dependencies and were already
compiled. force-not takes precedences over force, as it should, really, but unhappily
only since ASDF 3.1.2. Moreover, systems which have been registered as immutable
by register-immutable-system (since ASDF 3.1.5) are always considered forced-
not, and even their .asd are not refreshed from the filesystem. See Section 11.3
[Miscellaneous Functions], page 63.
To see what operate would do, you can use:
(asdf:traverse operation-class system-name)
make-operation operation-class &rest initargs [Function]
The initargs are passed to make-instance call when creating the operation object.
Note:initargs for operations are now deprecated, and will be removed from ASDF
in the near future.
Chapter 7: The Object model of ASDF 30
compile-op [Operation]
This operation compiles the specified component. A cl-source-file will be
compile-file’d. All the children and dependencies of a system or module will be
recursively compiled by compile-op.
compile-op depends on prepare-op which itself depends on a load-op of all of a
component’s dependencies, as well as of its parent’s dependencies. When operate is
called on compile-op, all these dependencies will be loaded as well as compiled; yet,
some parts of the system main remain unloaded, because nothing depends on them.
Use load-op to load a system.
load-op [Operation]
This operation loads the compiled code for a specified component. A cl-source-
file will have its compiled fasl loaded, which fasl is the output of compile-op that
load-op depends on.
load-op will recursively load all the children of a system or module.
load-op also depends on prepare-op which itself depends on a load-op of all of a
component’s dependencies, as well as of its parent’s dependencies.
prepare-op [Operation]
This operation ensures that the dependencies of a component and its recursive par-
ents are loaded (as per load-op), as a prerequisite before compile-op and load-op
operations may be performed on a given component.
load-source-op [Operation]
prepare-source-op [Operation]
load-source-op will load the source for the files in a module rather than the compiled
fasl output. It has a prepare-source-op analog to prepare-op, that ensures the
dependencies are themselves loaded via load-source-op.
test-op [Operation]
This operation will perform some tests on the module. The default method will
do nothing. The default dependency is to require load-op to be performed on the
module first. Its default operation-done-p method returns nil, which means that
the operation is never done – we assume that if you invoke the test-op, you want to
test the system, even if you have already done so.
The results of this operation are not defined by ASDF. It has proven difficult to define
how the test operation should signal its results to the user in a way that is compatible
with all of the various test libraries and test techniques in use in the community, and
Chapter 7: The Object model of ASDF 31
given the fact that ASDF operations do not return a value indicating success or failure.
For those willing to go to the effort, we suggest defining conditions to signal when a
test-op fails, and storing in those conditions information that describes which tests
fail.
People typically define a separate test system to hold the tests. Doing this avoids
unnecessarily adding a test framework as a dependency on a library. For example,
one might have
(defsystem "foo"
:in-order-to ((test-op (test-op "foo/test")))
...)
(defsystem "foo/test"
:depends-on ("foo" "fiveam") ; fiveam is a test framework library
...)
Then one defines perform methods on test-op such as the following:
(defsystem "foo/test"
:depends-on ("foo" "fiveam") ; fiveam is a test framework library
:perform (test-op (o s)
(uiop:symbol-call :fiveam ’#:run!
(uiop:find-symbol* ’#:foo-test-suite
:foo-tests)))
...)
compile-bundle-op [Operation]
monolithic-compile-bundle-op [Operation]
load-bundle-op [Operation]
monolithic-load-bundle-op [Operation]
deliver-asd-op [Operation]
monolithic-deliver-asd-op [Operation]
lib-op [Operation]
monolithic-lib-op [Operation]
dll-op [Operation]
monolithic-dll-op [Operation]
image-op [Operation]
program-op [Operation]
These are “bundle” operations, that can create a single-file “bundle” for all the con-
tents of each system in an application, or for the entire application.
compile-bundle-op will create a single fasl file for each of the systems needed,
grouping all its many fasls in one, so you can deliver each system as a single fasl.
monolithic-compile-bundle-op will create a single fasl file for the target system
and all its dependencies, so you can deliver your entire application as a single fasl.
load-bundle-op will load the output of compile-bundle-op. Note that if the output
is not up-to-date, compile-bundle-op may load the intermediate fasls as a side-effect.
Bundling fasls together matters a lot on ECL, where the dynamic linking involved
in loading tens of individual fasls can be noticeably more expensive than loading a
single one.
Chapter 7: The Object model of ASDF 32
concatenate-source-op [Operation]
monolithic-concatenate-source-op [Operation]
load-concatenated-source-op [Operation]
compile-concatenated-source-op [Operation]
load-compiled-concatenated-source-op [Operation]
monolithic-load-concatenated-source-op [Operation]
monolithic-compile-concatenated-source-op [Operation]
monolithic-load-compiled-concatenated-source-op [Operation]
These operations, as their respective names indicate, will concatenate all the
cl-source-file source files in a system (or in a system and all its dependencies, if
monolithic), in the order defined by dependencies, then load the result, or compile
and then load the result.
These operations are useful to deliver a system or application as a single source file,
and for testing that said file loads properly, or compiles and then loads properly.
ASDF itself is delivered as a single source file this way, using monolithic-concatenate-
source-op, prepending a prelude and the uiop library before the asdf/defsystem
system itself.
7.2 Components
A component represents an individual source file or a group of source files, and the things
that get transformed into. A system is a component at the top level of the component
hierarchy, that can be found via find-system. A source-file is a component representing
Chapter 7: The Object model of ASDF 35
a single source-file and the successive output files into which it is transformed. A module is
an intermediate component itself grouping several other components, themselves source-files
or further modules.
A system designator is a system itself, or a string or symbol that behaves just like any
other component name (including with regard to the case conversion rules for component
names).
A component designator, relative to a base component, is either a component itself, or
a string or symbol, or a list of designators.
It is often useful to define multiple systems in a same file, but ASDF can only locate
a system’s definition file based on the system name. For this reason, ASDF 3’s sys-
tem search algorithm has been extended to allow a file foo.asd to contain secondary
systems named foo/bar, foo/baz, foo/quux, etc., in addition to the primary system
named foo. The first component of a system name, separated by the slash character,
/, is called the primary name of a system. The primary name may be extracted by
function asdf::primary-system-name; when ASDF 3 is told to find a system whose
name has a slash, it will first attempt to load the corresponding primary system,
and will thus see any such definitions, and/or any definition of a package-inferred-
system.4 If your file foo.asd also defines systems that do not follow this convention,
e.g., a system named foo-test, ASDF will not be able to automatically locate a def-
inition for these systems, and will only see their definition if you explicitly find or
load the primary system using e.g. (asdf:find-system "foo") before you try to use
them. We strongly recommend against this practice, though it is currently supported
for backward compatibility.
primary-system-name name [Function]
Internal (not exported) function, asdf::primary-system-name. Returns the primary
system name (the portion before the slash, /, in a secondary system name) from name.
locate-system name [Function]
This function should typically not be invoked directly. It is exported as part of the
API only for programmers who wish to provide their own *system-definition-
search-functions*.
Given a system name designator, try to locate where to load the system definition
from. Returns five values: foundp, found-system, pathname, previous, and previous-
time. foundp is true when a system was found, either a new as yet unregistered one,
or a previously registered one. The found-system return value will be a system object,
if a system definition is found in your source registry. The system definition will not
be loaded if it hasn’t been loaded already. pathname when not null is a path from
which to load the system, either associated with found-system, or with the previous
system. If previous is not null, it will be a previously loaded system object of the
same name (note that the system definition is previously-loaded: the system itself
may or may not be). previous-time when not null is the timestamp of the previous
system definition file, at the time when the previous system definition was loaded.
For example, if your current registry has foo.asd in /current/path/to/foo.asd, but
system foo was previously loaded from /previous/path/to/foo.asd then locate-
system will return the following values:
1. foundp will be t,
2. found-system will be nil,
3. pathname will be #p"/current/path/to/foo.asd",
4. previous will be an object of type SYSTEM with system-source-file slot value
of #p"/previous/path/to/foo.asd"
4
ASDF 2.26 and earlier versions do not support this primary system name convention. With these
versions of ASDF you must explicitly load foo.asd before you can use system foo/bar defined therein,
e.g. using (asdf:find-system "foo"). We do not support ASDF 2, and recommend that you should
upgrade to ASDF 3.
Chapter 7: The Object model of ASDF 37
7.2.1.1 Name
A component name is a string or a symbol. If a symbol, its name is taken and lowercased.
This translation is performed by the exported function coerce-name.
Unless overridden by a :pathname attribute, the name will be interpreted as a pathname
specifier according to a Unix-style syntax. See [Pathname specifiers], page 20.
7.2.1.4 Dependencies
This attribute specifies dependencies of the component on its siblings. It is optional but
often necessary.
There is an excitingly complicated relationship between the initarg and the method that
you use to ask about dependencies
Dependencies are between (operation component) pairs. In your initargs for the compo-
nent, you can say
:in-order-to ((compile-op (load-op "a" "b") (compile-op "c"))
(load-op (load-op "foo")))
This means the following things:
• before performing compile-op on this component, we must perform load-op on a and
b, and compile-op on c,
• before performing load-op, we have to load foo
The syntax is approximately
(this-op @{(other-op required-components)@}+)
simple-component-name := string
| symbol
required-components := simple-component-name
| (required-components required-components)
component-name := simple-component-name
| (:version simple-component-name minimum-version-object)
Side note:
Chapter 7: The Object model of ASDF 39
This is on a par with what ACL defsystem does. mk-defsystem is less general: it has an
implied dependency
for all source file x, (load x) depends on (compile x)
and using a :depends-on argument to say that b depends on a actually means that
(compile b) depends on (load a)
This is insufficient for e.g. the McCLIM system, which requires that all the files are
loaded before any of them can be compiled ]
End side note
In ASDF, the dependency information for a given component and operation can be
queried using (component-depends-on operation component), which returns a list
((load-op "a") (load-op "b") (compile-op "c") ...)
component-depends-on can be subclassed for more specific component/operation types:
these need to (call-next-method) and append the answer to their dependency, unless they
have a good reason for completely overriding the default dependencies.
If it weren’t for CLISP, we’d be using LIST method combination to do this transparently.
But, we need to support CLISP. If you have the time for some CLISP hacking, I’m sure
they’d welcome your fixes.
A minimal version can be specified for a component you depend on (typically
another system), by specifying (:version "other-system" "1.2.3") instead of simply
"other-system" as the dependency. See the discussion of the semantics of :version in
the defsystem grammar.
7.2.1.5 pathname
This attribute is optional and if absent (which is the usual case), the component name will
be used.
See [Pathname specifiers], page 20, for an explanation of how this attribute is interpreted.
Note that the defsystem macro (used to create a “top-level” system) does additional
processing to set the filesystem location of the top component in that system. This is
detailed elsewhere. See Chapter 6 [Defining systems with defsystem], page 13.
To find the CL pathname corresponding to a component, use
7.2.1.6 properties
This attribute is optional.
Packaging systems often require information about files or systems in addition to that
specified by ASDF’s pre-defined component attributes. Programs that create vendor pack-
ages out of ASDF systems therefore have to create “placeholder” information to satisfy these
systems. Sometimes the creator of an ASDF system may know the additional information
and wish to provide it directly.
(component-property component property-name) and associated setf method will al-
low the programmatic update of this information. Property names are compared as if by
EQL, so use symbols or keywords or something.
Users can create new classes for their systems: the default defsystem macro takes a
:class keyword argument.
7.3 Dependencies
To be successfully build-able, this graph of actions must be acyclic. If, as a user, extender
or implementer of ASDF, you introduce a cycle into the dependency graph, ASDF will
fail loudly. To clearly distinguish the direction of dependencies, ASDF 3 uses the words
requiring and required as applied to an action depending on the other: the requiring action
depends-on the completion of all required actions before it may itself be performed.
Using the defsystem syntax, users may easily express direct dependencies along the
graph of the object hierarchy: between a component and its parent, its children, and its
siblings. By defining custom CLOS methods, you can express more elaborate dependencies
as you wish. Most common operations, such as load-op, compile-op or load-source-
op are automatically propagate “downward” the component hierarchy and are “covariant”
with it: to act the operation on the parent module, you must first act it on all the children
components, with the action on the parent being parent of the action on each child. Other
operations, such as prepare-op and prepare-source-op (introduced in ASDF 3) are auto-
matically propagated “upward” the component hierarchy and are “contravariant” with it:
to perform the operation of preparing for compilation of a child component, you must per-
form the operation of preparing for compilation of its parent component, and so on, ensuring
Chapter 7: The Object model of ASDF 42
that all the parent’s dependencies are (compiled and) loaded before the child component
may be compiled and loaded. Yet other operations, such as test-op or load-bundle-op
remain at the system level, and are not propagated along the hierarchy, but instead do
something global on the system.
7.4 Functions
version-satisfies version version-spec [Function]
Does version satisfy the version-spec. A generic function. ASDF provides built-in
methods for version being a component or string. version-spec should be a string.
If it’s a component, its version is extracted as a string before further processing.
A version string satisfies the version-spec if after parsing, the former is no older than
the latter. Therefore "1.9.1", "1.9.2" and "1.10" all satisfy "1.9.1", but "1.8.4"
or "1.9" do not. For more information about how version-satisfies parses and
interprets version strings and specifications, see [Version specifiers], page 21, and
Section 7.2.1 [Common attributes of components], page 37.
Note that in versions of ASDF prior to 3.0.1, including the entire ASDF 1 and ASDF
2 series, version-satisfies would also require that the version and the version-spec
have the same major version number (the first integer in the list); if the major version
differed, the version would be considered as not matching the spec. But that feature
was not documented, therefore presumably not relied upon, whereas it was a nuisance
to several users. Starting with ASDF 3.0.1, version-satisfies does not treat the
major version number specially, and returns T simply if the first argument designates
a version that isn’t older than the one specified as a second argument. If needs be, the
(:version ...) syntax for specifying dependencies could be in the future extended
to specify an exclusive upper bound for compatible versions as well as an inclusive
lower bound.
43
8.1 Configurations
Configurations specify paths where to find system files.
1. The search registry may use some hardcoded wrapping registry specification. This
allows some implementations (notably SBCL) to specify where to find some special
implementation-provided systems that need to precisely match the version of the im-
plementation itself.
2. An application may explicitly initialize the source-registry configuration using the con-
figuration API (see Chapter 8 [Configuration API], page 43, below) in which case this
takes precedence. It may itself compute this configuration from the command-line,
from a script, from its own configuration file, etc.
3. The source registry will be configured from the environment variable CL_SOURCE_
REGISTRY if it exists.
4. The source registry will be configured from user configuration file $XDG_
CONFIG_DIRS/common-lisp/source-registry.conf (which defaults to
~/.config/common-lisp/source-registry.conf) if it exists.
5. The source registry will be configured from user configuration directory
$XDG_CONFIG_DIRS/common-lisp/source-registry.conf.d/ (which defaults to
~/.config/common-lisp/source-registry.conf.d/) if it exists.
6. The source registry will be configured from default user configuration trees
~/common-lisp/ (since ASDF 3.1.2 only), ~/.sbcl/systems/ (on SBCL only),
$XDG_DATA_HOME/common-lisp/systems/ (no recursion, link farm) $XDG_
DATA_HOME/common-lisp/source/. The XDG_DATA_HOME directory defaults to
~/.local/share/. On Windows, the local-appdata and appdata directories are
used instead.
7. The source registry will be configured from system configuration file
/etc/common-lisp/source-registry.conf if it exists.
8. The source registry will be configured from system configuration directory
/etc/common-lisp/source-registry.conf.d/ if it exists.
9. The source registry will be configured from a default configuration. This configura-
tion may allow for implementation-specific systems to be found, for systems to be
found the current directory (at the time that the configuration is initialized) as well
as :directory entries for $XDG_DATA_DIRS/common-lisp/systems/ and :tree en-
tries for $XDG_DATA_DIRS/common-lisp/source/, where XDG_DATA_DIRS defaults to
/usr/local/share and /usr/share on Unix, and the common-appdata directory on
Windows.
10. The source registry may include implementation-dependent directories that correspond
to implementation-provided extensions.
Each of these configurations is specified as an s-expression in a trivial domain-specific
language (defined below). Additionally, a more shell-friendly syntax is available for the
environment variable (defined yet below).
Chapter 8: Controlling where ASDF searches for systems 44
Each of these configurations is only used if the previous configuration explicitly or im-
plicitly specifies that it includes its inherited configuration.
Additionally, some implementation-specific directories may be automatically prepended
to whatever directories are specified in configuration files, no matter if the last one inherits
or not.
REGULAR-FILE-PATHNAME-DESIGNATOR
:= PATHNAME-DESIGNATOR ; interpreted as a file
DIRECTORY-PATHNAME-DESIGNATOR
:= PATHNAME-DESIGNATOR ; interpreted as a directory
PATHNAME-DESIGNATOR :=
NIL | ;; Special: skip this entry.
ABSOLUTE-COMPONENT-DESIGNATOR ;; see pathname DSL
RELATIVE-COMPONENT-DESIGNATOR :=
(RELATIVE-COMPONENT-DESIGNATOR RELATIVE-COMPONENT-DESIGNATOR ...) |
Chapter 8: Controlling where ASDF searches for systems 47
STRING |
;; relative directory pathname as interpreted by
;; parse-unix-namestring.
;; In output translations, if last component, **/*.*.* is added
PATHNAME | ; pathname; unless last component, directory is assumed.
:IMPLEMENTATION |
;; directory based on implementation, e.g. sbcl-1.0.45-linux-x64
:IMPLEMENTATION-TYPE |
;; a directory based on lisp-implementation-type only, e.g. sbcl
:DEFAULT-DIRECTORY |
;; a relativized version of the default directory
:*/ | ;; any direct subdirectory (since ASDF 2.011.4)
:**/ | ;; any recursively inferior subdirectory (since ASDF 2.011.4)
:*.*.* | ;; any file (since ASDF 2.011.4)
registry.cache in that directory. In either case, for an existing Lisp process to see this
change, it needs to clear its own cache with e.g. (asdf:clear-source-registry).
Developers may safely create a cache in their development tree, and we recommend
they do it at the top of their source tree if it contains more than a small number of files
and directories; they only need update it when they create, remove or move .asd files.
Software distribution managers may also safely create such a cache, but they must be
careful to update it every time they install, update or remove a software source repository
or installation package. Finally, advanced developers who juggle with a lot of code in their
source-registry may manually manage such a cache, to allow for faster startup of Lisp
programs.
This persistence cache can help you reduce startup latency. For instance, on one machine
with hundreds of source repositories, such a cache shaves half a second at the startup of every
#!/usr/bin/cl script using SBCL, more on other implementations; this makes a notable
difference as to their subjective interactivity and usability. The speedup will only happen
if the implementation-provided ASDF is recent enough (3.1.3.7 or later); it is not enough
for a recent ASDF upgrade to be present, since the upgrade will itself be found but after
the old version has scanned the directories without heeding such a cache. To upgrade the
implementation-provided ASDF, see Section 3.4 [Replacing your implementation’s ASDF],
page 4.
clear-source-registry [Function]
undoes any source registry configuration and clears any cache for the search algorithm.
You might want to call this function (or better, clear-configuration) before you
dump an image that would be resumed with a different configuration, and return
an empty configuration. Note that this does not include clearing information about
systems defined in the current image, only about where to look for systems not yet
defined.
Every time you use ASDF’s find-system, or anything that uses it (such as operate,
load-system, etc.), ensure-source-registry is called with parameter nil, which the first
Chapter 8: Controlling where ASDF searches for systems 51
time around causes your configuration to be read. If you change a configuration file, you
need to explicitly initialize-source-registry again, or maybe simply to clear-source-
registry (or clear-configuration) which will cause the initialization to happen next time
around.
8.11 Introspection
8.11.1 *source-registry-parameter* variable
We have made available the variable *source-registry-parameter* that can be used by
code that wishes to introspect about the (past) configuration of ASDF’s source registry. This
variable should never be set! It will be set as a side-effect of calling initialize-source-
registry; user code should treat it as read-only.
8.12 Status
This mechanism is vastly successful, and we have declared that asdf:*central-registry*
is not recommended anymore, though we will continue to support it. All hooks into
implementation-specific search mechanisms have been integrated in the wrapping-source-
registry that everyone uses implicitly.
8.14 TODO
• Add examples
9.1 Configurations
Configurations specify mappings from input locations to output locations. Once again we
rely on the XDG base directory specification for configuration. See Chapter 8 [XDG base
directory], page 43.
1. Some hardcoded wrapping output translations configuration may be used. This allows
special output translations (or usually, invariant directories) to be specified correspond-
ing to the similar special entries in the source registry.
2. An application may explicitly initialize the output-translations configuration using the
Configuration API in which case this takes precedence. (see Chapter 9 [Configuration
API], page 53.) It may itself compute this configuration from the command-line, from
a script, from its own configuration file, etc.
3. The source registry will be configured from the environment variable ASDF_OUTPUT_
TRANSLATIONS if it exists.
4. The source registry will be configured from user configuration file $XDG_
CONFIG_DIRS/common-lisp/asdf-output-translations.conf (which defaults to
~/.config/common-lisp/asdf-output-translations.conf) if it exists.
5. The source registry will be configured from user configuration directory $XDG_
CONFIG_DIRS/common-lisp/asdf-output-translations.conf.d/ (which defaults to
~/.config/common-lisp/asdf-output-translations.conf.d/) if it exists.
6. The source registry will be configured from system configuration file
/etc/common-lisp/asdf-output-translations.conf if it exists.
7. The source registry will be configured from system configuration directory
/etc/common-lisp/asdf-output-translations.conf.d/ if it exists.
Each of these configurations is specified as a SEXP in a trivial domain-specific lan-
guage (see Section 8.5 [Configuration DSL], page 45). Additionally, a more shell-friendly
syntax is available for the environment variable (see Section 8.7 [Shell-friendly syntax for
configuration], page 48).
When processing an entry in the above list of configuration methods, ASDF will stop
unless that entry explicitly or implicitly specifies that it includes its inherited configuration.
1
“FASL” is short for “FASt Loading.”
Chapter 9: Controlling where ASDF saves compiled files 54
Note that by default, a per-user cache is used for output files. This allows the seamless
use of shared installations of software between several users, and takes files out of the way
of the developers when they browse source code, at the expense of taking a small toll when
developers have to clean up output files and find they need to get familiar with output-
translations first.2
If you insist, you can also keep using the old ASDF-Binary-Locations (the one
available as an extension to load of top of ASDF, not the one built into a few old
versions of ASDF), but first you must disable asdf-output-translations with
(asdf:disable-output-translations), or you might experience “interesting” issues.
Also, note that output translation is enabled by default. To disable it, use
(asdf:disable-output-translations).
2
A CLEAN-OP would be a partial solution to this problem.
Chapter 9: Controlling where ASDF saves compiled files 55
DIRECTORY-DESIGNATOR :=
NIL | ; As source: skip this entry. As destination: same as source
T | ; as source matches anything, as destination
; maps pathname to itself.
ABSOLUTE-COMPONENT-DESIGNATOR ; same as in the source-registry language
TRANSLATION-FUNCTION :=
SYMBOL | ;; symbol naming a function that takes two arguments:
;; the pathname to be translated and the matching
Chapter 9: Controlling where ASDF saves compiled files 56
;; DIRECTORY-DESIGNATOR
LAMBDA ;; A form which evaluates to a function taking two arguments:
;; the pathname to be translated and the matching
;; DIRECTORY-DESIGNATOR
Relative components better be either relative or subdirectories of the path before them,
or bust.
The last component, if not a pathname, is notionally completed by /**/*.*. You can
specify more fine-grained patterns by using a pathname object as the last component e.g.
#p"some/path/**/foo*/bar-*.fasl"
You may use #+features to customize the configuration file.
The second designator of a mapping may be nil, indicating that files are not mapped
to anything but themselves (same as if the second designator was the same as the first).
When the first designator is t, the mapping always matches. When the first designator
starts with :root, the mapping matches any host and device. In either of these cases, if the
second designator isn’t t and doesn’t start with :root, then strings indicating the host and
pathname are somehow copied in the beginning of the directory component of the source
pathname before it is translated.
When the second designator is t, the mapping is the identity. When the second designa-
tor starts with :root, the mapping preserves the host and device of the original pathname.
Notably, this allows you to map files to a subdirectory of the whichever directory the
file is in. Though the syntax is not quite as easy to use as we’d like, you can have an
(source destination) mapping entry such as follows in your configuration file, or you may
use enable-asdf-binary-locations-compatibility with :centralize-lisp-binaries
nil which will do the same thing internally for you:
#.(let ((wild-subdir
(make-pathname :directory ’(:relative :wild-inferiors)))
(wild-file
(make-pathname :name :wild :version :wild :type :wild)))
‘((:root ,wild-subdir ,wild-file)
(:root ,wild-subdir :implementation ,wild-file)))
Starting with ASDF 2.011.4, you can use the simpler: ‘(:root (:root :**/
:implementation :*.*.*))
:include statements cause the search to recurse with the path specifications from the
file specified.
If the translate-pathname mechanism cannot achieve a desired translation, the user
may provide a function which provides the required algorithm. Such a translation function
is specified by supplying a list as the second directory-designator the first element of
which is the keyword :function, and the second element of which is either a symbol which
designates a function or a lambda expression. The function designated by the second
argument must take two arguments, the first being the pathname of the source file, the
second being the wildcard that was matched. When invoked, the function should return
the translated pathname.
Chapter 9: Controlling where ASDF saves compiled files 57
An :inherit-configuration statement causes the search to recurse with the path spec-
ifications from the next configuration in the bulleted list. See Chapter 9 [Configurations],
page 53, above.
• :enable-user-cache is the same as (t :user-cache).
• :disable-cache is the same as (t t).
• :user-cache uses the contents of variable asdf::*user-cache* which by default is
the same as using (:home ".cache" "common-lisp" :implementation).
disable-output-translations [Function]
will initialize output translations in a way that maps every pathname to itself, effec-
tively disabling the output translation facility.
clear-output-translations [Function]
undoes any output translation configuration and clears any cache for the mapping
algorithm. You might want to call this function (or better, clear-configuration)
before you dump an image that would be resumed with a different configuration, and
return an empty configuration. Note that this does not include clearing information
about systems defined in the current image, only about where to look for systems not
yet defined.
Chapter 9: Controlling where ASDF saves compiled files 59
Every time you use ASDF’s output-files, or anything that uses it (that may compile,
such as operate, perform, etc.), ensure-output-translations is called with parameter
nil, which the first time around causes your configuration to be read. If you change a con-
figuration file, you need to explicitly initialize-output-translations again, or maybe
clear-output-translations (or clear-configuration), which will cause the initializa-
tion to happen next time around.
10 Error handling
ASDF includes several additional features that are generally useful for system definition
and development.
on unicode characters may fail to work properly, or may work in a subtly different way. See
for instance lambda-reader.
We invite you to embrace UTF-8 as the encoding for non-ASCII characters starting
today, even without any explicit specification in your .asd files. Indeed, on some imple-
mentations and configurations, UTF-8 is already the :default, and loading your code
may cause errors if it is encoded in anything but UTF-8. Therefore, even with the legacy
behaviour, non-UTF-8 is guaranteed to break for some users, whereas UTF-8 is pretty
much guaranteed not to break anywhere (provided you do not use a BOM), although it
might be read incorrectly on some implementations. :utf-8 has been the default value of
*default-encoding* since ASDF 3.
If you need non-standard character encodings for your source code, use the extension
system asdf-encodings, by specifying :defsystem-depends-on ("asdf-encodings") in
your defsystem. This extension system will register support for more encodings using
the *encoding-external-format-hook* facility, so you can explicitly specify :encoding
:latin1 in your .asd file. Using the *encoding-detection-hook* it will also eventually
implement some autodetection of a file’s encoding from an emacs-style -*- mode: lisp ;
coding: latin1 -*- declaration, or otherwise based on an analysis of octet patterns in
the file. At this point, asdf-encoding only supports the encodings that are supported as
part of your implementation. Since the list varies depending on implementations, we still
recommend you use :utf-8 everywhere, which is the most portable (next to it is :latin1).
Recent versions of Quicklisp include asdf-encodings; if you’re not using it, you may
get this extension using git: git clone https://gitlab.common-lisp.net/asdf/asdf-
encodings.git or git clone git@gitlab.common-lisp.net:asdf/asdf-encodings.git.
You can also browse the repository on https: / / gitlab . common-lisp . net / asdf /
asdf-encodings.
When you use asdf-encodings, any .asd file loaded will use the autodetection algorithm
to determine its encoding. If you depend on this detection happening, you should explicitly
load asdf-encodings early in your build. Note that :defsystem-depends-on cannot be
used here: by the time the :defsystem-depends-on is loaded, the enclosing defsystem
form has already been read.
In practice, this means that the *default-encoding* is usually used for .asd files.
Currently, this defaults to :utf-8, and you should be safe using Unicode characters in those
files. This might matter, for instance, in meta-data about author’s names. Otherwise, the
main data in these files is component (path)names, and we don’t recommend using non-
ASCII characters for these, for the result probably isn’t very portable.
It returns a pathname built from the location of the system’s source directory and
the relative pathname. For example:
> (asdf:system-relative-pathname ’cl-ppcre "regex.data")
#P"/repository/other/cl-ppcre/regex.data"
Note that if the system was already defined or loaded from source code, its build
information will remain active until you call clear-system on it, at which point a
system without build information will be registered in its place.
Unix syntax is used whether or not the underlying system is Unix; on non-Unix
systems it is only usable for relative pathnames. In order to manipulate relative
pathnames portably, it is crucial to possess a portable pathname syntax independent
of the underlying OS. This is what parse-unix-namestring provides, and why we
use it in ASDF.
When given a pathname object, just return it untouched. When given nil, just return
nil. When given a non-null symbol, first downcase its name and treat it as a string.
When given a string, portably decompose it into a pathname as below.
#\/ separates directory components.
The last #\/-separated substring is interpreted as follows: 1- If type is :directory
or ensure-directory is true, the string is made the last directory component, and its
name and type are nil. if the string is empty, it’s the empty pathname with all slots
nil. 2- If type is nil, the substring is a file-namestring, and its name and type are
separated by split-name-type. 3- If type is a string, it is the given type, and the
whole string is the name.
Directory components with an empty name the name . are removed. Any directory
named .. is read as dot-dot, which must be one of :back or :up and defaults to
:back.
host, device and version components are taken from defaults, which itself defaults
to *nil-pathname*. *nil-pathname* is also used if defaults is nil. No host or device
can be specified in the string itself, which makes it unsuitable for absolute pathnames
outside Unix.
For relative pathnames, these components (and hence the defaults) won’t matter if
you use merge-pathnames* but will matter if you use merge-pathnames, which is an
important reason to always use merge-pathnames*.
Arbitrary keys are accepted, and the parse result is passed to ensure-pathname
with those keys, removing type, defaults and dot-dot. When you’re manipulating
pathnames that are supposed to make sense portably even though the OS may not be
Unixish, we recommend you use :want-relative t so that parse-unix-namestring
will throw an error if the pathname is absolute.
merge-pathnames* specified &optional defaults [Function]
This function is a replacement for merge-pathnames that uses the host and device
from the defaults rather than the specified pathname when the latter is a relative
pathname. This allows ASDF and its users to create and use relative pathnames
without having to know beforehand what are the host and device of the absolute
pathnames they are relative to.
subpathname pathname subpath &key type [Function]
This function takes a pathname and a subpath and a type. If subpath is already a
pathname object (not namestring), and is an absolute pathname at that, it is returned
unchanged; otherwise, subpath is turned into a relative pathname with given type as
per parse-unix-namestring with :want-relative t :type type, then it is merged
with the pathname-directory-pathname of pathname, as per merge-pathnames*.
We strongly encourage the use of this function for portably resolving relative path-
names in your code base.
Chapter 11: Miscellaneous additional functionality 67
13 FAQ
ASDF 3.1 refers to releases from 3.1.2 (May 6th 2014) onward. These releases are also
considered part of ASDF 3.
ASDF 2 implements its own portable syntax for strings as pathname specifiers. Naming
files within a system definition becomes easy and portable again. See Chapter 11 [Miscel-
laneous additional functionality], page 61, merge-pathnames*, coerce-pathname.
On the other hand, there are places where systems used to accept namestrings
where you must now use an explicit pathname object: (defsystem ... :pathname
"LOGICAL-HOST:PATH;TO;SYSTEM;" ...) must now be written with the #p syntax:
(defsystem ... :pathname #p"LOGICAL-HOST:PATH;TO;SYSTEM;" ...)
See [Pathname specifiers], page 20.
Windows support is somewhat less tested than Unix support. Please help report and
fix bugs. Update: As of ASDF 2.21, all implementations should now use the same
proper default configuration pathnames and they should actually work, though they
haven’t all been tested.
• The mechanism by which one customizes a system so that Lisp files may use a
different extension from the default .lisp has changed. Previously, the pathname
for a component was lazily computed when operating on a system, and you would
(defmethod source-file-type ((component cl-source-file) (system (eql
(find-system ’foo)))) (declare (ignorable component system)) "lis"). Now,
the pathname for a component is eagerly computed when defining the system,
and instead you will (defclass cl-source-file.lis (cl-source-file) ((type
:initform "lis"))) and use :default-component-class cl-source-file.lis
as argument to defsystem, as detailed in a see Chapter 13 [FAQ], page 70, below.
source-file-type is deprecated. To access a component’s file-type, use file-type,
instead. source-file-type will be removed.
1
Forward incompatibility can be determined using the variable asdf/upgrade::*oldest-forward-
compatible-asdf-version*, which is 2.33 at the time of this writing.
Chapter 13: FAQ 76
• To write a portable build script, you need to rely on a recent version of UIOP, but until
you have ensured a recent ASDF is loaded, you can’t rely on UIOP being present, and
thus must manually avoid all the pathname pitfalls when loading ASDF itself.
• Bugs in CMUCL and XCL prevent upgrade of ASDF from an old forward-incompatible
version. Happily, CMUCL comes with a recent ASDF, and XCL is more of a working
demo than something you’d use seriously anyway.
• For the above reasons, your build and startup scripts should load ASDF 3, configure
it, and upgrade it, among the very first things they do. They should ensure that only
ASDF 3 or later is used indeed, and error out if ASDF 2 or earlier was used.
• Now that (since May 2016) all maintained implementations (i.e. having had at least one
release since 2014, or a commit on their public source code repository) provide ASDF
3.1 or later, the simple solution is just to use code as below in your setup, and when
it fails, upgrade your implementation or replace its ASDF. (see Section 3.4 [Replacing
your implementation’s ASDF], page 4):
(require "asdf")
#-asdf3.1 (error "ASDF 3.1 or bust")
• For scripts that try to use ASDF simply via require at first, and make heroic attempts
to load it the hard way if at first they don’t succeed, see tools/load-asdf.lisp
distributed with the ASDF source repository, or the code of cl-launch (https://
cliki.net/cl-launch).
• Note that in addition to the pitfalls and constraints above, these heroic scripts (should
you wish to write or modify one), must take care to configure ASDF twice. A first
time, right after you load the old ASDF 2 (or 1!) and before you upgrade to the
new ASDF 3, so it may find where you put ASDF 3. A second time, because most
implementations can’t handle a smooth upgrade from ASDF 2 to ASDF 3, so ASDF 3
doesn’t try (anymore) and loses any configuration from ASDF 2.
(ignore-errors (funcall ’require "asdf")) ;; <--- try real hard
;; <--- insert heroics here, if that failed to provide ASDF 2 or 3
;; <--- insert configuration here, if that succeeded
(asdf:load-system "asdf")
;; <--- re-configure here, too, in case at first you got ASDF 2
upgrade ASDF using ASDF itself to some version of their preference that they maintain
independently from your Lisp distribution.
• If you do not have any such magic systems, or have other non-magic systems that
you want to bundle with your implementation, then you may add them to the
wrapping-source-registry, and you are welcome to include asdf.asd amongst
them. Non-magic systems should be at the back of the wrapping-source-registry
while magic systems are at the front. If they are precompiled, they should also be in
the wrapping-output-translations.
• Since ASDF 3, the library UIOP comes transcluded in ASDF. But if you want to be
nice to users who care for UIOP but not for ASDF, you may package UIOP separately,
so that one may (require "uiop") and not load ASDF, or one may (require "asdf")
which would implicitly require and load the former.
• Please send us upstream any patches you make to ASDF itself, so we can merge them
back in for the benefit of your users when they upgrade to the upstream version.
13.4.3 After upgrading ASDF, ASDF (and Quicklisp) can’t find
my systems
When you upgrade the ASDF running in your Lisp image from an ancient ASDF 2 or older
to ASDF 3 or newer, then you may have to re-configure ASDF. If your configuration only
consists in using the source-registry and output-translations (as it should), and if you are
not explicitly calling asdf:initialize-source-registry or asdf:initialize-output-
translations with a non-nil argument, then ASDF will reconfigure itself. Otherwise,
you will have to configure ASDF 2 (or older) to find ASDF 3, then configure ASDF
3. Notably, *central-registry* is not maintained across upgrades from ASDF 2. See
[reinitializeASDFAfterUpgrade], page 76.
Problems like this may be experienced if one loads Quicklisp (which as of this writing
bundles an obsolete ASDF version 2.26), upgrades ASDF, and then tries to load new sys-
tems. The correct solution is to load the most up-to-date ASDF you can, then configure
it, then load Quicklisp and any other extension. Do not try to upgrade from ASDF 2 af-
ter loading Quicklisp, for it will leave both ASDF and Quicklisp badly misconfigured. For
details see the discussion at the above cross-reference.
Also, if you are experiencing such failures due to Quicklisp shipping an ancient ASDF,
please complain to Zach Beane about it.
interpreted either as the name component of a pathname (if the component class specifies
a pathname type), or as a name component plus optional dot-separated type component (if
the component class doesn’t specifies a pathname type).
bundle operations. In addition, the dependency model of ASDF would have to be modified
incompatibly to allow for such a trick.
If you want to use readtable modifications that cannot abide by those restrictions, you
must create a different readtable object and set *readtable* to temporarily bind it to your
new readtable (which will be undone after processing the file).
For that, we recommend you use system named-readtables to define or com-
bine such readtables using named-readtables:defreadtable and use them using
named-readtables:in-readtable. Equivalently, you can use system cl-syntax, that
itself uses named-readtables, but may someday do more with, e.g. *print-pprint-dispatch*.
For even more advanced syntax modification beyond what a readtable can express, you
may consider either:
• a perform method that compiles a constant file that contains a single form
#.*code-read-with-alternate-reader* in an environment where this special
variable was bound to the code read by your alternate reader, or
• using the system reader-interception.
Beware that it is unsafe to use ASDF from the REPL to compile or load systems while the
readtable isn’t the shared readtable previously used to build software. You must manually
undo any binding of *readtable* at the REPL and restore its initial value whenever you
call operate (via e.g. load-system, test-system or require) from a REPL that is using
a different readtable.
Chapter 13: FAQ 83
;; Now, you may experiment with test code from a .script file.
;; See the instructions given at the end of your failing test
;; to identify which form is needed, e.g.
(run-test-script "test-utilities.script")
85
Ongoing Work
For an active list of things to be done, see the TODO file in the source repository.
Also, bugs are currently tracked on launchpad: https://launchpad.net/asdf.
86
Bibliography
• Andrey Mokhov, Neil Mitchell and Simon Peyton Jones: “Build Systems à la Carte”,
2018. https:// www.microsoft. com/en-us/research /uploads/prod /2018/03/
build-systems-final.pdf This article provides axes along which to describe build
systems in general; ASDF, in addition to being in-image (an axis not considered by
these authors), has the following characteristics: ASDF’s persistent build information
is file modification times (the way ASDF is written, it should be easy enough to write
an extension that modifies it to use a “cloud cache” à la Bazel, but that would involve
using some database, network and cryptographic libraries, which cannot reasonably
be included in the base ASDF, that must remain a minimal bootstrappable system
with no external dependencies). The object model of ASDF was initially designed for
“static” dependencies with a “topological” scheduler, but its defsystem-depends-on
mechanism (and more generally, the ability to call ASDF from within an .asd file)
allows for multiple phases of execution resulting in “dynamic” dependencies with a
“suspending” scheduler. The rebuilder essentially uses a “dirty bit”, except that the
in-image model and the multiple phase support mean that’s actually more than a bit:
instead three bits, the timestamp and a phase depth level. The build is guaranteed
“minimal” in number of steps computed. It is local; it assumes but does not enforce
determinism; it does not assume early cutoff of the build when rebuild dependencies
didn’t change.
• Francois-Rene Rideau: “ASDF 3, or Why Lisp is Now an Acceptable Scripting Lan-
guage”, 2014. This article describes the innovations in ASDF 3 and 3.1, as well as
historical information on previous versions. https://github.com/fare/asdf3-2013
• Alastair Bridgewater: “Quick-build” (private communication), 2012. quick-build is a
simple and robust one file, one package build system, similar to faslpath, in 182 lines of
code (117 of which are not blank, not comments, not docstrings). Unhappily, it remains
unpublished and its IP status is unclear as of April 2014. asdf/package-system is
mostly compatible with it, modulo a different setup for toplevel hierarchies.
• Zach Beane: “Quicklisp”, 2011. The Quicklisp blog and Xach’s personal blogs contain
information on Quicklisp. http://blog.quicklisp.org/ http://lispblog.xach.
com/ (new) http://xach.livejournal.com/ (old)
• Francois-Rene Rideau and Robert Goldman: “Evolving ASDF: More Cooperation,
Less Coordination”, 2010. This article describes the main issues solved by ASDF
2, and exposes its design principles. https: / / common-lisp . net / project / asdf /
ilc2010draft.pdf http://rpgoldman.goldman-tribe.org/papers/ilc2010-asdf.
pdf
• Francois-Rene Rideau and Spencer Brody: “XCVB: an eXtensible Component Verifier
and Builder for Common Lisp”, 2009. This article describes XCVB, a proposed com-
petitor for ASDF; many of its ideas have been incorporated into ASDF 2 and 3, though
many other ideas still haven’t. https://common-lisp.net/project/xcvb/
• Peter von Etter: “faslpath”, 2009. faslpath is similar to the latter quick-build and
our yet latter asdf/package-system extension, except that it uses dot . rather than
slash / as a separator. https://code.google.com/p/faslpath/
Bibliography 87
Concept Index
* D
*features* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 default-registry source config directive . . . . . . . . . . 45
DEFSYSTEM grammar . . . . . . . . . . . . . . . . . . . . . . . . 16
directory source config directive . . . . . . . . . . . . . . . . 45
:
:also-exclude source config directive . . . . . . . . . . . . 45
:around-compile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
E
:asdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 exclude source config directive. . . . . . . . . . . . . . . . . . 45
:asdf2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
:asdf3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
:build-operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 I
:compile-check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 ignore-invalid-entries source config directive . . . . 45
:default-registry source config directive . . . . . . . . . 45 immutable systems . . . . . . . . . . . . . . . . . . . . . . . . . 29, 65
:defsystem-depends-on . . . . . . . . . . . . . . . . . . . . . . . . . 19 include source config directive . . . . . . . . . . . . . . . . . . 45
:directory source config directive . . . . . . . . . . . . . . . 45 inherit-configuration source config directive . . . . . 45
:entry-point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
:exclude source config directive . . . . . . . . . . . . . . . . . 45
:feature dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . 22 L
:if-feature component option . . . . . . . . . . . . . . . . . . . 24 launchpad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
:ignore-invalid-entries source config directive . . . . 45 logical pathnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
:include source config directive . . . . . . . . . . . . . . . . . 45
:inherit-configuration source config directive . . . . 45
:require dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . 22 M
:tree source config directive . . . . . . . . . . . . . . . . . . . . 45
:version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14, 21, 37 mailing list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
:weakly-depends-on . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
O
A One package per file systems . . . . . . . . . . . . . . . . . . . 25
operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
also-exclude source config directive . . . . . . . . . . . . . 45
around-compile keyword . . . . . . . . . . . . . . . . . . . . . . . 61
asdf-output-translations . . . . . . . . . . . . . . . . . . . . . . . . 53 P
asdf-user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
ASDF output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Package inferred systems . . . . . . . . . . . . . . . . . . . . . . . 25
ASDF versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Packages, inferring dependencies from . . . . . . . . . . 25
pathname specifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
ASDF-BINARY-LOCATIONS compatibility . . . . 54
Primary system name . . . . . . . . . . . . . . . . . . . . . . . . . . 35
ASDF-related features . . . . . . . . . . . . . . . . . . . . . . . . . . 1
ASDF-USER package . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Q
B Quicklisp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
bug tracker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
build-operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 R
readtables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
C
Capturing ASDF output . . . . . . . . . . . . . . . . . . . . . . . 83 S
compile-check keyword . . . . . . . . . . . . . . . . . . . . . . . . . 61 serial dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
component designator . . . . . . . . . . . . . . . . . . . . . . . . . . 34 system designator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
System names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Concept Index 89
T V
Testing for ASDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 version specifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
tree source config directive . . . . . . . . . . . . . . . . . . . . . 45
90
A M
already-loaded-systems . . . . . . . . . . . . . . . . . . . . . . 10 make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
apply-output-translations . . . . . . . . . . . . . . . . . . . 59 make-operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
asdf-version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 merge-pathnames* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
C O
oos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10, 29
clear-configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 operate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10, 29
clear-output-translations . . . . . . . . . . . . . . . . 8, 58 operation-done-p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
clear-source-registry . . . . . . . . . . . . . . . . . . . . . . . 50 output-files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
clear-system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
coerce-name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34, 37
compile-file* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 P
compile-system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 package-inferred-system . . . . . . . . . . . . . . . . . . . . . 25
component-depends-on . . . . . . . . . . . . . . . . . . . . . . . . 33 parse-unix-namestring . . . . . . . . . . . . . . . . . . . . . . . 65
component-pathname . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 perform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
primary-system-name . . . . . . . . . . . . . . . . . . . . . . 35, 36
D
R
define-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
register-immutable-system . . . . . . . . . . . . . . . 29, 65
defsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13, 14, 16
register-preloaded-system . . . . . . . . . . . . . . . . . . . 64
disable-output-translations . . . . . . . . . . . . . . . . 58
register-system-packages . . . . . . . . . . . . . . . . . . . . 26
require-system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
run-program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
E run-shell-command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
enable-asdf-binary-locations-
compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 S
ensure-output-translations. . . . . . . . . . . . . . . . . . 59
slurp-input-stream . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
ensure-source-registry . . . . . . . . . . . . . . . . . . . . . . 50
source-file-type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
subpathname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
subpathname* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
F system-defsystem-depends-on . . . . . . . . . . . . . . . . 51
file-type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 system-depends-on . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
system-relative-pathname . . . . . . . . . . . . . . . . 63, 83
find-component . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34, 37
system-source-directory . . . . . . . . . . . . . . . . . . . . . 64
find-system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
system-weakly-depends-on . . . . . . . . . . . . . . . . . . . . 51
I T
initialize-output-translations . . . . . . . . . . . . . 58 test-system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
initialize-source-registry. . . . . . . . . . . . . . . . . . 50 traverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
input-files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
U
uiop:define-package. . . . . . . . . . . . . . . . . . . . . . . . . . 26
L
load-asd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
load-system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 V
locate-system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 version-satisfies . . . . . . . . . . . . . . . . . . . . . . . . 37, 42
91
Variable Index
* *oldest-forward-compatible-
*central-registry* . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 asdf-version* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
*compile-file-failure-behaviour* . . . . . . . . . . . 60 *source-registry-parameter* . . . . . . . . . . . . . . . . 51
*compile-file-warnings-behaviour* . . . . . . . . . 60 *standard-output* . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
*default-source-registry-exclusions* . . . . . . 49 *system-definition-search-functions* . . . . . . 34
*features* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
*image-dump-hook* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
*LOAD-PATHNAME* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 A
*LOAD-TRUENAME* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 asdf::*user-cache* . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
*nil-pathname* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 ASDF_OUTPUT_TRANSLATIONS . . . . . . . . . . . . . . . . . . . . 53
92
B M
binary-op (obsolete) . . . . . . . . . . . . . . . . . . . . . . . . . 76 module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
monolithic-binary-op (obsolete) . . . . . . . . . . . . 76
monolithic-compile-bundle-op . . . . . . . . . . . . 31, 76
monolithic-compile-
C concatenated-source-op . . . . . . . . . . . . . . . . . . . . 33
compile-bundle-op . . . . . . . . . . . . . . . . . . . . . . . . 31, 76 monolithic-concatenate-source-op . . . . . . . . . . . 33
compile-concatenated-source-op . . . . . . . . . . . . . 33 monolithic-deliver-asd-op . . . . . . . . . . . . . . . 31, 76
compile-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 monolithic-dll-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 monolithic-fasl-op (obsolete) . . . . . . . . . . . . . . 76
concatenate-source-op . . . . . . . . . . . . . . . . . . . . . . . 33 monolithic-lib-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
monolithic-load-bundle-op . . . . . . . . . . . . . . . 31, 76
monolithic-load-compiled-
concatenated-source-op . . . . . . . . . . . . . . . . . . . . 33
D monolithic-load-concatenated-source-op . . . . 33
deliver-asd-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31, 76 monolithic-load-fasl-op (obsolete) . . . . . . . . . 76
dll-op. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
O
F operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
operation-error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
fasl-op (obsolete) . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
P
I prepare-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
image-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 prepare-source-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
program-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
L S
lib-op. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 source-file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
load-bundle-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31, 76 system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
load-compiled-concatenated-source-op . . . . . . 33 system-definition-error . . . . . . . . . . . . . . . . . . . . . 60
load-concatenated-source-op . . . . . . . . . . . . . . . . 33
load-fasl-op (obsolete) . . . . . . . . . . . . . . . . . . . . . 76
load-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 T
load-source-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 test-op . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30