unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Philip McGrath <philip@philipmcgrath.com>
Cc: jackhill@trilug.org, 47180@debbugs.gnu.org
Subject: [bug#47180] [PATCH] gnu: racket: Don't inject store paths into Racket files.
Date: Sat, 17 Apr 2021 12:12:13 +0200	[thread overview]
Message-ID: <87bladz0ci.fsf@gnu.org> (raw)
In-Reply-To: <397f0533-1be0-aab8-d3e5-fd81d59ae1ce@philipmcgrath.com> (Philip McGrath's message of "Fri, 16 Apr 2021 16:16:04 -0400")

Hi,

Philip McGrath <philip@philipmcgrath.com> skribis:

> On 4/12/21 8:55 AM, Ludovic Courtès wrote:
>> Philip McGrath <philip@philipmcgrath.com> skribis:
>>> Rather than using "config.rktd", an alternative approach would be to
>>> set things up so that `dlopen` would find the foreign libraries,
>>> perhaps via `LD_LIBRARY_PATH`. This has some intriguing possibilities:
>>> I could imagine Guix providing an alternate `dlopen` implementation
>>> that might be useful beyond Racket.
>> What would that alternate dlopen do?  It still has to know where to
>> look
>> for things, somehow.
>
> This was a very fuzzy thought with a lot of reliance on "somehow"—I'm
> not certain it would actually make sense or even be possible—but what
> I had in mind is that `dlopen`, together with the dynamic linker and
> its various configuration and cache files, has some places it will
> search for shared libraries, e.g. in "/lib" and "/usr/lib". If 
> `gnu-build-system` could somehow communicate with those mechanisms,
> then packages doing things like `dlopen("libm.so.6", RTLD_LAZY)`
> wouldn't need to have their source code rewritten to include store
> files: Guix would arrange for `dlopen` to find "libm.so.6" among the
> package inputs. Then Guix would only need to know how to graft
> whatever mechanism it used to configure things for `dlopen`, rather
> than having to worry about all of the strange things compilers might
> do with string literals.

To me, the most practical way it can work is by explicitly replacing
“libfoo.so” with “/gnu/store/…/libfoo.so” in the source.

We could change the ‘dlopen’ implementation altogether so that it (say)
looks for a meta-data file listing search paths, but that’s the kind of
intrusive change I’d rather avoid.

Also, there are cases where we actually want “dynamic binding” (search
for the lib and load it *if* it’s available) rather than “static
binding” (hard-code the name of the library so it’s always found when we
dlopen it).  This is the case for plugins and such.

I guess we need to explore the problem space a bit further.  :-)

Thanks,
Ludo’.




      reply	other threads:[~2021-04-17 10:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16  2:56 [bug#47180] [PATCH] gnu: racket: Don't inject store paths into Racket files Philip McGrath
2021-03-16  5:43 ` Jack Hill
2021-03-16 17:37   ` Philip McGrath
2021-03-17  3:20     ` Jack Hill
2021-03-19  2:34       ` [bug#47180] [PATCH v2] " Philip McGrath
2021-04-12 16:48         ` bug#47180: [PATCH] " Ludovic Courtès
2021-04-10 20:59 ` [bug#47180] " Ludovic Courtès
2021-04-12  3:40   ` Philip McGrath
2021-04-12 12:55     ` Ludovic Courtès
2021-04-12 12:55     ` Ludovic Courtès
2021-04-16 20:16       ` Philip McGrath
2021-04-17 10:12         ` Ludovic Courtès [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=87bladz0ci.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=47180@debbugs.gnu.org \
    --cc=jackhill@trilug.org \
    --cc=philip@philipmcgrath.com \
    /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).