fukamachi / clack

Web server abstraction layer for Common Lisp
MIT License
1.04k stars 86 forks source link

Error on startup: "Don't know how to REQUIRE sb-concurrency." #187

Closed fosskers closed 1 year ago

fosskers commented 1 year ago

Hi there, thank you for clack.

I know that clackup (the CLI tool) is advertised as the way to start a server, but what if I want to do it myself in a main function in an executable I compiled?

Here is my current main:

(defun main ()
  (format t "Starting server!~%")
  (setf *server* (start-server))
  (handler-case (bt:join-thread (find-if (fn (search "clack" (bt:thread-name %)))
                                         (bt:all-threads)))
    (sb-sys:interactive-interrupt ()
      (progn (format t "Aborting...~%")
             (clack:stop *server*)
             (uiop:quit)))))

As you can see, this is SBCL. But when I compile this and start the server from the command line, I'm told:

Unhandled SB-INT:EXTENSION-FAILURE in thread #<SB-THREAD:THREAD tid=11837 "main thread" RUNNING
                                                {10050081B3}>:
  Don't know how to REQUIRE sb-concurrency.

And it crashes. Do you know what's happening here?

忙しい中ありがとうございます

fukamachi commented 1 year ago

Thank you for using Clack!

It seems SBCL couldn't load its contrib when it invoked in an executable.

Perhaps it resolves by adding (require 'sb-concurrency) in the main function's file. I'm not sure whether that's the only problem, though.

fosskers commented 1 year ago

Thanks! I ended up fixing it by explicitly depending on sb-concurrency in my .asd file.