From: Tomas Volf <~@wolfsden.cz>
To: Z572 <zhengjunjie@iscas.ac.cn>
Cc: "Ludovic Courtès" <ludo@gnu.org>, 74532@debbugs.gnu.org
Subject: bug#74532: with-extensions does not add native extensions to the load path
Date: Fri, 13 Dec 2024 17:44:09 +0100 [thread overview]
Message-ID: <87o71flehy.fsf@wolfsden.cz> (raw)
In-Reply-To: <87y10x4g2w.fsf@iscas.ac.cn> (zhengjunjie@iscas.ac.cn's message of "Tue, 03 Dec 2024 11:10:15 +0800")
[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]
Hello,
Z572 <zhengjunjie@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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
prev parent reply other threads:[~2024-12-13 16:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 17:49 bug#74532: with-extensions does not add native extensions to the load path Tomas Volf
2024-11-28 7:54 ` Ludovic Courtès
2024-12-02 23:40 ` Tomas Volf
2024-12-03 3:10 ` Z572
2024-12-13 16:44 ` Tomas Volf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o71flehy.fsf@wolfsden.cz \
--to=~@wolfsden.cz \
--cc=74532@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=zhengjunjie@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).