Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ASDF and build directory

79 views
Skip to first unread message

Frederic Brunel

unread,
Nov 2, 2004, 5:16:44 PM11/2/04
to

Hi,

I'd like to know how ASDF can be extended to support a "build
directory" feature, that is, the ability to produce fasl files into a
specific directory (and not the root) and to load up the system
from it. It's kind of annoying to have fasl polluting your project
directory (especially when they conflicts between CL implementations).

Actually, I saw a lot of projects doing that kind of stuff manually
(like SLIME) and I wonder why ASDF is not handling that. Franz shows
an exemple of such extension using their own defsystem utility. Maybe
there is a simple way to do it in ASDF but I didn't find it reading
the documentation.

--
Frederic Brunel

Christophe Rhodes

unread,
Nov 2, 2004, 5:25:57 PM11/2/04
to
Frederic Brunel <frederi...@free.fr> writes:

Specialize the ASDF:OUTPUT-FILES method on ASDF:COMPILE-OP.

Christophe

Björn Lindberg

unread,
Nov 3, 2004, 7:37:12 AM11/3/04
to
Frederic Brunel <frederi...@free.fr> writes:

Here is what I have in my ~/.cmucl-init.lisp:

(in-package :asdf)

(pushnew "/home/compbio/d95-bli/share/common-lisp/system/" *central-registry*)

(defvar *system-configuration-paths*
'(("/nfs/home/compbio/d95-bli/share/common-lisp/src/"
"/nfs/home/compbio/d95-bli/lib/common-lisp/cmucl/")))

(defun pathname-prefix-p (prefix pathname)
(not (equal (enough-namestring pathname prefix) (namestring pathname))))

(defmethod output-files :around ((operation compile-op) (c source-file))
(let ((source (component-pathname c))
(paths (call-next-method)))
(mapcar #'(lambda (path)
(loop for (from to) in *system-configuration-paths*
when (pathname-prefix-p from source)
do (return
(merge-pathnames
(make-pathname :type (pathname-type path))
(merge-pathnames (enough-namestring source from)
to)))
;; Kommer bara hit om ingen sökväg matchade
finally (return path)))
paths)))

It works well, and it is extensible so that you can add other
source-fasl locations to the global variable. My clisp and sbcl init
files contain the same thing but with different fasl directories.

The only thing regarding this method that is sometimes problematic is
for packages which come with data files. The way ASDF works, it will
look for those data files in the fasl directory instead of the source
directory, and you will get a sometimes cryptic compilation error. The
way I solve this in the few cases where it happens is by manually
copying the files to the fasl directory.


Björn

Rahul Jain

unread,
Nov 4, 2004, 12:56:00 AM11/4/04
to
Frederic Brunel <frederi...@free.fr> writes:

Actually, debian does exactly this, checking to see if the asd file is
from the systemwide repository in asdf:output-files :around...

--
Rahul Jain
rj...@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist

Frederic Brunel

unread,
Nov 5, 2004, 5:18:08 PM11/5/04
to
>>I'd like to know how ASDF can be extended to support a "build
>>directory" feature, that is, the ability to produce fasl files into a
>>specific directory (and not the root) and to load up the system
>>from it. It's kind of annoying to have fasl polluting your project
>>directory (especially when they conflicts between CL implementations).
>>
>>Actually, I saw a lot of projects doing that kind of stuff manually
>>(like SLIME) and I wonder why ASDF is not handling that. Franz shows
>>an exemple of such extension using their own defsystem utility. Maybe
>>there is a simple way to do it in ASDF but I didn't find it reading
>>the documentation.
>
> Actually, debian does exactly this, checking to see if the asd file is
> from the systemwide repository in asdf:output-files :around...

Debian? You're talking about the Common Lisp Controller?

--
Frederic Brunel

Frederic Brunel

unread,
Nov 5, 2004, 5:20:20 PM11/5/04
to

That's very interesting, thanx for your reply. I guess this kind of
features could be available within ASDF. I think of extensions to be
pretty much like ANT, the Java build tool.

--
Frederic Brunel

0 new messages