IRC channel logs

2024-04-27.log

back to list of logs

<KE0VVT>What am I doing wrong? I'm trying to create a module. https://codeberg.org/csh/chromebook-guix/issues/1
<daviid>KE0VVT: might wana ask that quiz in #guix
<ArneBab>KE0VVT: yes, you must put the module (chromebook alsa-lib) into chromebook/alsa-lib.scm
<jgomo3>Hello. I'm reading the info pages of guile. I'm a bit stuck in the section "2.5.3 Putting Extensions into Modules". The `load-extension` function is called with the name of the extension `"libguile-bessel"`, not with its full path, but just the name. If I use the path, it works, but only the name doesn't. I think extensions are being loaded differently than modules, because changing the Guile's module load path with the option
<jgomo3>`-L`, only solved that problem for modules, not for loading extensions. So: How to make a folder reachable when Guile execute `load-extension` so it can find in that folder the extensions I put there?
<dsmith>jgomo3, You can use strace -efile to see where guile is searching for the file, and the exact name(s) beign searched for.
<dsmith>I don't remember exactly, but it *might* be using something like LD_LIBRARY_PATH and the like.
<jgomo3>dsmith: That `strace -efile` option is very interesting. Exactly how to proceed? I'm playing with the REPL by running guile like: `guile -L .`, and then, inside the REPL I'm trying to call `(load-extension "libguile-bessel" "libguile-bessel" "init_bessel")`. So, that `strace -efile` would be a call before launching the REPL? and what would be that "file" ? Or is it something I can write inside the REPL?
<dsmith>Something like `strace -efile -ologfile guile -L .`
<dsmith>The -e option limits what syscalls are logged.
<dsmith>Don't need it, but then you have to wade though all the other syscalls guile will make
<dsmith>Check the man page for strace
<jgomo3>dsmith: awesome! thank you very much. I'll give it a try. THANK YOU!!!
<mwette>add path to .so in LD_LIBARY_PATH
<jgomo3>nwette: Thank you very much! I'll do that also. :D
<jgomo3>All of that worked. Thank you. I added the folder to the LD_LIBRARY_PATH and it worked. Now, the chain of tries the system do to find it is very interesting:
<jgomo3>With that rtrace trick, I can see the secuence: usr/lib/x86_64-linux-gnu/libguile-bessel.so, /usr/lib/x86_64-linux-gnu/guile/3.0/extensions/libguile-bessel.so, ./glibc-hwcaps/x86-64-v3/libguile-bessel.so, ./glibc-hwcaps/x86-64-v2/libguile-bessel.so, ./libguile-bessel.so
<jgomo3>Now, is there like a "user space" where I could add extensions and modules that guile is already considering to search by default. Maybe something like ~/.local/guile/ ?
<old>jgomo3: check dlopen(3). That is what Guile uses
<old>"If filename is NULL, then the returned handle is for the main program. If filename contains a slash ("/"), then it is interpreted as a (relative or absolute) pathname. Otherwise, the dynamic linker searches for the object as follows (see ld.so(8) for further details):"
<old>so check the dynamic linker ld.so(8)
<old>but the dlopen(3) man page also explain the list of candidates
<KE0VVT>ArneBab: Thanks.
<coyote>hey everyone, I hope this is the right channel, but I'm trying Haunt and writing a theme for my website and I can't seem to make it output escape codes like &copy; and etc. for the layout, what could be happening?
<coyote>I'm on version 0.3.0 (from Guix)
<dthompson>coyote: the expectation is to output utf-8 encoded html so escape codes are not used. for that you'll want to make sure your html pages begin with <!DOCTYPE html>. you can see my theme here: https://git.dthompson.us/blog/tree/theme.scm#n54
<coyote>dthompson: i see, thanks for the answer :-) i already have my pages with the proper doctype, i'm just used to escape codes, but i can live with C-x 8 RET'ing the characters XD
<rlb>jgomo3: guile also consults LTDL_LIBRARY_PATH, and in the past civodul and I have discussed adding something like GUILE_EXTENSIONS_PATH, presumably with a corresponding %extensions-path or similar...
<wakyct>hi #guile, is there a cheatsheet along the lines of https://clojure.org/api/cheatsheet? Something like the reference manual's concept/procedure index but condensed with links
<attila_lendvai>how can i see "In system/repl/debug.scm: 72:40 2 (_)" in a backtrace, when the form pointed to is (false-if-exception (string->number (getenv "COLUMNS"))). the error is "In procedure string->number: Wrong type argument in position 1 (expecting string): #f", which is expected, because COLUMNS is unset.
<attila_lendvai>but this is wrapped in a false-if-exception... and i cannot reproduce it in a repl.
<attila_lendvai>in a repl (false-if-exception (string->number #f)) evaluates to #f as expected
<attila_lendvai>this is v3.0.9 binary in guix, and i have verified that i'm looking at the v3.0.9 tag of the sourcecode.
<attila_lendvai>i either need to sleep, or this is a guile bug...
<attila_lendvai>maybe a different string->number implementation is run in a repl and in compiled code? and that's why i cannot reproduce it in the repl?
<attila_lendvai>and it's not just any compiled code, but bootstrapped guile itself. maybe that's straight out a third category?
<attila_lendvai>ACTION gives up and goes to sleep...
<jgomo3>old: Thank you for pointing out dlopen
<jgomo3>elb: Thank you for pointing the LTDL_LIBRARY_PATH. That idea of GUILE_EXTENSIONS_PATH, I would give my vote ;-)
<jgomo3>rlb: Thank you for pointing the LTDL_LIBRARY_PATH. That idea of GUILE_EXTENSIONS_PATH, I would give my vote ;-)
<jgomo3>rlb: Given that you mention that customization, and I have some interest in the XDG Base Directories specifications support: Does Guile support XDG?
<rlb>jgomo3: I believe guile supports XDG_CACHE_HOME for the guile cache, but not for other things like config atm.
<anthk_>hello