unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: Roel Janssen <roel@gnu.org>
Cc: 25072@debbugs.gnu.org
Subject: bug#25072: Missing LD_LIBRARY_PATH in (container) environment
Date: Wed, 30 Nov 2016 09:14:47 -0500	[thread overview]
Message-ID: <CAJ=RwfZ=tAfvST22+Omuw0ib47Y7cyAvh1QOCSSiu7SKOQtdsQ@mail.gmail.com> (raw)
In-Reply-To: <rbuoa0xxgyg.fsf@gnu.org>

On Wed, Nov 30, 2016 at 7:58 AM, Roel Janssen <roel@gnu.org> wrote:
> Dear Guix,
>
> When I create a separate environment using:
>
> $ guix environment --container --pure --ad-hoc --network autoconf \
>     automake make libtool pkg-config postgresql valgrind sed coreutils \
>     binutils gcc glibc grep sed glib gawk findutils bash
>
> Then compile my program:
> $ make
> ...
>   CCLD     myprogram
>
>
> Then try to run it:
> $ ./myprogram
>
> It fails with:
> ./myprogram: error while loading shared libraries: libglib-2.0.so.0: \
> cannot open shared object file: No such file or directory
>
> So, it cannot find glib while I had included it in the list of packages
> to make available in the container.
>
> When I set LD_LIBRARY_PATH as:
> export LD_LIBRARY_PATH=$LIBRARY_PATH
>
> The program runs fine.
>
> Therefore, I believe we should set LD_LIBRARY_PATH as well in the
> container.

No, this is undesirable.  Using LD_LIBRARY_PATH is not good practice
because it is just hacking around the real issue: The application was
not compiled correctly.  The solution to your problem is to use the
gcc-toolchain package instead of including binutils, gcc, glibc, etc.
manually.  gcc-toolchain will do the right thing.

Hope this helps,

- Dave

      reply	other threads:[~2016-11-30 14:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 12:58 bug#25072: Missing LD_LIBRARY_PATH in (container) environment Roel Janssen
2016-11-30 14:14 ` Thompson, David [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='CAJ=RwfZ=tAfvST22+Omuw0ib47Y7cyAvh1QOCSSiu7SKOQtdsQ@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=25072@debbugs.gnu.org \
    --cc=roel@gnu.org \
    /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).