common-lispfficursessbclquicklisp

Package lock error while installing SBCL CFFI package on Mac via Quicklisp


I'm trying to use curses from Common Lisp, and the commonly-used cl-charms and croatoan libraries need cffi. In SBCL on a Mac, ql:quickload usually works fine... but installing cffi (either directly or as a dependency of one of the other libraries) fails:

(ql:quickload :cffi)

Gives me the REPL output:

; caught ERROR:
;   READ error during COMPILE-FILE:
;   
;     Lock on package SB-ALIEN violated when interning SHARED-OBJECT-FILE while in
;     package CFFI-SYS.

and stacktrace:

Error while trying to load definition for system cl-charms from pathname
/Users/jacobsen/quicklisp/dists/quicklisp/software/cl-charms-20181210-git/cl-charms.asd:
   COMPILE-FILE-ERROR while
   compiling #<CL-SOURCE-FILE "cffi" "src" "cffi-sbcl">
   [Condition of type ASDF/FIND-SYSTEM:LOAD-SYSTEM-DEFINITION-ERROR]

Restarts:
 0: [RETRY] Retry compiling #<CL-SOURCE-FILE "cffi" "src" "cffi-sbcl">.
 1: [ACCEPT] Continue, treating compiling #<CL-SOURCE-FILE "cffi" "src" "cffi-sbcl"> as having been successful.
 [...]
 --more--

Backtrace:
  0: ((FLET "H0" :IN ASDF/ACTION:PERFORM) #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {10039748F3}>)
  1: (SB-KERNEL::%SIGNAL #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {10039748F3}>)
  2: (ERROR UIOP/LISP-BUILD:COMPILE-FILE-ERROR :CONTEXT-FORMAT "~/asdf-action::format-action/" :CONTEXT-ARGUMENTS ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cffi" "src" "cffi-sb..
  3: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cffi" "src" "cffi-sbcl">)))
  [...]
 --more--

This also is the case when I brew uninstall sbcl and install SBCL from source. My SBCL is the latest version (1.5.6).

What extra setup is needed to get SBCL working with libraries that require FFI?

Addendum/edit: it also fails in the same way using Roswell to install SBCL instead of straight-up Homebrew installation of SBCL.


Solution

  • I did an extensive cleaning of my Homebrew setup (following the advice in this answer on apple.stackexchange.com) and a fresh reinstall of sbcl and quicklisp. Loading cffi and cl-charms now works without error.