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


Message #17 received at 74532 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Z572 <zhengjunjie <at> iscas.ac.cn>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 74532 <at> debbugs.gnu.org
Subject: Re: bug#74532: with-extensions does not add native extensions to
 the load path
Date: Fri, 13 Dec 2024 17:44:09 +0100
[Message part 1 (text/plain, inline)]
Hello,

Z572 <zhengjunjie <at> iscas.ac.cn> writes:

>> How it that usually done?  I cannot do that *before* build, because then
>> tests would not run (the library is not yet installed into the absolute
>> path), and I cannot do it after, because I would need to rebuild the .go
>> files after patching the source code.
>
> you can use substitute* to adjust source.
> e.g.
>
> (or (false-if-exception (load-extension "/path/to/lib-some-object-file.so"))
>     (load-extension "lib-some-object-file.so"))
>

Thank you for the suggestion.  I am not sure I like the
false-if-exception part, but temporary adjustment of the (@ (system
foreign-library) guile-extensions-path) should do the trick as well.

One thing I am curious about, I can see you have put the load from
absolute path as the first alternative.  But if it fails, it still falls
back to lookup based on the guile-extensions-path.  I wonder whether
putting it at the end of the list would not be better, that way you
could still replace the library in the spirit of LD_PRELOAD by setting
the appropriate environment variable.  And if reproducibility is the
priority, then even the `or' might not make sense.

Any thoughts on that?

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