Next: Configuring where ASDF stores object files, Previous: Configuring ASDF to find your systems, Up: Configuring ASDF [Contents][Index]
The old way to configure ASDF to find your systems is by
push
ing directory pathnames onto the variable
asdf:*central-registry*
.
You must configure this variable between the time you load ASDF and the time you first try to use it. Loading and configuring ASDF presumably happen as part of some initialization script that builds or starts your Common Lisp software system. (For instance, some SBCL users used to put it in their ~/.sbclrc.)
The asdf:*central-registry*
is empty by default in ASDF 2 or ASDF 3,
but is still supported for compatibility with ASDF 1.
When used, it takes precedence over the above source-registry.5
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.6
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.
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.7
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.
It is possible to further customize
the system definition file search.
That’s considered advanced use, and covered later:
search forward for
*system-definition-search-functions*
.
See Defining systems with defsystem.
ASDF will indeed call eval
on each entry.
It will skip entries that evaluate to nil
.
Strings and pathname objects are self-evaluating,
in which case the eval
step does nothing;
but you may push arbitrary s-expressions onto the central registry.
These s-expressions may be evaluated to compute context-dependent
entries, e.g. things that depend
on the value of shell variables or the identity of the user.
The variable asdf:*central-registry*
is thus a list of
“system directory designators”.
A system directory designator is a form
which will be evaluated whenever a system is to be found,
and must evaluate to a directory to look in (or NIL
).
By “directory”, we mean
“designator for a pathname with a non-empty DIRECTORY component”.
On Windows, you can use Windows shortcuts instead of POSIX symlinks. if you try aliases under MacOS, we are curious to hear about your experience.
Next: Configuring where ASDF stores object files, Previous: Configuring ASDF to find your systems, Up: Configuring ASDF [Contents][Index]