lem icon indicating copy to clipboard operation
lem copied to clipboard

Cannot `load-library` with binary Windows release

Open swapneils opened this issue 1 year ago • 2 comments

I tried loading libraries via code in init.lisp on the Windows 2.1.0 binary (released July), but get an error that the libraries couldn't be found.

When trying to use M-x load-library, I get the following:

Component "lem-contrib" not found
Backtrace for: #<SB-THREAD:THREAD "editor" RUNNING {1003CB0553}>
...
7: (ERROR ASDF/FIND-COMPONENT:MISSING-COMPONENT :REQUIRES "lem-contrib")
8: ((LAMBDA NIL :IN ASDF/SYSTEM:FIND-SYSTEM))
9: (ASDF/SESSION:CONSULT-ASDF-CACHE (ASDF/SYSTEM:FIND-SYSTEM "lem-contrib") #<FUNCTION (LAMBDA NIL :IN ASDF/SYSTEM:FIND-SYSTEM) {100CD7CF0B}>)
10: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/SYSTEM:FIND-SYSTEM) {100CD7CF0B}> :OVERRIDE NIL :KEY (ASDF/SYSTEM:FIND-SYSTEM "lem-contrib") :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
11: ((:METHOD ASDF/SYSTEM:SYSTEM-SOURCE-FILE (SYMBOL)) :LEM-CONTRIB) [fast-method]
12: (ASDF/SYSTEM:SYSTEM-SOURCE-DIRECTORY :LEM-CONTRIB)
13: (LEM-CORE:PROMPT-FOR-LIBRARY "load library: " :HISTORY-SYMBOL LEM-CORE/COMMANDS/OTHER:LOAD-LIBRARY)
...

Since it isn't on Quicklisp and the release zip doesn't have any free-floating Lisp files, how would we make lem-contrib visible to Lem (without just using git-clone to get a copy of the lem repository and hoping there aren't any breaking changes to contrib since the last release)? I don't see any documentation or previous issues regarding this error.

swapneils avatar Dec 06 '23 11:12 swapneils

Duplicate of #1032

swapneils avatar Dec 06 '23 11:12 swapneils

Since the libraries are not in the Lem default image, It's not possible to load them without them been in the quicklisp path:

(define-command load-library (name)
    ((prompt-for-library "load library: " :history-symbol 'load-library))
  "Load the Lisp library named NAME."
  (message "Loading ~A." name)
  (cond ((ignore-errors (maybe-quickload (format nil "lem-~A" name) :silent t))
         (message "Loaded ~A." name))
        (t (message "Can't find Library ~A." name))))

As I point out (https://github.com/lem-project/lem/issues/1032#issuecomment-1703902771), the contrib directory is just a temporal solution until we migrate the packages to Ultralistp

Sasanidas avatar Dec 06 '23 13:12 Sasanidas