From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: [PATCH 0/2] Improve search path handling? Date: Mon, 23 Feb 2015 21:11:33 -0500 Message-ID: <87ioes9hyi.fsf@fsf.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ4yF-0002jE-Ks for guix-devel@gnu.org; Mon, 23 Feb 2015 21:11:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQ4yE-0005oQ-I4 for guix-devel@gnu.org; Mon, 23 Feb 2015 21:11:35 -0500 Received: from mail.fsf.org ([208.118.235.13]:55276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ4yE-0005oM-El for guix-devel@gnu.org; Mon, 23 Feb 2015 21:11:34 -0500 Received: from 209-6-40-86.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.40.86]:39876 helo=izanagi) by mail.fsf.org with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1YQ4yD-0004aR-Sa for guix-devel@gnu.org; Mon, 23 Feb 2015 21:11:34 -0500 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 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="/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="/home/dave/.guix-profile/bin:/home/dave/.guix-profile/sbin" export PATH="/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! Thanks in advance for the patch review. -- David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate