README.md 6.24 KB
Newer Older
1
2
3
4
5
6
ASDF: Another System Definition Facility
========================================

What is ASDF?
-------------

7
8
9
ASDF is the de facto standard build facility for Common Lisp.
Your Lisp implementation probably contains a copy of ASDF,
which you can load using `(require "asdf")`.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

If you come from the C/C++ world, the function ASDF covers a bit of what
each of make, autoconf, dlopen and libc do for C programs:
it orchestrates the compilation and dependency management,
handles some of the portability issues, dynamically finds and loads code,
and offers some portable system access.
Except everything is different in Common Lisp, and ultimately much simpler,
though it requires acquiring some basic concepts.
Importantly, ASDF builds all software in the current Lisp image.

To use ASDF, read our manual:

    http://common-lisp.net/project/asdf/asdf.html

The first few sections, Loading ASDF, Configuring ASDF and Using ASDF,
will get you started as a simple user.
If you want to define your own systems, further read the section
Defining systems with defsystem.

The manual is also in the doc/ subdirectory, and can be prepared with:

    make doc


ASDF 3 now includes an extensive runtime support library:
UIOP, the Utilities for Implementation- and OS- Portability.
Its documentation unhappily lies mainly in the source code and docstrings.
37
See [`uiop/README.md`](uiop/README.md) for an introduction.
38
39
40
41
42
43

More information and additional links can be found on ASDF's home page at:

    http://common-lisp.net/project/asdf/


44
Quick Start
45
-----------
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

Just use `(require "asdf")` to load your implementation-provided ASDF.

If it is recent enough (3.0 or later, check its `(asdf:asdf-version)`),
then it will automatically upgrade to the ASDF provided as source code,
assuming the source code in under a path registered by the source-registry.


Building and testing it
-----------------------

First, make sure ASDF is checked out under a path registered by the source-registry,
if that isn't the case yet (see the manual). One place would be:

    ~/.local/share/common-lisp/source/asdf/

or, assuming your implementation provides ASDF 3.1 or later:

    ~/common-lisp/asdf/


If you cloned our git repository, bootstrap a copy of build/asdf.lisp with:

    make

Before you may run tests, you need a few CL libraries.
The simplest way to get them is as follows, but read below:

    make ext

The above make target uses `git submodule update` to download
all these libraries using git. If you don't otherwise maintain your
own set of carefully controlled CL libraries, that's what you want to use.
However, if you do maintain your own set of carefully controlled CL libraries
then you will want to use whichever tools you use (e.g. quicklisp, clbuild,
or your own scripts around git) to download these libraries:
alexandria, closer-mop, cl-ppcre, fare-mop, fare-quasiquote, fare-utils,
inferior-shell, lisp-invocation, named-readtables, optima.

If you are a CL developer, you may already have them, or may want
to use your own tools to download a version of them you control.
If you use Quicklisp, you may let Quicklisp download those you don't have.
In these cases, you do NOT want to use
However, if you want to let ASDF download known-working versions
of its dependencies, you can do it with:

    make ext

To run all the tests on your favorite Lisp implementation $L,
choose your most elaborate installed system $S, and try:

    make t u l=$L s=$S


Debugging tip
-------------

To load ASDF in such a way that M-. will work, install the source code, and run:

    (asdf:load-system :uiop) ;; loading uiop is simple
    (map () 'load ;; loading asdf/defsystem is tricky
     (mapcar 'asdf:component-pathname
      (asdf::required-components :asdf/defsystem :keep-component 'asdf:cl-source-file)))


What has changed?
-----------------

You can consult the `debian/changelog` for an overview of the
significant changes in each release, and
the `git log` for a detailed description of each commit.


How do I navigate this source directory?
----------------------------------------

* `asdf.asd`
    * The system definition for building ASDF with ASDF.

* `*.lisp`
    * The source code files for asdf/defsystem.
      See asdf.asd for the order in which they are loaded.

* `uiop/`
    * Utilities of Implementation- and OS- Portability,
      the portability layer of ASDF. It has its own `README`,
      and functions all have docstrings.

* `Makefile`
    * a minimal Makefile for bootstrapping purposes.
      Most of the logic is in the asdf-tools system

* `tools/`
    * Some scripts to help ASDF users
140
        * `load-asdf.lisp` -- a build script to load, configure and use ASDF
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
        * `install-asdf.lisp` -- replace and update an implementation's ASDF
        * `cl-source-registry-cache.lisp` -- update a cache for the source-registry

* `build.xcvb`
    * The system definition for building ASDF with XCVB.
      It hasn't been tested or maintained for years and has bitrotten.

* `version.lisp-expr`
    * The current version. Bumped up every time the code changes, using:

        ./tools/asdf-builder bump

* `doc/`
    * documentation for ASDF, including:
        * `index.html` -- the web page for http://common-lisp.net/project/asdf/
        * `asdf.texinfo` -- our manual
        * `Makefile` -- how to build the manual
        * `cclan.png` `lisp-logo120x80.png` `style.css` `favicon.ico`
		-- auxiliaries of `index.html`

* `test/`
    * regression test scripts (and ancillary files) for developers to check
      that they don't unintentionally break any of the functionality of ASDF.
      Far from covering all of ASDF.

* `contrib/`
    * a few contributed files that show case how to use ASDF.

* `debian/`
	files for packaging on debian, ubuntu, etc.

* `build/`
    * where the Makefile and asdf-tools store their output files, including
        * `asdf.lisp` -- the current one-file deliverable of ASDF
        * `asdf-XXX.lisp` -- for upgrade test purposes, old versions
        * `results/` -- logs of tests that have been run
        * `fasls/` -- output files while running tests.

* `ext/`
    * external dependencies, that can be populated with `make ext`
      or equivalently with `git submodule update`.

* `README`
    * this file

* `TODO`
    * plenty of ideas for how to further improve ASDF.


Last updated Thursday, September 11th, 2014.