1

Currently, I initialize ASDF to a high-level directory:

(asdf:initialize-source-registry
  `(:source-registry
     (:tree "D:\\Users Data\\Dave\\SW Library\\AI\\")
     :inherit-configuration))

Can the recursive search time through subdirectories be reduced by explicitly listing the directories of the projects I'm currently working on? What is the :source-registry format for doing this? (I can't find it in the ASDF Manual. Would prefer not to simply add the directories to asdf:*central-registry* in the old style.)

davypough
  • 1,847
  • 11
  • 21

2 Answers2

2

As regards your specific initial question about 'explicitly listing the directories,' the manual indicates that replacing the :tree keyword with :directory should prevent recursion:

(asdf:initialize-source-registry
  '(:source-registry
     (:directory "D:/this/dir/")
     (:directory "D:/that/dir/")
     :inherit-configuration))

I'm fairly sure you can use forward slashes in pathnames even on Windows.


Edit. Added terminal slashes to the paths.

Dumaiu
  • 138
  • 1
  • 8
0

One way to solve this problem is to let Quicklisp do it for you. If you install your systems under QL's local-projects directory then it will do the search, once, and then cache the results. It is quite smart about this:

This works by keeping a cache of system file pathnames in <quicklisp>/local-projects/system-index.txt. Whenever the timestamp on the local projects directory is newer than the timestamp on the system index file, the entire tree is re-scanned and cached.

(From a comment in local-projects.lisp.)

Even better: if it decides it needs to redo the search it does it when you try to load the first system, not before. So image startup time is unaffected and you pay the cost when you expect to pay it. QL is ... quite well-written.

In practice because I bury my systems fairly deep under the local-projects directory I explicitly touch the directory to force QL to search again.

You can have multiple local projects directories (I have not tested this), and control where they are, by setting ql:*local-projects-directories*.

Using this approach you can, as best I can tell, use either raw ASDF or Quicklisp to build & load systems. I never use raw ASDF, so I can't promise this works.

Of course doing this requires having Quicklisp installed.

  • This might work for me, since I do intermix online & local quicklisp libraries. But don't want to store project files on the same drive as quicklisp & other managers. Will try resetting ql:*local-project-directories* to see if it works. Thanks. – davypough Jan 04 '21 at 21:06
  • This does work with at least some quicklisp and ASDF versions. `(push (pathname "/home/me/common-lisp/") ql:*local-project-directories*)` and then `(ql:register-local-projects)` – dat Dec 06 '22 at 21:38