unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: "Marek Paśnikowski" <marek@marekpasnikowski.pl>
Cc: help-guix@gnu.org
Subject: Re: How do I use wrap-ruby-program to make curl findable in a Ruby package?
Date: Wed, 07 Feb 2024 00:28:32 +1100	[thread overview]
Message-ID: <87wmrhhgcf.fsf@zancanaro.id.au> (raw)
In-Reply-To: <4857152.LvFx2qVVIh@akashi> ("Marek Paśnikowski"'s message of "Tue, 06 Feb 2024 13:42:43 +0100")

Hi Marek,

On Tue, Feb 06 2024, Marek Paśnikowski wrote:
> 06.02.2024 13:20:52 CET Carlo Zancanaro:
>> I'm glad you got something working. Using wrap-program like this will
>> likely work, but with the downside that LD_LIBRARY_PATH will also be
>> inherited by any child processes. This might be fine for ruby-nano-bots,
>> but this has caused me serious compatibility problems in the past.
>
> If my logic is correct, this should be mitigated somewhat by placing the
> needed library path at the end of the $LD_LIBRARY_PATH ? Which is why I opted
> for the ~suffix~ argument in the ~wrap-program~ .

The problems I have had in the past was when spawning another program,
which doesn't want LD_LIBRARY_PATH set at all. Doing so caused
completely incorrect library versions to be loaded for child processes,
because the environment variable was inherited by all child processes.

I ended up having to modify the places where those child processes were
spawned to clear LD_LIBRARY_PATH before spawning.

>> Usually, I prefer to store a reference to the precise library in the
>> store, rather than setting LD_LIBRARY_PATH. I'm not really sure how to
>> do that in your case, because I'm not familiar with ruby-nano-bots or
>> any of its dependencies.
>
> I believe this exact behaviour is achieved by ~(search-input-file inputs "lib/
> libcurl.so")~ . When I first attempted to build the ~wrap-program~ call I had 
> a nesting error which explicitly showed that "/gnu/store/hash-curl/lib" is of 
> unexpected type. Am I wrong?

No, sorry. You are using a precise store reference in LD_LIBRARY_PATH,
that's fine. I was more saying as an alternative to LD_LIBRARY_PATH,
it's nicer to patch the program itself to load a specific library. That
is, patch ruby-nano-bots (or its relevant dependency) during the Guix
build so it's dlopening the specific library in the store.

Carlo


      reply	other threads:[~2024-02-06 13:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05  9:39 How do I use wrap-ruby-program to make curl findable in a Ruby package? Marek Paśnikowski
2024-02-05 20:35 ` Marek Paśnikowski
2024-02-06 12:20   ` Carlo Zancanaro
2024-02-06 12:42     ` Marek Paśnikowski
2024-02-06 13:28       ` Carlo Zancanaro [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=87wmrhhgcf.fsf@zancanaro.id.au \
    --to=carlo@zancanaro.id.au \
    --cc=help-guix@gnu.org \
    --cc=marek@marekpasnikowski.pl \
    /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.
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).