From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id GMbqBJaiml+ORQAA0tVLHw (envelope-from ) for ; Thu, 29 Oct 2020 11:08:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id ONa5AJaiml9YRAAAbx9fmQ (envelope-from ) for ; Thu, 29 Oct 2020 11:08:06 +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 538B2940416 for ; Thu, 29 Oct 2020 11:08:04 +0000 (UTC) Received: from localhost ([::1]:45540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kY5mj-0003rl-SU for larch@yhetil.org; Thu, 29 Oct 2020 07:08:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kY5mX-0003rU-Db; Thu, 29 Oct 2020 07:07:50 -0400 Received: from server0.selfhosted.xyz ([217.64.149.7]:38652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kY5mM-0006tQ-PZ; Thu, 29 Oct 2020 07:07:48 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=selfhosted.xyz; s=dkim; t=1603969654; bh=RYP145ogf6u88tBqL1AkEBixInEuLtKzlsTdPLdKeEk=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=yt2uHPuoLji4dMXqfzhQ0X6nvQKrAc+BbyHa13ZggyXTnQUdJaHBQcVbIGfOVzR01 LcCP05UV1bdnfmvTFid3GMSPKjY1/CrZL5OT8ADbXMYpDMLSMqRenwSU+InClYNDSc WkYLg/wfSia6USMcDgeHXn8bAVgZlYfvdHV8qwqQMWJeEgefVcZ+X2ShxTtsExJa0y Dk35cNSfpEDjTjxp08U8KV72NXel+gutckA89o+5w/xpgJEFFncq/P9h/No0uJs4DT IVJm4PJUvrXUb9nNfSK3gJcTs+KPO1jGhjeYcMSaZYG1b8bxAtH1WDTC8F7wRMB9TG k3qYB8Dr2zH7g== X-Fuglu-Suspect: 4e5eef1f951c445f95aa8d021169e1f3 X-Fuglu-Spamstatus: NO Received: from [127.0.0.1] (localhost [127.0.0.1]) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 29 Oct 2020 11:07:28 +0000 From: david larsson To: =?UTF-8?Q?S=C3=A9bastien_Lerique?= Subject: Re: Profile's LD_LIBRARY_PATH by default In-Reply-To: <87d0119whd.fsf@eauchat.org> References: <877dra1mvr.fsf@eauchat.org> <87d0119whd.fsf@eauchat.org> Message-ID: X-Sender: david.larsson@selfhosted.xyz Received-SPF: pass client-ip=217.64.149.7; envelope-from=david.larsson@selfhosted.xyz; helo=server0.selfhosted.xyz X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/29 05:10:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 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, FROM_SUSPICIOUS_NTLD=0.499, PDS_OTHER_BAD_TLD=1.559, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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=pass header.d=selfhosted.xyz header.s=dkim header.b=yt2uHPuo; dmarc=pass (policy=none) header.from=selfhosted.xyz; 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: -1.71 X-TUID: miri4OIQnoNR On 2020-10-29 10:07, Sébastien Lerique wrote: > Hello! > > On 29 Oct 2020 at 10:10, david larsson > wrote: >> On 2020-10-28 13:49, Sébastien Lerique wrote: >>> [snip] >>> While running a racket program which uses OpenCV, I realised 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: cannot >>> open shared object file: No such file or directory) >>> ``` >>> While running >>> ``` >>> env LD_LIBRARY_PATH=/home/sl/.guix-profile/lib/ racket capture.rkt >>> ``` >>> works. >>> (Also, this is the output of `env >>> LD_DEBUG=libs racket capture.rkt`.) >>> Is this normal behaviour, i.e. that the path to dynamic libs >>> installed >>> in my user profile should be manually configured in my shell startup >>> scripts? Should this not be included in >>> `~/.guix-profile/etc/profile`? > >> I wondered the same, and got answer in the IRC #guix that setting >> LD_LIBRARY_PATH is highly discouraged (unless you have a specific and >> good reason to do so in a specific case - never globally). I a good >> explanation >> about it here: >> https://web.archive.org/web/20060719201954/http://www.visi.com/~barr/ldpath.html >> >> A good example of how it can go wrong: >> >> "In its startup script[a program called WidgetMan], it sets >> LD_LIBRARY_PATH to >> point to its copy of Motif so it uses that one when it runs. As it >> happens, >> WidgetMan is designed to launch other programs too. Unfortunately, >> when >> WidgetMan launches other apps, they inherit the LD_LIBRARY_PATH >> setting and some >> Motif based apps now break when run from WidgetMan because WidgetMan's >> Motif is >> incompatible with (but the same library version as) the system Motif >> library. >> Bummer!" > > Yes I see that makes sense. Does this mean that one shouldn't install > libraries in user profiles? Not necessarily - it shouldn't hurt anway IIUC. Though I assume it is more common to install libraries when you use guix environment or guix profile. > > Or maybe that, if I were to package this racket program, then it would > depend on `opencv` and set its required lib paths properly in its > package definition (so work no matter if it's system-wide or in a user > profile)? IIUC, yes, through package inputs and then the build-system usually finds the path for you. > Then, for development, is setting LD_LIBRARY_PATH still the only way > without installing the lib system-wide? It is possibly the easiest way, but perhaps not the guix-iest way. Please someone correct me if Im wrong here: For development you can use guix environment or guix-profile and possibly even grafts if you want to develop against newer versions of opency. Say you want to test updating the opency package in a profile created by guix package -m manifest.scm -p ~/guix-profiles/dev-profile; the new opency version can be grafted onto your racket package X (or all packages in the profile depending on opency) without rebuilding X, by adding "(replacement opency-fixed)" in the opency package definition in the profile manifest. On the next package update for the profile (i.e. guix package -m manifest-with-replacement.scm -p ~/guix-profile/dev-profile) all dependencies of opency would be updated (such as your package X). The "manifest.scm" file is a package module that contains; the definition of opency with "(replacement opency-fixed)", the package definition for "opency-fixed", definition of X, and also any other packages you need to test. see here: https://guix.gnu.org/manual/en/html_node/Security-Updates.html and here: https://guix.gnu.org/manual/en/html_node/Invoking-guix-environment.html > > (that's a lot of questions, apologies!) No problem :-)