From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Subject: bug#20255: 'search-paths' should respect both user and system profile. Date: Sun, 05 Apr 2015 11:39:03 +0800 Message-ID: <87d23j1bxk.fsf@gmail.com> References: <877ftschjt.fsf@gmail.com> <87fv8fip01.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YebOr-00056A-Op for bug-guix@gnu.org; Sat, 04 Apr 2015 23:39:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YebOo-0003BT-IP for bug-guix@gnu.org; Sat, 04 Apr 2015 23:39:05 -0400 Received: from debbugs.gnu.org ([140.186.70.43]:55224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YebOo-0003BP-FL for bug-guix@gnu.org; Sat, 04 Apr 2015 23:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YebOo-0006Mz-7X for bug-guix@gnu.org; Sat, 04 Apr 2015 23:39:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87fv8fip01.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 20255@debbugs.gnu.org Ludovic Court=C3=A8s writes: > =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > >> Currently, search-paths built only from packages in user's profile. >> As reported by Andy Wingo in #guix, when I have: >> perl installed into system profile >> perl-xml-parser installed into user profile >>=20=20=20 >> guix package --search-paths won't give a hint about PERL5LIB, >> so it's very likely end up with a broken XML::Parser. > > Rather it ends up with no XML::Parser, no? > > That said, I=E2=80=99m not sure how this could be improved. We could har= d-code > lookup in /run/current-system/profile/. OTOH that=E2=80=99s not differen= t from > installing perl in one profile, and perl-xml-parser in another > (arbitrary) profile, which =E2=80=98guix package=E2=80=99 cannot be aware= of. > > WDYT? As 'guix package' is for only one profile, that's fine. Since we can get search-paths from system profile using: guix package -p /run/current-system/profile --search-paths I think the missing is to check whether we are under GuixSD, and then merge those 2 search-paths object in scheme level to get a full search-paths. Or better to generate a 'profile' script for each manifest, and then merged in shell level, so it can work out-of-the-box. How about: - /etc/profile: # configuration for the whole system goes here. # shouldn't refer profile paths. export LANG=3Den_US.utf8 export SSL_CERT_DIR=3D/etc/ssl/certs export LINUX_MODULE_DIRECTORY=3D/run/booted-system/kernel/lib/modules [...] source /run/current-system/profile/etc/profile if [ -f $HOME/.guix-profile/etc/profile ]; then source $HOME/.guix-profile/etc/profile fi # honor setuid-programs export PATH=3D/run/setuid-programs:$PATH - /run/current-system/profile/etc/profile: export PATH=3D/run/current-system/profile/bin:/run/current-system/profi= le/sbin:$PATH export MANPATH=3D/run/current-system/profile/share/man:$PATH [...] =20=20=20=20 - ~/.guix-profile/etc/profile: export PATH=3D~/.guix-profile/bin:~/.guix-profile/sbin:$PATH [...] The idea to generate profile from search-paths is not new, I heard it from you IIRC. I think it's the time to do it.