5

On MacOS: When I try to load log4cl I get a compile error:

CL-USER> (ql:quickload "log4cl")
To load "log4cl":
  Load 1 ASDF system:
    log4cl
; Loading "log4cl"
.
; 
; caught ERROR:
;   READ error during COMPILE-FILE:
;   
;     Lock on package SB-C violated when interning LAMBDA-PARENT while in package
;     LOG4CL-IMPL.
;   See also:
;     The SBCL Manual, Node "Package Locks"
;   
;     (in form starting at line: 99, column: 0, position: 3779)

 COMPILE-FILE-ERROR while
compiling #<CL-SOURCE-FILE "log4cl" "src" "naming-sbcl">
   [Condition of type UIOP/LISP-BUILD:COMPILE-FILE-ERROR]

On Ubuntu: I do not see that error and log4cl loads without problem. What could be the cause of this?

Barmar
  • 741,623
  • 53
  • 500
  • 612
mbruun
  • 63
  • 3
  • Log4cl is trying to access an implementation symbol named `sb-c::lambda-parent` but this symbol probably does not exist on your version of sbcl on MacOS, and as such Lisp is trying to add this symbol to the SB-C package; but since the package is locked, this is forbidden. Either `lambda-parent` used to exist and was removed (if your sbcl version is too recent), or the log4cl is recent and trying to access a symbol that is not present in a too old version of SBCL. – coredump Apr 05 '23 at 08:23
  • On MacOS I have version 2.3.3 of sbcl. On Ubuntu I have version 2.2.3. So it looks like log4cl does not compile on the new version of sbcl. – mbruun Apr 05 '23 at 09:55
  • This comes from this commit from approx a month ago: https://sourceforge.net/p/sbcl/sbcl/ci/6a1416ed73017840141cfe5ed0c82ba8bb00fe81/ You should probably fill a bug for log4cl maintainers and in the meantime have a local patch to fix it – coredump Apr 05 '23 at 10:19
  • 1
    It looks like the issue has been fixed in log4cl: https://github.com/sharplispers/log4cl/commit/01242ffbc43f5cf17f612878666341b0a3430c46. So I guess I just have to work on Linux until log4cl is updated in quicklisp. – mbruun Apr 05 '23 at 10:20
  • 2
    great, this is already fixed!, I propose you write a self-answer that summarizes the problem/solution and accept it – coredump Apr 05 '23 at 10:54

3 Answers3

4

There are a few solutions here, as confirmed by the comments:

Dima
  • 394
  • 3
  • 10
3

Like said by coredump :

"Log4cl is trying to access an implementation symbol named sb-c::lambda-parent but this symbol probably does not exist on your version of sbcl on MacOS, and as such Lisp is trying to add this symbol to the SB-C package; but since the package is locked, this is forbidden."

And now I add my little two cents :

LAMBDA-PARENT has been removed from SBCL 3 years ago, with the following message :

"Remove LAMBDA-PARENT.

LAMBDA-LEXENV already has it."

Now the question is : what is the version of your log4cl library, and where does it come from ?

Mine is coming from Quicklisp and it works fine with version 2.3.2 of SBCL, it is http://beta.quicklisp.org/archive/log4cl/2021-12-09/log4cl-20211209-git.tgz

Maybe you should update Quicklisp :

To get updated software, use:

(ql:update-dist "quicklisp")

Software updates are usually available about once per month.

To update the Quicklisp client, use:

(ql:update-client)
Jérôme Radix
  • 10,285
  • 4
  • 34
  • 40
  • 2
    I also have the 20211209 version of log4cl which does not work with sbcl 2.3.3. So it seems that the problem occurs when upgrading from 2.3.2 to 2.3.3 – mbruun Apr 05 '23 at 19:52
  • Yes, I can confirm that it also does not work with SBCL 2.3.3 for me. Exact same error. – Dima Apr 11 '23 at 08:45
0

I have SBCL 2.3.3 installed on GNU/Linux and had the same problem.

I solved the problem by using the version of log4cl from git:

$ cd quicklisp/local-projects/
$ git clone https://github.com/sharplispers/log4cl

Then running

(ql:quickload "log4cl")

uses the local version which includes the patch which fixes SBCL 2.3.3 compatibility.

tla
  • 855
  • 1
  • 14