• Stars
    star
    202
  • Rank 192,743 (Top 4 %)
  • Language
    Common Lisp
  • Created over 11 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Another System Definition Facility, de facto standard build system for CL (mirrored from Common-Lisp.net)

ASDF: Another System Definition Facility

For general information about ASDF, consult the web page: https://common-lisp.net/project/asdf/

For some reference documentation, read the manual: https://common-lisp.net/project/asdf/asdf.html

For a guide on how to use it, read our "best practices" document: https://github.com/fare/asdf/blob/master/doc/best_practices.md

Below is a guide for ASDF developers. It is not meant for ASDF users.

[TOC]

Building ASDF

First, make sure ASDF is checked out under a path registered to 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 rather than extracted a tarball, bootstrap a copy of build/asdf.lisp with:

make

Building the documentation

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

make -C doc

Testing ASDF

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

NOTA BENE: You may also need to run make ext again after you git pull or switch branch, to update the ext/ directory. This unhappily is not automatic. If for some reason tests fail, particularly due to an error compiling, loading or running a library, then run make ext and try again.

The above make target uses git submodule update --init 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, it is only available if you have a git checkout of ASDF; not if you used a tarball. If you use a tarball or otherwise 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, asdf-encodings, cl-launch, closer-mop, cl-ppcre, cl-scripting, 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 may NOT want to use the git submodules from make ext; you may undo a make ext with make noext. Otherwise, if you want to let ASDF download known-working versions of its dependencies, you can do it with make ext.

Once you have all the required libraries and the asdf-tools script can find a suitable Common Lisp implementation, you may run all the tests on a given Common Lisp implementation $L, with your favorite installed system $S, using:

make t u l=$L s=$S

To run only the regression test scripts, try simply:

make l=$L test-scripts

Lisp Scripting test system

ASDF by default uses a shell script in ./test/run-tests.sh to run the scripts that orchestrate its tests.

An alternate build and test system is available that uses Common Lisp as a scripting language. It is disabled by default because the new maintainer is having trouble with it in some of his environments. It worked fine for the previous maintainer in his environments, and may be particularly useful on Windows if and when the shell-based test system fails or is not available. Its source code is in tools/ and you can invoke it without going through GNU make, using the script make-asdf.sh, or, on Windows, make-asdf.bat.

To use this alternate test system, pass to make the extra arguments -f Makefile-lisp-scripting as in for instance:

make -f Makefile-lisp-scripting t l=sbcl

Or you can make that your local default (assuming GNU make) using:

echo "include Makefile-lisp-scripting" > GNUmakefile

These Lisp tools by default use Clozure Common Lisp (CCL) to build and run a binary build/asdf-tools that will orchestrate the tests. By defining and exporting the variable LISP to be one of ccl, sbcl or allegro, you can have it use an alternate Common Lisp implementation instead. Install CCL (respectively SBCL or Allegro) and make sure an executable called ccl (respectively sbcl or alisp) is in your PATH, or that you export a variable CCL (respectively SBCL or ALLEGRO) that points to the executable. To use a further Common Lisp implementation, suitably edit the script tools/asdf-tools, or, on Windows, the batch file tools/asdf-tools.bat. (Note that we recommend SBCL 1.3.13 or later when on Windows.)

Note that the executable build/asdf-tools is built the first time you test ASDF. When you update ASDF, via e.g. git pull or a branch switch, you may have to update it, with:

make -f Makefile-lisp-scripting build-asdf-tools

The reason this is not done automatically every time is because building it depends on a working ASDF; but when you're modifying ASDF and testing it, you cannot rely on a working ASDF: indeed, a developer may not only make mistakes, but may deliberately introduce or re-introduce bugs at some place to test code in another place.

Contributing to ASDF

Bugs can be filled on ASDF by reporting them on the Gitlab issue tracker or sending them to the asdf-devel mailing list.

You can contribute code to ASDF development by forking the repository and sending a merge request or sending a patch to the asdf-devel mailing list.

If you fork the repository on Gitlab, note that Gitlab CI is enabled to help in automated testing. While not exhaustive, this can help make sure you don't inadvertantly break anything with your patch! The tests will be run any time you submit a merge request or manually trigger a run using Gitlab's UI.

If you would like to run ASDF's upgrade tests you need to first ensure your fork contains the tags for every released version of ASDF. If your fork is freshly created, this will happen automatically. However, if there has been a release since you forked, you need to update your tags. Assuming that your fork is the origin remote and upstream is the upstream remote, you can do this by running:

git fetch upstream --tags
git push origin --tags

Then set the varialbe RUN_UPGRADE_TESTS on a pipeline.

If you would like to enable test jobs that use the Lisp scripting test harness, set the variable ENABLE_ASDF_TOOLS on a pipeline.

Debugging ASDF

To interactively debug ASDF, you may load it in such a way that M-. will work, by installing the source code, and running:

(map () 'load (asdf:input-files :monolithic-concatenate-source-op "asdf/defsystem"))

To interactively use the asdf-tools, you need to either have all its dependencies installed and configured. If you're using them through the ext/ directory and make ext, then you may need to emulate what the script in tools/asdf-tools does with respect to initializing the source-registry. Note that it also declares a system for cl-launch/dispatch; you can either do something similar, or expand the source for cl-launch with make -C ext/cl-launch source so cl-launch.asd will be created.

Using ASDF internals

If you have to use or extend internal functionality not currently exported by ASDF, please contact us and have us negotiate a proper, stable, tested interface that you can actually rely on. Also, please DO NOT refer to specific subpackages such as asdf/find-system from the outside of ASDF, because functions may occasionally be moved from one internal package to the other, without notification. They have in the past and will in the future. Instead, when refering to symbols in ASDF, we recommend you either have your package :use the package :asdf or :import-from it, or that you shall use asdf: or asdf:: as a prefix to the symbols. And once again, please contact us if you have to use non-exported symbols.

Also, the normal way of extending ASDF is to use our class hierarchies for component and operation and to define methods on component-depends-on, perform, input-files, output-files. A common mistake seems to be that some people define methods on operate, which usually is not at all what they think it is.

How do I navigate this source tree?

  • 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. All exported functions should have docstrings, and all internal functions should have comments. If any definition is insufficiently documented, please tell us: that's a bug.
  • uiop/

    • Utilities of Implementation- and OS- Portability, the portability layer of ASDF. It has its own README, and exported functions should all have docstrings and other ones comment, or once again it's a bug.
  • Makefile

    • The classical Makefile used for development purposes. Regular users only need to call make with the default target. Developers will typically use the like of make t l=sbcl or make u l=ccl.
  • bin/

    • bump-version -- a script to bump the version of ASDF, used by the classic Makefile. Use it with e.g. ./bin/bump-version 3.4.5 to test with the next version number before you release. NB: ASDF's version number notably affects the behavior of ASDF with respect to deprecated functions.
  • tools/

    • asdf-tools, a system to build, test and release ASDF. It includes:
      • asdf-tools -- a shell script to run it as a shell command.
      • asdf-tools.bat -- a Windows batch file to run the above.
      • asdf-tools.asd -- system definition for asdf-tools
      • *.lisp -- the source code for the asdf-tools system, except for the few files below. Check the .asd file for the order in which to read them.
    • Also a couple scripts to help ASDF users:
  • Makefile-lisp-scripting, make-asdf.sh and make-asdf.bat

    • Minimal Makefile and scripts to invoke the lisp scripting variants of the build system.
  • version.lisp-expr

    • The current version. Bumped up every time the code changes, using:

      make bump
      
  • doc/

  • test/

    • Regression test scripts (and ancillary files) for developers to check that they don't unintentionally break any of the functionality of ASDF. They are far from covering all of ASDF, but they are a good start.
      • script-support.lisp -- the common test infrastructure used by our tests
      • run-tests.sh -- the shell script used by the classic Makefile to run tests. It is not used by the Lisp scripting variant of the Makefile.
  • contrib/

    • A few contributed files that show case how to use ASDF or help with debugging it or debugging programs that use it.
  • debian/

    • Files for packaging on Debian, Ubuntu, etc. (now only present in the debian branch).
  • build/

    • Where the Makefile and asdf-tools store their output files, including:
      • asdf.lisp -- the current one-file deliverable of ASDF
      • asdf-*.lisp -- for upgrade test purposes, old versions
      • asdf-tools -- the executable for asdf-tools (.exe on Windows)
      • 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 --init. Depopulate it with make noext or equivalently with: submodule deinit .
  • README.md

    • This file.
  • TODO

    • Plenty of ideas for how to further improve ASDF (not all of them guaranteed good ideas.)
  • gitlab-ci.yml

    • A YAML file describing jobs for Gitlab CI to run.

More Repositories

1

lisp-interface-library

LIL: abstract interfaces and supporting concrete data-structures in Common Lisp
Common Lisp
145
star
2

gerbil-utils

Collection of Utilities for Gerbil Scheme
Scheme
41
star
3

cl-scripting

cl-scripting, utilities for scripting in Common Lisp
Common Lisp
39
star
4

xcvb

eXtensible Component Verifier and Builder for Common-Lisp (mirrored from Common-Lisp.net) https://gitlab.common-lisp.net/xcvb/xcvb
Common Lisp
37
star
5

asdf3-2013

Material about ASDF3, its history and lessons, and how to use it.
Scheme
37
star
6

moll

My Own Linear Lisp
C
36
star
7

fare-scripts

Scripts written Common Lisp
Common Lisp
35
star
8

fare-quasiquote

Portable implementation of quasiquote for Common Lisp
Common Lisp
27
star
9

inferior-shell

Portably run subprocesses in Common Lisp, with redirection, pipes, string interpolation
Common Lisp
24
star
10

cl-launch

Launch Common Lisp applications as Unix commands
Common Lisp
23
star
11

lil-ilc2012

LIL: higher-order datastructures meet CLOS -- Paper published at ILC'2012
Racket
21
star
12

gerbil-poo

Prototype Object Orientation for Gerbil Scheme
Scheme
18
star
13

gerbil-ethereum

Ethereum support for Gerbil Scheme
Scheme
17
star
14

command-line-arguments

Trivial command-line argument parsing library for Common Lisp
Common Lisp
15
star
15

fare-memoization

Common Lisp
14
star
16

climbing

Climbing Up the Semantic Tower โ€” at Runtime
Scheme
13
star
17

asdf2017

ELS 2017 demonstration: Delivering Common Lisp Applications with ASDF 3.3
Scheme
13
star
18

fare-csv

Mirror of https://gitlab.common-lisp.net/frideau/fare-csv
Common Lisp
9
star
19

fare-stumpwm

Personal configuration for stumpwm
Common Lisp
9
star
20

poiu

Parallel Operator on Independent Units, a parallelizing backend for ASDF โ€” mirror of https://gitlab.common-lisp.net/qitab/poiu
Common Lisp
8
star
21

evo2017

From Software Creationism to Software Evolutionism
CSS
8
star
22

scribble

Scribble document syntax in Common Lisp โ€” mirror from https://gitlab.common-lisp.net/frideau/scribble
Common Lisp
7
star
23

fare-puzzles

Solutions to various puzzles
Common Lisp
6
star
24

tunes

6
star
25

gerbil-persist

Persistence of concurrent activities for Gerbil Scheme
Scheme
6
star
26

better-stories

Better Stories, Better Languages
CSS
5
star
27

reader-interception

Portably intercept the Common Lisp reader so you may compile code with arbitrary syntax and semantics
Common Lisp
5
star
28

acmart

Racket Scribble package for the 2017 ACM Master Article Template
Racket
5
star
29

projects

Various projects you might work on
5
star
30

gerbil-crypto

Extra cryptographic functions for Gerbil
Scheme
4
star
31

lisp-invocation

Invoke a Common Lisp implementation in a subprocess
Common Lisp
3
star
32

fare-utils

General purposes utilities for Common Lisp
Common Lisp
3
star
33

lambda-reader

Use a unicode ฮป as syntax for LAMBDA in Common Lisp
Common Lisp
3
star
34

eocex

Exercises based on Siek's Essentials of Compilation, in Gerbil Scheme
Scheme
3
star
35

lisp-stripper

Strip a common-lisp file from comments, empty lines, doc strings and overlong strings to count "useful lines of code".
Common Lisp
3
star
36

workout-timer

Trivial workout timer in Common Lisp
Common Lisp
2
star
37

package-renaming

Locally rename packages in portable Common Lisp
Common Lisp
2
star
38

exscribe

Exscribe document system in Common Lisp, with HTML and PDF backends
Common Lisp
2
star
39

fci2017

Reflection with First-Class Implementations โ€” a presentation
Scheme
2
star
40

single-threaded-ccl

Starting CCL in single-threaded mode so it can be forked
Common Lisp
2
star
41

fare-mop

General purpose Common Lisp utilities using the Meta-Object Project
Common Lisp
1
star
42

slave-repl

Trivial slave REPL onto another Common Lisp process
Common Lisp
1
star
43

rpm

Trivial interface to the RedHat Package Management system in Common Lisp
Common Lisp
1
star
44

bastiat.org

Source code for the website bastiat.org
Scheme
1
star
45

guixcfg

Guix configuration
Scheme
1
star
46

fare.github.io

My web site
1
star
47

pyjure

A pure Python dialect implemented in Clojure
Clojure
1
star
48

asdf-dependency-grovel

Discover fine-grained dependencies between Common Lisp files using ASDF
Common Lisp
1
star