From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 30 09:14:56 2016 Received: (at 25072) by debbugs.gnu.org; 30 Nov 2016 14:14:56 +0000 Received: from localhost ([127.0.0.1]:47092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cC5ex-0007T7-QX for submit@debbugs.gnu.org; Wed, 30 Nov 2016 09:14:55 -0500 Received: from mail-ua0-f176.google.com ([209.85.217.176]:34677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cC5ew-0007St-5R for 25072@debbugs.gnu.org; Wed, 30 Nov 2016 09:14:54 -0500 Received: by mail-ua0-f176.google.com with SMTP id 51so214109299uai.1 for <25072@debbugs.gnu.org>; Wed, 30 Nov 2016 06:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=y955etpbRAQ6aOeOYzjKK3CAVxwgeq51MrMhqi7tlWU=; b=emcTKPedfnNYRFkv1VorTKlU3kHMWgIKipk1kJHMzFtZdAHH/YeUF6kXS3ECWJh+tl iVhzmwkfq4EuNHLdK7DoMr+Mw1wv9xInsvcd46B5O2iBoePenK1o1z0W7Y9taGf7wXj9 kiw986B1U1vx+/qsYN6Wd73XmjKuCAmd5iiC3lGT3JTxGi3nL9ARV9Ng99JvJ+0wn331 jeIFh/n/uIvDFm+NDUwZjdFkCShHc3eFdeU550K3Gf245FscPnuzU2epT5rWGufLq2/f c3VH2hJ69hEyAjCGLPhkQgPrKwKUFF+iY40x48E1epH7FsHEN96+dtYMD32XBt8sTfii caug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=y955etpbRAQ6aOeOYzjKK3CAVxwgeq51MrMhqi7tlWU=; b=a9Y37PD/Fcq/RElRnTrfPbN1EDn5t+0ssgTb7ecF07FcyP0RoZ8MGtzUMdWy66CP9m SBG3ppXfIc+7xHY2864yAyzEVALHC+6QR+0xz/MjIWKUpMLWPMx80BEhQBxeJqlL49kO 04hjFQKIdnv4gih8Pm5sSF/aUklUhqsZFYa1f9ke765oR1Zuugob1cmCj98SXTYibBMW 1ZdRz41ltHr9nwQ1pErBJUf4NsbWtnuFdmUzHvCOcWs/hYyibjykIdcWjHo9vSeFZAXL Gezfx5bDQYFW1FOF97oXrWuUm+gaOm6MhZxjsNgs9+FuyhHD3dQWMvL6F7tixwnF4a6Q YE5g== X-Gm-Message-State: AKaTC00qQdNeMAW4vPAYnFLKc1wYla4m5NNsKzXg/GPyHrC7w1TnSvzTh+0CtIEwZUrGAVLlmy5TU+1ljDreQ9ye X-Received: by 10.176.80.46 with SMTP id b43mr24155001uaa.135.1480515288623; Wed, 30 Nov 2016 06:14:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.41.145 with HTTP; Wed, 30 Nov 2016 06:14:47 -0800 (PST) In-Reply-To: References: From: "Thompson, David" Date: Wed, 30 Nov 2016 09:14:47 -0500 Message-ID: Subject: Re: bug#25072: Missing LD_LIBRARY_PATH in (container) environment To: Roel Janssen Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25072 Cc: 25072@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On Wed, Nov 30, 2016 at 7:58 AM, Roel Janssen 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