theclapp

Search theclapp.blog-city.com

 

Stupid ASDF tricks -- recovering from hardlinking instead of symlinking the .asd file

posted Tuesday, 12-Jun-2007
This is a mirror of a post I just made to c.l.lisp, and I thought it'd make a good blog entry, too.

Yesterday I accidentally hardlinked an .asd into my asdf *central-registry*, and then tried to load-op the system, which of course failed.

When I deleted the hardlink and changed it to a symlink, load-op continued to fail.

I believe (and I could be wrong) asdf loaded the .asd file, decided that the source was in the *central-registry* directory, and looked for it there forever after.

How do you get asdf to reprocess the asd file and/or its new location? Load-op doesn't do it.

... Before posting, I did a couple more searches, and found the answer (here), and I suppose it should have occurred to me last night. Oh well. I'll go ahead and post the answer for posterity.

Simply reload the .asd file directly:

The error:

CL-USER 1 > (asdf:operate 'asdf:load-op 'puri)
; loading system definition from /home/lmc/lisp/systems/puri.asd into
; #<The ASDF0 package, 0/16 internal, 0/16 external>
; Loading text file /big2/home/lmc/lisp/systems/puri.asd
; registering #<SYSTEM PURI 218A4A17> as PURI
; registering #<SYSTEM PURI-TESTS 21895317> as PURI-TESTS
;;; Compiling file /big2/home/lmc/lisp/systems/src.lisp ...
[snip various messages]

Error: The file #P"/big2/home/lmc/lisp/systems/src.lisp" does not exist.
1 (continue) Try opening #P"/big2/home/lmc/lisp/systems/src.lisp" again.
2 Try compiling /big2/home/lmc/lisp/systems/src.lisp again.
3 Skip compiling /big2/home/lmc/lisp/systems/src.lisp.
4 Retry performing #<ASDF:COMPILE-OP NIL 200A1DA7> on
#<ASDF:CL-SOURCE-FILE "src" 2189C71F>.
5 Continue, treating #<ASDF:COMPILE-OP NIL 200A1DA7> on
#<ASDF:CL-SOURCE-FILE "src" 2189C71F> as having been successful.
6 (abort) Return to level 0.
7 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed, or :? for
other options

CL-USER 2 : 1 > :top

The fix (run from the registry directory):
% ln -fs ../puri-1.5.1/puri.asd .
The recovery:
CL-USER 3 > (load "lisp/systems/puri.asd")
; Loading text file /big2/home/lmc/lisp/puri-1.5.1/puri.asd
[snip some warnings about methods redefined]
#P"/big2/home/lmc/lisp/puri-1.5.1/puri.asd"

CL-USER 4 > (asdf:operate 'asdf:load-op 'puri)
; Loading fasl file /big2/home/lmc/lisp/puri-1.5.1/src.ufasl
NIL

CL-USER 5 >

It just goes to show, when all else fails, read the directions.

tags:  

links: digg this    del.icio.us    technorati    reddit