ruricolist / spinneret

Common Lisp HTML5 generator
MIT License
369 stars 26 forks source link

Trouble installing via quicklisp #99

Closed GrumpyOldGandalf closed 3 months ago

GrumpyOldGandalf commented 3 months ago

When attempting to load 'spinneret' from Quicklisp, I get the following consecutive error conditions:

* (ql:quickload "spinneret")
To load "spinneret":
  Load 1 ASDF system:
    spinneret
; Loading "spinneret"
..................................................
[package spinneret]
debugger invoked on a SB-KERNEL:SIMPLE-PACKAGE-ERROR in thread
#<THREAD tid=259 "main thread" RUNNING {70087805A3}>:
  no symbol named "HASH-TABLE-KEYS" in "SERAPEUM"

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE                     ] INTERN it.
  1: [RETRY                        ] Retry
                                     compiling #<CL-SOURCE-FILE "spinneret" "package">.
  2: [ACCEPT                       ] Continue, treating
                                     compiling #<CL-SOURCE-FILE "spinneret" "package">
                                     as having been successful.
  3:                                 Retry ASDF operation.
  4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  5:                                 Retry ASDF operation.
  6:                                 Retry ASDF operation after resetting the
                                     configuration.
  7: [ABORT                        ] Give up on "spinneret"
  8: [REGISTER-LOCAL-PROJECTS      ] Register local projects and try again.
  9:                                 Exit debugger, returning to top level.

(SB-IMPL::FIND-OR-MAKE-SYMBOL "HASH-TABLE-KEYS" #<PACKAGE "SERAPEUM">)
0] 0

debugger invoked on a PACKAGE-LOCKED-ERROR in thread
#<THREAD tid=259 "main thread" RUNNING {70087805A3}>:
  Lock on package SERAPEUM violated when interning HASH-TABLE-KEYS while in
  package COMMON-LISP-USER.
See also:
  The SBCL Manual, Node "Package Locks"

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE                     ] Ignore the package lock.
  1: [IGNORE-ALL                   ] Ignore all package locks in the context of this operation.
  2: [UNLOCK-PACKAGE               ] Unlock the package.
  3: [RETRY                        ] Retry
                                     compiling #<CL-SOURCE-FILE "spinneret" "package">.
  4: [ACCEPT                       ] Continue, treating
                                     compiling #<CL-SOURCE-FILE "spinneret" "package">
                                     as having been successful.
  5:                                 Retry ASDF operation.
  6: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  7:                                 Retry ASDF operation.
  8:                                 Retry ASDF operation after resetting the
                                     configuration.
  9: [ABORT                        ] Give up on "spinneret"
 10: [REGISTER-LOCAL-PROJECTS      ] Register local projects and try again.
 11:                                 Exit debugger, returning to top level.

(PACKAGE-LOCK-VIOLATION #<PACKAGE "SERAPEUM"> :SYMBOL NIL :FORMAT-CONTROL "interning ~A" :FORMAT-ARGUMENTS ("HASH-TABLE-KEYS"))
0] 0

debugger invoked on a SB-KERNEL:SIMPLE-PACKAGE-ERROR in thread
#<THREAD tid=259 "main thread" RUNNING {70087805A3}>:
  no symbol named "ALIST-HASH-TABLE" in "SERAPEUM"

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE                     ] INTERN it.
  1: [RETRY                        ] Retry
                                     compiling #<CL-SOURCE-FILE "spinneret" "package">.
  2: [ACCEPT                       ] Continue, treating
                                     compiling #<CL-SOURCE-FILE "spinneret" "package">
                                     as having been successful.
  3:                                 Retry ASDF operation.
  4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  5:                                 Retry ASDF operation.
  6:                                 Retry ASDF operation after resetting the
                                     configuration.
  7: [ABORT                        ] Give up on "spinneret"
  8: [REGISTER-LOCAL-PROJECTS      ] Register local projects and try again.
  9:                                 Exit debugger, returning to top level.

(SB-IMPL::FIND-OR-MAKE-SYMBOL "ALIST-HASH-TABLE" #<PACKAGE "SERAPEUM">)
0] 0

debugger invoked on a PACKAGE-LOCKED-ERROR in thread
#<THREAD tid=259 "main thread" RUNNING {70087805A3}>:
  Lock on package SERAPEUM violated when interning ALIST-HASH-TABLE while in
  package COMMON-LISP-USER.
See also:
  The SBCL Manual, Node "Package Locks"

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE                     ] Ignore the package lock.
  1: [IGNORE-ALL                   ] Ignore all package locks in the context of this operation.
  2: [UNLOCK-PACKAGE               ] Unlock the package.
  3: [RETRY                        ] Retry
                                     compiling #<CL-SOURCE-FILE "spinneret" "package">.
  4: [ACCEPT                       ] Continue, treating
                                     compiling #<CL-SOURCE-FILE "spinneret" "package">
                                     as having been successful.
  5:                                 Retry ASDF operation.
  6: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  7:                                 Retry ASDF operation.
  8:                                 Retry ASDF operation after resetting the
                                     configuration.
  9: [ABORT                        ] Give up on "spinneret"
 10: [REGISTER-LOCAL-PROJECTS      ] Register local projects and try again.
 11:                                 Exit debugger, returning to top level.

(PACKAGE-LOCK-VIOLATION #<PACKAGE "SERAPEUM"> :SYMBOL NIL :FORMAT-CONTROL "interning ~A" :FORMAT-ARGUMENTS ("ALIST-HASH-TABLE"))
0] 0
...............................
[package spinneret-user]....
; file: /Users/gandalf/.roswell/lisp/quicklisp/dists/ultralisp/software/ruricolist-spinneret-20240527110536/tags.lisp
; in: DEFINE-GLOBAL-PARAMETER *PSEUDOTAG-EXPANDERS*
;     (LOAD-TIME-VALUE
;      (SERAPEUM::ALIST-HASH-TABLE
;       '((:DOCTYPE . SPINNERET::MAKE-DOCTYPE)
;         (:!DOCTYPE . SPINNERET::MAKE-DOCTYPE) (:CDATA . SPINNERET::MAKE-CDATA)
;         (:!-- . SPINNERET::MAKE-COMMENT) (:COMMENT . SPINNERET::MAKE-COMMENT)
;         (:HTML . SPINNERET::MAKE-HTML) (:HEAD . SPINNERET::MAKE-HEAD)
;         (:RAW . SPINNERET::WRITE-RAW) (:H* . SPINNERET::EXPAND-H*)
;         (:TAG . SPINNERET::EXPAND-DYNAMIC-TAG))
;       :TEST 'EQ)
;      T)
;
; caught ERROR:
;   (during EVAL of LOAD-TIME-VALUE)
;   The function SERAPEUM::ALIST-HASH-TABLE is undefined.

debugger invoked on a SB-INT:COMPILED-PROGRAM-ERROR in thread
#<THREAD tid=259 "main thread" RUNNING {70087805A3}>:
  Execution of a form compiled with errors.
Form:
  (LOAD-TIME-VALUE
 (ALIST-HASH-TABLE
  '((:DOCTYPE . MAKE-DOCTYPE) (:!DOCTYPE . MAKE-DOCTYPE) (:CDATA . MAKE-CDATA)
    (:!-- . MAKE-COMMENT) (:COMMENT . MAKE-COMMENT) (:HTML . MAKE-HTML)
    (:HEAD . MAKE-HEAD) (:RAW . WRITE-RAW) (:H* . EXPAND-H*)
    (:TAG . EXPAND-DYNAMIC-TAG))
  :TEST 'EQ)
 T)
Compile-time error:
  (during EVAL of LOAD-TIME-VALUE)
The function SERAPEUM::ALIST-HASH-TABLE is undefined.

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
                                     compiling #<CL-SOURCE-FILE "spinneret" "tags">.
  1: [ACCEPT                       ] Continue, treating
                                     compiling #<CL-SOURCE-FILE "spinneret" "tags">
                                     as having been successful.
  2:                                 Retry ASDF operation.
  3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  4:                                 Retry ASDF operation.
  5:                                 Retry ASDF operation after resetting the
                                     configuration.
  6: [ABORT                        ] Give up on "spinneret"
  7: [REGISTER-LOCAL-PROJECTS      ] Register local projects and try again.
  8:                                 Exit debugger, returning to top level.

((LAMBDA NIL :IN "/Users/gandalf/.roswell/lisp/quicklisp/dists/ultralisp/software/ruricolist-spinneret-20240527110536/tags.lisp"))
   source: (LOAD-TIME-VALUE
            (ALIST-HASH-TABLE
             '((:DOCTYPE . MAKE-DOCTYPE) (:!DOCTYPE . MAKE-DOCTYPE)
               (:CDATA . MAKE-CDATA) (:!-- . MAKE-COMMENT)
               (:COMMENT . MAKE-COMMENT) (:HTML . MAKE-HTML)
               (:HEAD . MAKE-HEAD) (:RAW . WRITE-RAW) (:H* . EXPAND-H*)
               (:TAG . EXPAND-DYNAMIC-TAG))
             :TEST 'EQ)
            T)
0]

I can, however, load serapeum independently.

* (ql:quickload :serapeum)
To load "serapeum":
  Load 1 ASDF system:
    serapeum
; Loading "serapeum"

(:SERAPEUM)
*

So on the surface it looks like spinneret is expecting serapeum to provide hash-table-keys and alist-hash-table symbols, but it isn't, and the rest of the issues are just results of that failure. Looking at the package.lisp definition in serapeum:

https://github.com/ruricolist/serapeum/blob/master/package.lisp

It seems that serapeum is explicitly importing plist-hash-table and hash-table-values from Alexandria, but not alist-hash-table or hash-table-keys but the compiler is trying to intern alist-hash-table and hash-table-keys in the serapeum package. It also appears that SBCL package locking is a known problem with other symbols in serapeum, judging by the comment near the top of the package.lisp listing:

(defpackage #:serapeum.sum
  (:use)
  ;; Create this in another package than SERAPEUM
  ;; to prevent SBCL package locking from keeping
  ;; SUM being defined in a FLET
  (:export #:sum))

So perhaps something about the way serapeum is loading those symbols that are defined in Alexandria is causing this package lock issue, and the solution is on the serapeum side. However, why it manifests only when loading spinneret for me is not clear.

This is preventing me from using another package that depends on spinneret, namely reblocks. I can't seem to produce it loading any other package besides spinneret at the moment, nor am I sure how to reproduce it - I'm on a deadline and am having to rule out using the packages I wanted to use because of this error.

I am also logging this issue in serapeum's GitHub repository, since #+sb-package-locks (:lock t) is specified in the package.lisp file so they should be aware this is causing problems loading a package that uses it.

I am running on MacBook Pro M1 Max with SBCL via Roswell on Sonoma 14.5.

kilianmh commented 3 months ago

The Issue was fixed yesterday. See #97. It will be in ultralisp spinneret end of tommorow.

GrumpyOldGandalf commented 3 months ago

Ah, I didn't immediate recognize the problem from the title of #97 when I skimmed over the existing issues, but I should have. Sorry for the duplicate entry.

I don't think it's true to say serapeum no longer uses alexandria at all (at least not judging by the package.lisp for the project at the main branch), but it definitely isn't importing those two symbols anymore.

I will check out the commit that fixes it since I'm curious what exactly was provoking it. Thanks for letting me know it's already fixed! Should it be possible for me to clone it locally to get it to load today?

GrumpyOldGandalf commented 3 months ago

Oh I see why I didn't notice #97 - it's no longer open so didn't show up in the open list. duh. :)

GrumpyOldGandalf commented 3 months ago

OK I can confirm that checking out the latest spinneret at master into ~/common-lisp/ did the trick. I am now able to load spinneret. However, I do understand that after the change propagates to ultralisp I'm probably better off removing the local clone to stay current.