1 ASDF: Another System Definition Facility
2 ========================================
4 For general information about ASDF, consult the web page:
5 <https://common-lisp.net/project/asdf/>
7 For some reference documentation, read the manual:
8 <https://common-lisp.net/project/asdf/asdf.html>
10 For a guide on how to use it, read our "best practices" document:
11 <https://github.com/fare/asdf/blob/master/doc/best_practices.md>
13 Below is a guide for ASDF developers. It is not meant for ASDF users.
21 First, make sure ASDF is checked out under a path registered to the source-registry,
22 if that isn't the case yet (see the [manual](http://common-lisp.net/project/asdf/asdf.html)).
25 ~/.local/share/common-lisp/source/asdf/
27 or, assuming your implementation provides ASDF 3.1 or later:
32 If you cloned our git repository rather than extracted a tarball,
33 bootstrap a copy of `build/asdf.lisp` with:
38 Building the documentation
39 --------------------------
41 The manual is also in the [doc/](doc/) subdirectory, and can be prepared with:
49 Before you may run tests, you need a few CL libraries.
50 The simplest way to get them is as follows, but read below:
54 _NOTA BENE_: You may also need to run `make ext` again
55 after you `git pull` or switch branch, to update the `ext/` directory.
56 This unhappily is not automatic.
57 If for some reason tests fail, particularly due to an error
58 compiling, loading or running a library, then run `make ext` and try again.
60 The above `make` target uses `git submodule update --init` to download
61 all these libraries using git. If you don't otherwise maintain your
62 own set of carefully controlled CL libraries, that's what you want to use.
63 However, it is only available if you have a git checkout of ASDF;
64 not if you used a tarball.
65 If you use a tarball or otherwise do maintain your own set
66 of carefully controlled CL libraries then you will want to use whichever tools
67 you use (e.g. `quicklisp`, `clbuild`, or your own scripts around `git`)
68 to download these libraries:
69 `alexandria`, `asdf-encodings`, `cl-launch`, `closer-mop`, `cl-ppcre`,
70 `cl-scripting`, `fare-mop`, `fare-quasiquote`, `fare-utils`, `inferior-shell`,
71 `lisp-invocation`, `named-readtables`, `optima`.
73 If you are a CL developer, you may already have them, or may want
74 to use your own tools to download a version of them you control.
75 If you use [Quicklisp](https://www.quicklisp.org/), you may let
76 Quicklisp download those you don't have.
77 In these cases, you may NOT want to use the git submodules from `make ext`;
78 you may undo a `make ext` with `make noext`.
79 Otherwise, if you want to let ASDF download known-working versions
80 of its dependencies, you can do it with `make ext`.
82 Once you have all the required libraries and the asdf-tools script can find
83 a suitable Common Lisp implementation, you may run all the tests
84 on a given Common Lisp implementation `$L`, with your favorite installed system `$S`, using:
88 To run only the regression test scripts, try simply:
90 make l=$L test-scripts
93 Lisp Scripting test system
94 --------------------------
96 ASDF by default uses a shell script in `./test/run-tests.sh` to run the scripts
97 that orchestrate its tests.
99 An alternate build and test system is available
100 that uses Common Lisp as a scripting language.
101 It is disabled by default because
102 the new maintainer is having trouble with it in some of his environments.
103 It worked fine for the previous maintainer in his environments,
104 and may be particularly useful on Windows if and when
105 the shell-based test system fails or is not available.
106 Its source code is in [tools/](tools/) and
107 you can invoke it without going through GNU make,
108 using the script [make-asdf.sh](make-asdf.sh),
109 or, on Windows, [make-asdf.bat](make-asdf.bat).
111 To use this alternate test system, pass to `make` the extra arguments `-f Makefile-lisp-scripting`
114 make -f Makefile-lisp-scripting t l=sbcl
116 Or you can make that your local default (assuming GNU make) using:
118 echo "include Makefile-lisp-scripting" > GNUmakefile
120 These Lisp tools by default use Clozure Common Lisp (CCL) to build and run a binary
121 `build/asdf-tools` that will orchestrate the tests.
122 By defining and exporting the variable `LISP` to be one of `ccl`, `sbcl` or `allegro`, you
123 can have it use an alternate Common Lisp implementation instead.
124 Install CCL (respectively SBCL or Allegro) and make sure an executable called
125 `ccl` (respectively `sbcl` or `alisp`) is in your `PATH`,
126 or that you export a variable `CCL` (respectively `SBCL` or `ALLEGRO`)
127 that points to the executable.
128 To use a further Common Lisp implementation, suitably edit the script
129 [`tools/asdf-tools`](tools/asdf-tools),
130 or, on Windows, the batch file [`tools/asdf-tools.bat`](tools/asdf-tools.bat).
131 (Note that we recommend SBCL 1.3.13 or later when on Windows.)
133 Note that the executable `build/asdf-tools` is built
134 the first time you test ASDF.
135 When you update ASDF, via e.g. `git pull` or a branch switch,
136 you may have to update it, with:
138 make -f Makefile-lisp-scripting build-asdf-tools
140 The reason this is not done automatically every time is because
141 building it depends on a working ASDF;
142 but when you're modifying ASDF and testing it, you cannot rely on a working ASDF:
143 indeed, a developer may not only make mistakes, but may deliberately
144 introduce or re-introduce bugs at some place to test code in another place.
150 To interactively debug ASDF, you may load it in such a way that `M-.` will work,
151 by installing the source code, and running:
153 (map () 'load (asdf:input-files :monolithic-concatenate-source-op "asdf"))
155 To interactively use the `asdf-tools`, you need to either have
156 all its dependencies installed and configured.
157 If you're using them through the `ext/` directory and `make ext`,
158 then you may need to emulate
159 what the script in [tools/asdf-tools](tools/asdf-tools) does
160 with respect to initializing the source-registry.
161 Note that it also declares a system for `cl-launch/dispatch`;
162 you can either do something similar, or expand the source for `cl-launch` with
163 `make -C ext/cl-launch source` so `cl-launch.asd` will be created.
169 If you have to use or extend internal functionality not currently exported by
170 ASDF, please contact us and have us negociate a proper, stable, tested interface
171 that you can actually rely on. Also, please *DO NOT* refer to specific
172 subpackages such as `asdf/find-system` from the outside of ASDF, because
173 functions may occasionally be moved from one internal package to the other,
174 without notification. They have in the past and will in the future.
175 Instead, when refering to symbols in ASDF, we recommend you either have
176 your package `:use` the package `:asdf` or `:import-from` it, or that
177 you shall use `asdf:` or `asdf::` as a prefix to the symbols.
178 And once again, please contact us if you have to use non-exported symbols.
180 Also, the normal way of extending ASDF is to use our class hierarchies for
181 `component` and `operation` and to define methods on `component-depends-on`,
182 `perform`, `input-files`, `output-files`.
183 A common mistake seems to be that some people define methods on `operate`,
184 which usually is not at all what they think it is.
187 How do I navigate this source tree?
188 -----------------------------------
190 * [asdf.asd](asdf.asd)
191 * The system definition for building ASDF with ASDF.
194 * The source code files for `asdf/defsystem`.
195 See [asdf.asd](asdf.asd) for the order in which they are loaded.
196 All exported functions should have docstrings,
197 and all internal functions should have comments.
198 If any definition is insufficiently documented,
199 please tell us: that's a bug.
202 * Utilities of Implementation- and OS- Portability,
203 the portability layer of ASDF. It has its own [README](uiop/README.md),
204 and exported functions should all have docstrings and other ones comment,
205 or once again it's a bug.
207 * [Makefile](Makefile)
208 * The classical `Makefile` used for development purposes.
209 Regular users only need to call `make` with the default target.
210 Developers will typically use the like of
211 `make t l=sbcl` or `make u l=ccl`.
214 * [bump-version](bin/bump-version) --
215 a script to bump the version of ASDF, used by the classic `Makefile`.
216 Use it with e.g. `./bin/bump-version 3.4.5`
217 to test with the next version number before you release.
218 NB: ASDF's version number notably affects the behavior of ASDF
219 with respect to deprecated functions.
222 * `asdf-tools`, a system to build, test and release ASDF. It includes:
223 * [asdf-tools](tools/asdf-tools) --
224 a shell script to run it as a shell command.
225 * [asdf-tools.bat](tools/asdf-tools.bat) --
226 a Windows batch file to run the above.
227 * [asdf-tools.asd](tools/asdf-tools.asd) --
228 system definition for asdf-tools
229 * `*.lisp` -- the source code for the `asdf-tools` system,
230 except for the few files below.
231 Check the `.asd` file for the order in which to read them.
232 * Also a couple scripts to help ASDF users:
233 * [load-asdf.lisp](tools/load-asdf.lisp) --
234 a working example script to load, configure and use ASDF
235 in a self-contained project
236 * [install-asdf.lisp](install-asdf.lisp) --
237 replace and update an implementation's ASDF
238 * [cl-source-registry-cache.lisp](cl-source-registry-cache.lisp) --
239 update a cache for the source-registry as a standalone script.
241 * [Makefile-lisp-scripting](Makefile-lisp-scripting),
242 [make-asdf.sh](make-asdf.sh) and [make-asdf.bat](make-asdf.bat)
243 * Minimal Makefile and scripts to invoke
244 the lisp scripting variants of the build system.
246 * [version.lisp-expr](version.lisp-expr)
247 * The current version. Bumped up every time the code changes, using:
252 * Documentation for ASDF, including:
253 * [index.html](doc/index.html) --
254 the web page for <http://common-lisp.net/project/asdf/>
255 * [asdf.texinfo](doc/asdf.texinfo) -- our manual
256 * [Makefile](doc/Makefile) -- how to build the manual
257 * [cclan.png](doc/cclan.png) [lisp-logo120x80.png](doc/lisp-logo120x80.png)
258 [style.css](doc/style.css) [favicon.ico](doc/favicon.ico)
259 -- auxiliaries of [index.html](doc/index.html)
262 * Regression test scripts (and ancillary files) for developers to check
263 that they don't unintentionally break any of the functionality of ASDF.
264 They are far from covering all of ASDF, but they are a good start.
265 * [script-support.lisp](test/script-support.lisp) --
266 the common test infrastructure used by our tests
267 * [run-tests.sh](test/run-tests.sh) --
268 the shell script used by the classic `Makefile` to run tests.
269 It is not used by the Lisp scripting variant of the `Makefile`.
271 * [contrib/](contrib/)
272 * A few contributed files that show case how to use ASDF
273 or help with debugging it or debugging programs that use it.
276 * Files for packaging on Debian, Ubuntu, etc.
277 (now only present in the debian branch).
280 * Where the `Makefile` and `asdf-tools` store their output files,
282 * `asdf.lisp` -- the current one-file deliverable of ASDF
283 * `asdf-*.lisp` -- for upgrade test purposes, old versions
284 * `asdf-tools` -- the executable for asdf-tools (.exe on Windows)
285 * `results/` -- logs of tests that have been run
286 * `fasls/` -- output files while running tests
289 * External dependencies, that can be populated with `make ext`
290 or equivalently with `git submodule update --init`.
291 Depopulate it with `make noext`
292 or equivalently with: `submodule deinit .`
294 * [README.md](README.md)
298 * Plenty of ideas for how to further improve ASDF.