lokke-org / lokke

Lokke: Clojure for Guile
Other
199 stars 11 forks source link

guile.in: use GUILE_SYSTEM_EXTENSIONS_PATH #7

Closed aconchillo closed 3 years ago

aconchillo commented 3 years ago

Use GUILE_SYSTEM_EXTENSIONS_PATH instead of LTDL_LIBRARY_PATH. GUILE_SYSTEM_EXTENSIONS_PATH is portable.

rlbdv commented 3 years ago

Hmm, I'm not positive, but I suspect we can't really override GUILE_SYSTEM_EXTENSIONS_PATH (at least not trivially) since that's how guile finds its own extensions (like readline). Here ./crashes with the change:

(pr-7)$ ./guile
Backtrace:
In ice-9/boot-9.scm:
    718:2 19 (call-with-prompt ("prompt") #<procedure 7f4d07ec5ba0 ?> ?)
In ice-9/eval.scm:
    619:8 18 (_ #(#(#<directory (guile-user) 7f4d08f98f00>)))
In unknown file:
          17 (primitive-load "/home/rlb/.guile")
In ice-9/eval.scm:
   721:20 16 (primitive-eval (use-modules (ice-9 readline)))
In ice-9/psyntax.scm:
  1241:36 15 (expand-top-sequence ((use-modules (ice-9 readline))) _ ?)
  1233:19 14 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?)
   285:10 13 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) ?)
In ice-9/boot-9.scm:
  3898:20 12 (process-use-modules _)
   222:17 11 (map1 (((ice-9 readline))))
  3899:31 10 (_ ((ice-9 readline)))
  3297:17  9 (resolve-interface (ice-9 readline) #:select _ #:hide _ ?)
In ice-9/threads.scm:
    390:8  8 (_ _)
In ice-9/boot-9.scm:
  3223:13  7 (_)
In ice-9/threads.scm:
    390:8  6 (_ _)
In ice-9/boot-9.scm:
  3507:20  5 (_)
   2806:4  4 (save-module-excursion #<procedure 7f4d07ec1b10 at ice-?>)
  3527:26  3 (_)
In unknown file:
           2 (primitive-load-path "ice-9/readline" #<procedure 7f4d0?>)
In ice-9/readline.scm:
     44:4  1 (_)
In unknown file:
           0 (load-extension "guile-readline" "scm_init_readline")

There's a related note in DESIGN.md mentioning that to really address this may require upstream changes. But perhaps there's a different variable that'll work on your system. If so, I can likely adapt ./guile to use it when needed. What's the platform?

And I don't currently suspect it's likely, but also wonder if there's a chance a relevant dependency (e.g libtool-related) might be missing.

Thanks

aconchillo commented 3 years ago

Oh, I see... Yes, if you want to use extensions form multiple directories that would not work.

I'm using macOS Catalina (10.15). I'm trying to make lokke work in macOS. Which I actually did, but I needed a few tweaks like this one. In my system it works because in Homebrew guile defines GUILE_SYSTEM_EXTENSIONS_PATH (something I actually added to Homebrew) so basically with this patch I was just appending the .libs directory to the already existing one, that's why I didn't run into any issues.

I'll see if I find a way. I'm closing this for now.