egallesio / STklos

STklos Scheme
http://stklos.net
GNU General Public License v2.0
69 stars 17 forks source link

Can't load libraries #536

Closed jpellegrini closed 1 year ago

jpellegrini commented 1 year ago

For some reason, STklos is not anymore completing symbol names. It was in commit 9d855f821f55.

jpellegrini commented 1 year ago

I suppose it's the change in modules. Probably, the C code that does recover symbol names from modules isn't able to do that anymore.

jpellegrini commented 1 year ago

%init-readline-completion-function is not available anymore in the STklos module...

lassik commented 1 year ago

Is that under Linux?

IIRC the logic for finding the readline C library changed recently. @egallesio

jpellegrini commented 1 year ago

IIRC the logic for finding the readline C library changed recently

The commit I mentioned works, so I guess it's the changes made recently.

It seems to not be aware of the path:

stklos> (select-module READLINE)
READLINE> (try-initialize (string-append "libreadline.so"))
#t
READLINE> (try-load "readline-complete.so")
#f
READLINE> (try-load "/usr/local/lib/stklos/1.70/readline-complete.so")   ;; Aha! with the full path it works
#t
READLINE> (%init-readline-completion-function readline-completion-generator)
jpellegrini commented 1 year ago
$ ll /usr/local/lib/stklos/1.70/
total 20
-rw-r--r-- 1 root root 19704 Apr 12 10:03 readline-complete.so
drwxr-xr-x 1 root root    92 Apr 12 10:03 scheme
drwxr-xr-x 1 root root    62 Apr 12 10:03 srfi
drwxr-xr-x 1 root root    16 Apr 12 10:03 stklos

Hm, it's the only .so file in that place (clean install, after removing /usr/local/lib/stklos and /usr/local/share/stklos)

jpellegrini commented 1 year ago

Oooooh I think I found it.

READLINE> (load-path)
("." "/home/jeronimo/.stklos/pkg/lib" "/home/jeronimo/.stklos/ext" "/usr/local/lib/stklos/1.70.1116" "/usr/local/share/stklos/1.70.1116")

However, that directory doesn't exist! It stil linstalls everything under /usr/local/lib/stklos/1.70.

jpellegrini commented 1 year ago
stklos> (import (srfi 25))
**** Error:
load: cannot load file "srfi/25"
jpellegrini commented 1 year ago

@egallesio -- a question: STklos should install under which directory?

/usr/local/{share,lib}/stklos/major.minor.PATCH
/usr/local/{share,lib}/stklos/major.minor
egallesio commented 1 year ago

Oops. My fault. I have changed the way versions number are managed and forgot to test where things are installed. I correct that asap. Sorry.

egallesio commented 1 year ago

This should be OK now.

@egallesio -- a question: STklos should install under which directory?

/usr/local/{share,lib}/stklos/major.minor.PATCH
/usr/local/{share,lib}/stklos/major.minor

IMO, /usr/local/{share,lib}/stklos/major.minor avoids cluttering /usr/local.

jpellegrini commented 1 year ago

IMO, /usr/local/{share,lib}/stklos/major.minor avoids cluttering /usr/local.

I agree! :)

So it looks like this one is fixed! :smiley: