GNU bug report logs - #74532
with-extensions does not add native extensions to the load path

Previous Next

Package: guix;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Mon, 25 Nov 2024 17:51:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tomas Volf <~@wolfsden.cz>
Subject: bug#74532: closed (Re: bug#74532: with-extensions does not add
 native extensions to the load path)
Date: Tue, 01 Apr 2025 07:50:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#74532: with-extensions does not add native extensions to the load path

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 74532 <at> debbugs.gnu.org.

-- 
74532: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74532
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Timo Wilken <guix <at> twilken.net>
Cc: Tomas Volf <~@wolfsden.cz>, Z572 <zhengjunjie <at> iscas.ac.cn>,
 74532-done <at> debbugs.gnu.org
Subject: Re: bug#74532: with-extensions does not add native extensions to
 the load path
Date: Tue, 01 Apr 2025 09:49:15 +0200
Timo Wilken <guix <at> twilken.net> skribis:

> * gnu/packages/guile-xyz.scm (guile-yamlpp) [arguments] <phases>:
>   Add 'set-extension-file-name and move 'check after 'install.
>
> Change-Id: I49a7199b4e0fe4053822374bae59c6e1d0b7ead0

Applied, thanks!

[Message part 3 (message/rfc822, inline)]
From: Tomas Volf <~@wolfsden.cz>
To: bug-guix <at> gnu.org
Subject: with-extensions does not add native extensions to the load path
Date: Mon, 25 Nov 2024 18:49:53 +0100
[Message part 4 (text/plain, inline)]
The documentation for `with-extensions' says:

> 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.

--8<---------------cut here---------------start------------->8---
(use-modules (gnu packages guile-xyz))
(define test
  (with-extensions (list guile-yamlpp)
    (program-file "test" #~(use-modules (yamlpp)))))
--8<---------------cut here---------------end--------------->8---

And try to run it:

--8<---------------cut here---------------start------------->8---
$ /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"
--8<---------------cut here---------------end--------------->8---

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.