Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

ASDF and build directory

閲覧: 78 回
最初の未読メッセージにスキップ

Frederic Brunel

未読、
2004/11/02 17:16:442004/11/02
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

未読、
2004/11/02 17:25:572004/11/02
To:
Frederic Brunel <frederi...@free.fr> writes:

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

Christophe

Björn Lindberg

未読、
2004/11/03 7:37:122004/11/03
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

未読、
2004/11/04 0:56:002004/11/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

未読、
2004/11/05 17:18:082004/11/05
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

未読、
2004/11/05 17:20:202004/11/05
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 件