-->

Updating to ASDF 3.x in CLISP

2020-07-14 09:27发布

问题:

I am trying to update ASDF in CLISP 2.49 (on Mac OS Sierra) to version 3.x. I have now version 2.26 of ASDF. I have tried everything I found online: I downloaded the latest version of ASDF as indicated in https://common-lisp.net/project/asdf/ but then when I eval (require "asdf"), as indicated in the manual (https://common-lisp.net/project/asdf/asdf.html#Upgrading-ASDF) nothing happens, I still have version 2.26. The manual also tells to load the file asdf.lisp, but the file is missing from the new version folder. I discovered that quicklisp had its own version of asdf.lisp and asdf.fas, which seem to be the ones being loaded, but I don't see how to replace them with any new version. I have tried so many things now that I'm afraid I'm screwing the system up.

Does anyone know how to upgrade ASDF to a version >= 3.0 reliably and step by step? Thanks a lot.

回答1:

1- To generate asdf.lisp from source, type make in the asdf git checkout.

2- (load (compile-file ...)) will recompile it every time. You probably want to only compile it once, then overwrite whichever fasl is usually used with it.

3- If you get asdf from quicklisp, as I suppose you do, just replace its obsolete ~/quicklisp/asdf.lisp 2.26 by your asdf.lisp 3.2.1, then blow away the cache in ~/quicklisp/cache/

4- Please complain to Xach about upgrading its asdf to 3.1.7 or 3.2.1. Quicklisp is doing lispers a disservice by distributing 2.26.



回答2:

Basically, all you need to do is replace 2.6 with 3.2.

Find out where asdf.lisp 2.6 resides.

You can do (load "asdf") or (require "asdf") and see where it is being loaded from. Let the path be my/asdf/directory/asdf.lisp.

Replace the file.

wget https://common-lisp.net/project/asdf/archives/asdf.lisp -O my/asdf/directory/asdf.lisp

Compile the new asdf

clisp -norc -c my/asdf/directory/asdf.lisp


回答3:

asdf itself is self-updatable. You only have to load the latest version.

http://paste.lisp.org/display/350703

So basically, you download an asdf 3 somewhere, say ~/rc/asdf.lisp and in your ~/.clisprc.lisp you put:

(load #P"~/quicklisp/setup.lisp")        ; will load asdf 2.26
(load (compile-file #P"~/rc/asdf.lisp")) ; will load asdf 3 over asdf 2.26.


回答4:

OK, I finally got it, it was a combination of the two answers above. First, I don't have wget in my system, but I downloaded the file https://common-lisp.net/project/asdf/archives/asdf.lisp manually and saved it in the right path. Then added the two lines

(load #P"~/quicklisp/setup.lisp")        ; will load asdf 2.26
(load (compile-file #P"~/rc/asdf.lisp")) ; will load asdf 3 over asdf 2.26.

to the file ~/.clisprc.lisp Now, after restarting CLISP I finally get:

(asdf:asdf-version)
"3.2.1"

Thanks a lot Sam and Pascal for your help!