From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: Re: [PATCH 0/2] Improve search path handling? Date: Sat, 28 Feb 2015 12:31:59 -0500 Message-ID: <87wq326iy8.fsf@fsf.org> References: <87ioes9hyi.fsf@fsf.org> <878ufmadyq.fsf@fsf.org> <87bnkfpcem.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]:52804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRlFD-0005dO-3h for guix-devel@gnu.org; Sat, 28 Feb 2015 12:32:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRlFB-0000Mw-0g for guix-devel@gnu.org; Sat, 28 Feb 2015 12:32:03 -0500 In-Reply-To: <87bnkfpcem.fsf@gnu.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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s writes: > David Thompson skribis: > >> 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/dwjlh4id7ksdjiigfddw5= dq617bajxxm-ruby-2.2.0/bin:/gnu/store/cdgpj8djhvfwsysa0bklx7l17bkjgnr6-git-= 2.2.1/bin:/gnu/store/paknwghpb3530zpw6kjzygcwyi4v2b7a-tar-1.28/bin:/gnu/sto= re/gzfwcp3rx6vx9yhfn258pqravsihkhgk-gzip-1.6/bin:/gnu/store/v47nyd4lmk6079l= ahhn7qjg1x30sq6r0-bzip2-1.0.6/bin:/gnu/store/45cspsg2pi0d9n1x62r85iaf6118sc= nr-xz-5.0.4/bin:/gnu/store/b1hflfspi7d8y8d6xxsm1hpmh1s6aki9-file-5.22/bin:/= gnu/store/5x6ypvynrc4y3dnynqj948c6xdhpagv8-diffutils-3.3/bin:/gnu/store/q1f= k0vrzdz7vzawq32k2slpgxhrlq0b3-patch-2.7.1/bin:/gnu/store/b1msmz538khma08mg8= dm6lw0vkjilbjd-sed-4.2.2/bin:/gnu/store/izbkwxcgikxlinj78lh1934f39n98mn2-fi= ndutils-4.4.2/bin:/gnu/store/jyib7byzyincn3q7mkkrm9q5wfbg105z-gawk-4.1.1/bi= n:/gnu/store/s7jlv9f6v23h17bnkbvcvqk1qnhg40pb-grep-2.21/bin:/gnu/store/vgjl= zkg84jpzvz227ac5aygqx25bb6wh-coreutils-8.23/bin:/gnu/store/dvlp6nk7avz40358= 5k9xndl6zqy6vwmj-make-4.1/bin:/gnu/store/nx4zd42igyb7ghmv4mxv6ncg8wr7ypa1-b= ash-4.3.33/bin:/gnu/store/4x401cpj6nmddji54l99cl89ggn5pgib-ld-wrapper-0/bin= :/gnu/store/h7lqkyf4sc37lkbmnph9kmmsfqr3xk5n-binutils-2.25/bin:/gnu/store/1= 6j0v2km34g471cs77gxlq0n0a956cw1-gcc-4.8.4/bin:/gnu/store/q2mm1wv4a3g0b29yv0= rjybfjh8kr07qi-glibc-2.20/bin:/gnu/store/q2mm1wv4a3g0b29yv0rjybfjh8kr07qi-g= libc-2.20/sbin' >> environment variable `PATH' unset >> >> I think this can be remedied with a bit more work. > > I think that=E2=80=99s because build systems are still passed a non-merged > list, no? Yes, I think so. I think I have resolved this, but it's a "rebuild the world" change so I don't yet know if it works. Would it be possible to add a 'wip-search-paths' branch for Hydra to build? I'm giving it a shot on my laptop, but if my code fails I won't be very motivated to toture my computer with another full rebuild. Also, since I posted the original patch set, I have refactored the code a bit, resulting in this new procedure in (gnu packages): (define* (packages->search-path-specifications packages #:key (native? = #t)) "Deduplicate and merge search path specifications in PACKAGES, a list= of package objects. When NATIVE? is '#t', return native search path specifications, or standard search path specifications otherwise." (merge-search-path-specifications (append %base-search-path-specifications (delete-duplicates (append-map (if native? package-native-search-paths package-search-paths) packages))))) It factorizes the pattern used in the 'guix package' and 'guix environment' commands, as well as the 'bag->derivation' and 'bag->cross-derivation' procedures. --=20 David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate