(address . bug-guix@gnu.org)
The documentation for `with-extensions' says:
Toggle quote (4 lines)
> In the same vein, sometimes you want to import not just pure-Scheme
> modules, but also “extensions” such as Guile bindings to C libraries
> or other “full-blown” packages.
However it does not actually add those C libraries into
(guile-extensions-path), which means that trying to actually use a
library imported this way will lead to an error.
I guess `load-path-expression' in (guix gexp) needs to also append to
the `guile-extensions-path' based on the search-paths of the imported
packages?
Reproduction is simple. Make sure you *do not* have guile-yamlpp
installed in your profile. Then build the `test' into a store item.
Toggle snippet (6 lines)
(use-modules (gnu packages guile-xyz))
(define test
(with-extensions (list guile-yamlpp)
(program-file "test" #~(use-modules (yamlpp)))))
And try to run it:
Toggle snippet (39 lines)
$ /gnu/store/nq0sahcnph5sxms4irq4inv2hq2hfbzr-test
Backtrace:
19 (primitive-load "/gnu/store/nq0sahcnph5sxms4irq4inv2hq2hfbzr-test")
In ice-9/eval.scm:
721:20 18 (primitive-eval _)
In ice-9/psyntax.scm:
1229:36 17 (expand-top-sequence _ _ _ #f _ _ _)
1221:19 16 (parse _ (("placeholder" placeholder)) ((top) #(ribcage () () ())) _ e (eval) #)
259:10 15 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) (hygiene guile-user))
In ice-9/boot-9.scm:
3935:20 14 (process-use-modules _)
222:17 13 (map1 (((yamlpp))))
3936:31 12 (_ ((yamlpp)))
3327:17 11 (resolve-interface (yamlpp) #:select _ #:hide _ #:prefix _ #:renamer _ # _)
In ice-9/threads.scm:
390:8 10 (_ _)
In ice-9/boot-9.scm:
3253:13 9 (_)
In ice-9/threads.scm:
390:8 8 (_ _)
In ice-9/boot-9.scm:
3544:20 7 (_)
2836:4 6 (save-module-excursion _)
3564:26 5 (_)
In unknown file:
4 (primitive-load-path "yamlpp" #<procedure 7f405e4fd560 at ice-9/boot-9.scm:35…>)
In yamlpp.scm:
65:1 3 (_)
In unknown file:
2 (load-extension "libguile-yamlpp" "init")
In system/foreign-library.scm:
190:25 1 (load-foreign-library _ #:extensions _ #:search-ltdl-library-path? _ # _ # _ # …)
In unknown file:
0 (dlopen "libguile-yamlpp.so" 1)
ERROR: In procedure dlopen:
In procedure dlopen: file "libguile-yamlpp.so", message "libguile-yamlpp.so: cannot open shared object file: No such file or directory"
Have a nice day,
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----
iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdEuMEOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wanAZQ//X6YPkDpbrYK/OljWuxU70D6EC9+jQTkv1I4V
3mofSAWGP/D2PTFr5A+2lyLDKmzu68HqP+KNiRSjXBFwxr5hot50ZDNKPZdNc4My
elkVUgUmYYVzO33Zyu+nZYsXjZO4B7JzylMOsJ0QbxCSI3aOF9NPeP6h7TN+ReJi
B22XDz+gXOMJNFYBsUMSAK/ZvSyejenr8yTLQ1/EO+IVHV+dC8qeHSlMGPX2rm90
fCA0YHPlK5pEql4osigorvevsihONEyfKENCIZ0p2gg2MWsHAEHNteqy2KGFrwjB
WC9rQgtbekwvHJcEf1FSL7W/CQRCUc6Zrn1of4D0WQ1hoOS2HTyre9Peny8j453G
AYFDZw6Iq4KZG7Som4R0ME7sQNGoMpV1Il5JJcPEr2TFF2xpm4tGLPWBYKrBSa1M
FLU2vBzbI9GC0L3f3pKEojPI47eY3OjMp5nRYALr32S5xXOn/TrJQMMyXIUX0M7G
aip8e9l5UK0r76AgDaaou7Vqpx622JIVn8PvOZ5RfOsiJ0tXWGW6ZG2VV6Iv2/KY
hl+Ozars2cZXk/JAVgbA2HZ/9oi3CloFFfO6pKLkXfVo5Jl/Me2dcI2rPOeKAtnw
vC5UqsEjErXfjpI1CKtqaww5JoZM52dslbk8RzczbyUJN5HhNkuOG2sSXKI47kYb
A45WS50=
=LC0N
-----END PGP SIGNATURE-----