Managing CL Libraries - Part 2
Sunday, January 8, 2006
Most people use ASDF to load libraries that they get from other people and to create system definitions for their own libraries. Daniel Barlow originally developed ASDF and you used to have to download it from his site; however, most of the popular CL implementations now bundle it as part of their distribution so it has become pretty much ubiquitous. However, even though ASDF is good at what it does, there are a number of common things that people need to do that are "ASDF-ish" and which aren't catered for by ASDF itself. Therefore, some ASDF extensions have been developed that fill gaps in what ASDF is able to do. The ones that I personally use the most are asdf-install (initially developed by Daniel Barlow and made portable across multiple installations by Edi Weitz) and asdf-upgrade (a new addition developed by James Bielman). I've already posted previously about asdf-install and how I use it. It's a wonderful tool for automatically installing all the dependent libraries that one needs in order to use a particular library. However, you used to have to manually check whether any of the libraries that you had asdf-install'ed had been updated and re-install them if they had. Now, however, asdf-upgrade can be used to automate this. When you run it, you can ask for a report on all the libraries that you have asdf-install'ed and it will tell you if there is a newer version available. Then, you can choose to upgrade to the latest libraries if you want. Pretty nifty! Here's a sample REPL session to give you an idea of what it does:
CL-USER> (asdf-upgrade:REPORT) Name Version Upgrade Status ------------------------------------------------------------------------ cl-base64 3.3.1 Up to date cl-fad 0.4.0 Upgrade available cl-html-parse unknown Upgrade available cl-ppcre 1.2.13 Up to date cl-who 0.6.0 Up to date kmrcl 1.84 Up to date md5 1.8.5 Up to date net-telent-date 0.41 Up to date puri 1.3.1.3 Up to date rfc2388 unknown Up to date rt 20040621 Up to date split-sequence unknown Up to date tbnl 0.9.3 Upgrade available url-rewrite unknown Up to date NIL CL-USER> (asdf-upgrade:upgrade) ;; Checking available packages..............done ;; The following packages will be upgraded: ;; tbnl cl-fad cl-html-parse [snipped installation output] NIL CL-USER> (asdf-upgrade:REPORT) Name Version Upgrade Status ------------------------------------------------------------------------ cl-base64 3.3.1 Up to date cl-fad 0.4.2 Up to date cl-html-parse unknown Up to date cl-ppcre 1.2.13 Up to date cl-who 0.6.0 Up to date kmrcl 1.84 Up to date md5 1.8.5 Up to date net-telent-date 0.41 Up to date puri 1.3.1.3 Up to date rfc2388 unknown Up to date rt 20040621 Up to date split-sequence unknown Up to date tbnl 0.9.4 Up to date url-rewrite unknown Up to date NIL CL-USER>Another useful addition is a set of utilities that were developed by Gary King (of UnClog fame). Probably the lasting effect of the switch of Reddit from Lisp to Python was a realization that Lisp libraries are harder to use than they need to be. John Wiseman highlighted the issue when he posted a weblog entry showing how few libraries could actually be successfully installed using asdf-install. As a result, Gary King developed a couple of utilities (called asdf-install-tester (or AIT) and asdf-status) that can be used to test whether asdf-install-able libraries are actually installable. In addition, he has indicated that he will be running the utility on a monthly basis (and providing the results at the links listed below) in order to provide an ongoing "sanity check" of which libraries are installable. This is useful to both library authors and users. The output that he currently provides is:
- System summary by library: This shows graphically which libraries are currently asdf-install-able and which ones are failing to load. It also indicates whether the library is installable by different popular CL implementations.
- System summary by author: Sometimes, all libraries that a particular author has written are not asdf-install-able due to system problems. By providing a report by author, these types of problems are highlighted. This is useful information for both the potential user of the library as well as the author.
- Library dependency graph: This is a really neat graphical (using Graphviz) depiction of the inter-relationships between all of the asdf-install-able libraries (described in this post of UnClog). In a previous blog entry, I said that it would be nice to have such a graphical depiction of the library prerequisites and dependencies and Gary has implemented exactly that! So, for example, if you are planning to install the TBNL library developed by Edi Weitz, it will show you that TBNL is dependent on the MD5, KMRCL, CL-BASE64, RPC2388, CL-PPCRE, and URL-REWRITE libraries (which asdf-install will automatically install for you if they aren't on your machine when you install TBNL). In addition, it will tell you that TBNL is a prerequisite of CL-WIKI. The diagram is also "click-able", so you can drill down to any library by clicking on it in the diagram. Quite an addictive diagram!

So, although Gary's utilities are unlikely to be actually "used" by many people, the output from his utilities will be extremely valuable in improving the quality of CL libraries. Gary is to be commended for his work on these utilities and for the service that he is providing to the Lisp community!
In addition to these utilities, there are a number of other utilities that are listed on the asdf-extension CLiki page. I haven't personally used the other utilities; however, they scratch certain itches and are worth checking out. All-in-all, the combination of these utilities is helping to make CL library installation easier, more robust, and more consistent. This is all good stuff!

