How to arrange for Quicklisp to load the local version of a given library
Asked Answered
M

1

5

I am using Quicklisp to load libraries in my Common Lisp project and I need to load a customised version of some library instead of the version provided by Quicklisp.

The customised version of the library is stored in the local projects directory from Quicklisp and local projects have been registered. However Quicklisp still tries to load its own version of the library.

How can arrange for Quicklisp to prefer the customised of the library? (Side question: how can I ask Quicklisp which location it will use to load a library?)

Many answered 24/6, 2018 at 10:3 Comment(0)
R
8

If the project's system file is loadable with ASDF, it is loaded in preference to the Quicklisp-provided version. The easiest way to do that is to put the project's sources into ~/quicklisp/local-projects/ (or wherever your quicklisp is installed rather than ~/quicklisp/) and run (ql:register-local-projects). But other methods, like updating the ASDF registry configuration and putting the project somewhere known to ASDF via the registry, also work.

To find out where Quicklisp is loading your project, you can use (ql:where-is-system "system-name").

Remember that

The local-projects mechanism is configured through a special variable ql:*local-project-directories*. By default, it includes only the local-projects subdirectory in the Quicklisp install directory, but you can add or remove directories at any time to have more places scanned for systems. To disable the local-projects mechanism entirely, set ql:*local-project-directories* to NIL.

(Quicklisp News Blog)

Ranice answered 24/6, 2018 at 12:1 Comment(3)
Thank you very much for your useful and accurate answer. For the sake of completeness I added a not about the configuration of quicklisp local projects feature. Maybe you have a useful reference to add for the corresponding configuration of ASDF itself?Antepast
I don't. I find ASDF configuration very difficult and not clarified by its documentation. That's why I made the local-projects mechanism.Ranice
@MichaelLeBarbierGrünewald See common-lisp.net/project/asdf/asdf.html#Configuring-ASDFGirondist

© 2022 - 2024 — McMap. All rights reserved.