How to properly use cxml/klacks library with quicklisp (and sbcl)?

Overview I’m trying to run a simplified version of this code, that needs the cxml and klacks library for XML parsing. (The concrete code is Chapter 47 of the book "The Art of Postgresql".) Since I know very little about (Common) Lisp/ASDF/Quicklisp, I don’t know how to properly install the required cxml/klacks library.

System In case that matters, I’m using SBCL 1.5.5.debian under Ubuntu (For the records, I had tried clisp previously, but I found that it comes with a very outdated version of ASDF.)

Steps I did so far

In bash:

sudo apt-get install cl-cxml

(Indeed /usr/share/common-lisp/source/cxml/ and /usr/share/common-lisp/source/cxml/klacks/ are now present on my system.)

In sbcl REPL:

(ql:quickload :cxml)

Result: a long error message, whose gist seems to be Component "cxml/dom" not found. (Even though /usr/share/common-lisp/source/cxml/dom does exist, but I’m not sure it matters.) See complete error message at the end.

(ql:quickload :klacks)

Result: another long error, whose gist is System "klacks" not found (even though, again, the directory is present on the system).

Remark

Using qucikload for other libraries works, e.g.:

(ql:quickload :postmodern) (ql:quickload :zip) (ql:quickload :yason) 

Questions

In short: what is the proper way of getting cxml and klacks installed on the above system?

Besides the solution to this concrete issue, I’d like to understand a bit better what is going on, in particular:

  • Can all dependencies be installed with quicklisp, or are there some that support it and some that don’t? (And in this case, is cxml a dependency that does not support quicklisp? How can I know which packages do support it?)

  • Does quciklisp look at the local installation (i.e. /usr/share/common-lisp/source/cxml/) at all, or does it work only from an online repository? (In other words: does it matter that I installed cl-xml via apt-get?)

  • If it takes the local path into account, then why doesn’t it find cxml/dom and cxml/klacks?

  • Since klacks is a subpackage of cxml, do I need to import it separately or not? By browsing the mentioned source code, especially package.lisp and pubnames.asd, I don’t see it explicitly imported. Still it is used in the code, e.g. here. So I guess what is needed is to import cxml explicitly, and then all subpackages (including klacks) get also imported, automatically prefixed with the proper namespace?

Detailed error messages

* (ql:quickload :cxml) ;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.  yes, using code points. To load "cxml":   Load 1 ASDF system:     cxml ; Loading "cxml" ;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.  yes, using code points. . ;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.  yes, using code points. ;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.  yes, using code points. ;;; Building Closure with CHARACTER RUNES To load "cxml/dom":   Load 3 ASDF systems:     closure-common puri trivial-gray-streams   Install 1 Quicklisp release:     cxml ; Loading "cxml/dom" ;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.  yes, using code points. . debugger invoked on a ASDF/FIND-COMPONENT:MISSING-COMPONENT in thread #<THREAD "main thread" RUNNING {10005504C3}>:   Component "cxml/dom" not found  Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.  restarts (invokable by number or by possibly-abbreviated name):   0: [RETRY                        ] Retry ASDF operation.   1: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the                                      configuration.   2:                                 Retry ASDF operation.   3:                                 Retry ASDF operation after resetting the                                      configuration.   4: [ABORT                        ] Give up on "cxml/dom"   5:                                 Give up on "cxml"   6:                                 Exit debugger, returning to top level.  ((:METHOD ASDF/OPERATE:OPERATE (SYMBOL T)) ASDF/LISP-ACTION:LOAD-OP "cxml/dom" :VERBOSE NIL) [fast-method]    error finding frame source: Bogus form-number: the source file has probably                                changed too much to cope with.    source: NIL 0]  
* (ql:quickload :klacks)  debugger invoked on a QUICKLISP-CLIENT:SYSTEM-NOT-FOUND in thread #<THREAD "main thread" RUNNING {10005504C3}>:   System "klacks" not found  Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.  restarts (invokable by number or by possibly-abbreviated name):   0: [CONTINUE] Try again   1: [ABORT   ] Give up on "klacks"   2:            Exit debugger, returning to top level.  ((LABELS QUICKLISP-CLIENT::RECURSE :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) "klacks")    source: (CERROR "Try again" 'SYSTEM-NOT-FOUND :NAME NAME) 
Add Comment
1 Answer(s)

Since you can load other systems, I assume you’ve gone through setting up quicklisp on your system.

There is no package named "klacks" on quicklisp.

You can check this by running:

(ql:system-apropos "klacks") 

Which outputs:

#<SYSTEM cxml-klacks / cxml-20181018-git / quicklisp 2019-03-07> #<SYSTEM cxml/klacks / cxml-20181018-git / quicklisp 2019-03-07> #<SYSTEM fxml/klacks / fxml-20181210-git / quicklisp 2019-03-07> 

So the system you are looking for is cxml-klacks

Load it using:

(ql:quickload "cxml-klacks") 

Which loads fine. Output on my system:

To load "cxml-klacks":   Load 1 ASDF system:     cxml-klacks ; Loading "cxml-klacks" ;;; Checking for wide character support... yes, using code points. ;;; Checking for wide character support... yes, using code points. ;;; Building Closure with CHARACTER RUNES  ("cxml-klacks") 

Also, cxml loads fine on my system but I’m using Clozure CL, I’m not sure what that error is for you. Try loading cxml-klacks and see if that works for you.

You can also try loading cxml/klacks, which maybe the package you want.

Answered on July 16, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.