[asdf-devel] How to specify to ASDF to load system from current directory?

Mirko Vukovic mirko.vukovic at gmail.com
Wed Nov 6 19:51:20 UTC 2013


On Wed, Nov 6, 2013 at 11:01 AM, Faré <fahree at gmail.com> wrote:

> On Wed, Nov 6, 2013 at 10:51 AM, Zach Beane <xach at xach.com> wrote:
> > Mirko Vukovic <mirko.vukovic at gmail.com> writes:
> >
> >> I have a system sitting in ~/quicklisp/local-dists and a development
> >> version sitting in ~/.../lisp-development/
> >>
> >> I would like ASDF to open the latter one.  I use asdf:load-system.
> >>
> >> I cd to the development directory and start slime there.
>  (asdf:load-system
> >> ...) still tries to fetch the version in the
> >> quicklisp directory.
> >
> > One easy way:
> >
> >   (push '*default-pathname-defaults* asdf:*central-registry*)
> >
> I disrecommend pushing '*default-pathname-defaults* into the
> *central-registry* — that makes system loading less predictable,
> depending on the binding of this variable.
>
> Instead, I recommend pushing an actual pathname object (that may
> happen to be the current value of *d-p-d* or of (uiop:getcwd), if you
> insist), so that the value remains well-defined in the face of
> rebinding of the variable.
>
> Or better, edit your ~/.config/common-lisp/source-registry.conf and
> register your software there. Or for temporary stuff, export a
> CL_SOURCE_REGISTRY, or call asdf:initialize-source-registry with a
> parameter.
>
> —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics•
> http://fare.tunes.org
> Fraud is the homage that force pays to reason.  — Charles Curtis
>

This works for me now (lightly tested):

(defun asdf::load-local-system (system &rest keys
                &key
                  (directory *default-pathname-defaults*)
                &allow-other-keys)
  (let ((asdf:*central-registry*
     (push directory asdf:*central-registry*)))
    (apply #'asdf:load-system system keys)))

(export '(asdf::load-local-system) :asdf)

There may be a better name for this function instead of `local'.

Thanks to all that replied,

Mirko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20131106/cc8d4e7b/attachment.html>


More information about the asdf-devel mailing list