IRC channel logs

2022-09-07.log

back to list of logs

<zimoun>thanks for explaining. I wanted to avoid this build time step; which implies configure or equivalent (.scm.in -> .scm)
<rekado>you might be able to add the directory relative to (current-filename) to the load path
<rekado>then you can avoid the build time embedding of directories
<zimoun>ah thanks! I will try that
<zimoun>rekado: because I am still failing, I just wrote down my issue with a minimal example. https://lists.gnu.org/archive/html/guix-devel/2022-09/msg00057.html
<rekado>huh, interesting.
<rekado>I can reproduce this.
<rekado>this works: (load-from-path "top.scm") ((@ (my top) from-top))
<rekado>but it’s clearly wrong that (use-modules (my top)) doesn’t do the right thing.
<zimoun>ah yeah, I forgot to report that (use-modules (my top)) fails. :-) Indeeds, (load-from-path "top.scm") works. Hum, the Guile module system appears to me a big beast.
<zimoun>maybe civodul would tell what is missing. :-)
<rekado>I’m stumped.
<rekado>no idea why it can’t just be loaded with use-modules
<rekado>i wonder if that’s a consequence of how run-guix-command sets things up
<zimoun>GWL directly calls Guile and it does not run via Guix proprer, IIUC.
<rekado>correct
<rekado>i think your code has a mistake
<rekado>it now works with ((module-ref (resolve-interface '(my top)) 'from-top)) in my test case
<rekado>the definition of my-path looks wrong
<rekado>you add /tmp/example/my to the load path, but it should be /tmp/example
<rekado>because the module is at /tmp/example/my/top.scm and it’s called (my top), so you should add /tmp/example to the load path.
<rekado>still doesn’t fix (use-modules (my top)), but that’s another matter
<rekado>((@ (my top) from-top)) works as well
<zimoun>indeed, but then (%search-load-path "top") returns false.
<rekado>(%search-load-path "my/top") works fine
<rekado>because “top” is not in any directory on the load path; it’s in a sub-directory
<zimoun>back use-modules, run it outside define-command and everything works.
***civodul` is now known as civodul