From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CL7aLFiWml/rWgAA0tVLHw (envelope-from ) for ; Thu, 29 Oct 2020 10:15:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mGipKFiWml9aTgAAB5/wlQ (envelope-from ) for ; Thu, 29 Oct 2020 10:15:52 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 283C79403CC for ; Thu, 29 Oct 2020 10:15:52 +0000 (UTC) Received: from localhost ([::1]:51612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kY4yE-00007U-F1 for larch@yhetil.org; Thu, 29 Oct 2020 06:15:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kY4q7-0005PC-BF; Thu, 29 Oct 2020 06:07:27 -0400 Received: from elegua.eauchat.org ([91.224.149.118]:37766 helo=eauchat.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kY4q3-0001SO-8P; Thu, 29 Oct 2020 06:07:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eauchat.org; s=mail; t=1603966038; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vuZVhwDnDaz5vo34qqqDJuaTF00tQMR2bpw9l1GLIqk=; b=p2kG2FlqtmdeJaKwR1i5gj+r/jtezVOepl8Bs4sBYnwTMl7z3nQT7QfszOd969YYx+uG49 ppNcyJZ5tOPqWznLRxxHDMUkiTMklkUq0Pyd69UMA8B8jJdRKcPirRnYYN1EQK77mGH9AW jjba4VxJMC467IEohEBcaNkGypozBfw= References: <877dra1mvr.fsf@eauchat.org> From: =?utf-8?Q?S=C3=A9bastien?= Lerique To: david larsson Subject: Re: Profile's LD_LIBRARY_PATH by default In-reply-to: Message-ID: <87d0119whd.fsf@eauchat.org> Date: Thu, 29 Oct 2020 11:07:10 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=91.224.149.118; envelope-from=sl@eauchat.org; helo=eauchat.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/29 06:07:18 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 29 Oct 2020 06:15:31 -0400 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org, Help-Guix Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=eauchat.org header.s=mail header.b=p2kG2Flq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=eauchat.org (policy=none); spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: KxL4B4fpR54E Hello! On 29 Oct 2020 at 10:10, david larsson=20 wrote: > On 2020-10-28 13:49, S=C3=A9bastien Lerique wrote: >> [snip] >> While running a racket program which uses OpenCV, I realised=20 >> that my >> LD_LIBRARY_PATH does not contain my user's profile libs. I have >> `libopencv*.so` in `~/.guix-profile/lib/`, but running a racket >> program which needs that fails: >> ``` >> $ racket capture.rkt >> ffi-lib: couldn't open "libopencv_core.so" (libopencv_core.so:=20 >> cannot >> open shared object file: No such file or directory) >> ``` >> While running >> ``` >> env LD_LIBRARY_PATH=3D/home/sl/.guix-profile/lib/ racket=20 >> capture.rkt >> ``` >> works. >> (Also, this is the output of `env >> LD_DEBUG=3Dlibs racket capture.rkt`.) >> Is this normal behaviour, i.e. that the path to dynamic libs=20 >> installed >> in my user profile should be manually configured in my shell=20 >> startup >> scripts? Should this not be included in=20 >> `~/.guix-profile/etc/profile`? > I wondered the same, and got answer in the IRC #guix that=20 > setting > LD_LIBRARY_PATH is highly discouraged (unless you have a=20 > specific and > good reason to do so in a specific case - never globally). I a=20 > good explanation > about it here: > https://web.archive.org/web/20060719201954/http://www.visi.com/~barr/ldpa= th.html > > A good example of how it can go wrong: > > "In its startup script[a program called WidgetMan], it sets=20 > LD_LIBRARY_PATH to > point to its copy of Motif so it uses that one when it runs. As=20 > it happens, > WidgetMan is designed to launch other programs too.=20 > Unfortunately, when > WidgetMan launches other apps, they inherit the LD_LIBRARY_PATH=20 > setting and some > Motif based apps now break when run from WidgetMan because=20 > WidgetMan's Motif is > incompatible with (but the same library version as) the system=20 > Motif library. > Bummer!" Yes I see that makes sense. Does this mean that one shouldn't=20 install libraries in user profiles? Or maybe that, if I were to package this racket program, then it=20 would depend on `opencv` and set its required lib paths properly=20 in its package definition (so work no matter if it's system-wide=20 or in a user profile)? Then, for development, is setting LD_LIBRARY_PATH still the only=20 way without installing the lib system-wide? (that's a lot of questions, apologies!)