From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: Re: [PATCH 0/2] Improve search path handling? Date: Tue, 24 Feb 2015 22:04:45 -0500 Message-ID: <878ufmadyq.fsf@fsf.org> References: <87ioes9hyi.fsf@fsf.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQSHK-00070b-4i for guix-devel@gnu.org; Tue, 24 Feb 2015 22:04:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQSHI-00077P-P0 for guix-devel@gnu.org; Tue, 24 Feb 2015 22:04:50 -0500 Received: from mail.fsf.org ([208.118.235.13]:58564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQSHI-00077L-Mk for guix-devel@gnu.org; Tue, 24 Feb 2015 22:04:48 -0500 Received: from 209-6-40-86.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.40.86]:43549 helo=izanagi) by mail.fsf.org with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1YQSHH-00074c-Vc for guix-devel@gnu.org; Tue, 24 Feb 2015 22:04:48 -0500 In-Reply-To: <87ioes9hyi.fsf@fsf.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org David Thompson writes: > While hacking on Ruby stuff, I noticed that executable files in Ruby > gems aren't installed in 'bin', but rather 'lib/ruby/gems/2.2.0/bin'. > In order to make these executables "just work", I decided to add a > search path specification for $PATH to the ruby package. That's when I > noticed an issue: 'guix package --search-paths' would have me clobber > the $PATH I had already configured to use my profile. > > export PATH=3D"/home/dave/.guix-profile/lib/ruby/gems/2.2.0/bin" > > To solve this, two things need to happen: A default $PATH with 'bin' and > 'sbin' needs to be included, and search path specifications that have > the same variable name need to be merged. > > The merge is necessary to avoid a situation like this: > > export PATH=3D"/home/dave/.guix-profile/bin:/home/dave/.guix-profile/= sbin" > export PATH=3D"/home/dave/.guix-profile/lib/ruby/gems/2.2.0/bin" > > I also tweaked 'guix environment' to use the base search paths, which it > was already doing, but via a hardcoded search path specification. > > Or maybe this is all silly and I'm doing it wrong! You decide! Found one big issue with adding a $PATH search path specification to a package: It messes up the 'set-paths' phase of 'gnu-build-system'. $PATH ends up being unset! environment variable `PATH' set to `/gnu/store/dwjlh4id7ksdjiigfddw5dq6= 17bajxxm-ruby-2.2.0/bin:/gnu/store/cdgpj8djhvfwsysa0bklx7l17bkjgnr6-git-2.2= .1/bin:/gnu/store/paknwghpb3530zpw6kjzygcwyi4v2b7a-tar-1.28/bin:/gnu/store/= gzfwcp3rx6vx9yhfn258pqravsihkhgk-gzip-1.6/bin:/gnu/store/v47nyd4lmk6079lahh= n7qjg1x30sq6r0-bzip2-1.0.6/bin:/gnu/store/45cspsg2pi0d9n1x62r85iaf6118scnr-= xz-5.0.4/bin:/gnu/store/b1hflfspi7d8y8d6xxsm1hpmh1s6aki9-file-5.22/bin:/gnu= /store/5x6ypvynrc4y3dnynqj948c6xdhpagv8-diffutils-3.3/bin:/gnu/store/q1fk0v= rzdz7vzawq32k2slpgxhrlq0b3-patch-2.7.1/bin:/gnu/store/b1msmz538khma08mg8dm6= lw0vkjilbjd-sed-4.2.2/bin:/gnu/store/izbkwxcgikxlinj78lh1934f39n98mn2-findu= tils-4.4.2/bin:/gnu/store/jyib7byzyincn3q7mkkrm9q5wfbg105z-gawk-4.1.1/bin:/= gnu/store/s7jlv9f6v23h17bnkbvcvqk1qnhg40pb-grep-2.21/bin:/gnu/store/vgjlzkg= 84jpzvz227ac5aygqx25bb6wh-coreutils-8.23/bin:/gnu/store/dvlp6nk7avz403585k9= xndl6zqy6vwmj-make-4.1/bin:/gnu/store/nx4zd42igyb7ghmv4mxv6ncg8wr7ypa1-bash= -4.3.33/bin:/gnu/store/4x401cpj6nmddji54l99cl89ggn5pgib-ld-wrapper-0/bin:/g= nu/store/h7lqkyf4sc37lkbmnph9kmmsfqr3xk5n-binutils-2.25/bin:/gnu/store/16j0= v2km34g471cs77gxlq0n0a956cw1-gcc-4.8.4/bin:/gnu/store/q2mm1wv4a3g0b29yv0rjy= bfjh8kr07qi-glibc-2.20/bin:/gnu/store/q2mm1wv4a3g0b29yv0rjybfjh8kr07qi-glib= c-2.20/sbin' environment variable `PATH' unset I think this can be remedied with a bit more work. --=20 David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate