Re: $PATH and buildworld not getting along

From: Matthew Jacob <mj_at_feral.com>
Date: Fri, 18 Feb 2011 09:30:04 -0800
I generally don't have problems with make in FreeBSD environments, but 
often have tons of problems in others, like OpenSolaris, 
buildroot/busybox, and so on.  To solve this, I clean my environment by 
using this shell script (called cleanenv):

#!/bin/sh
env -i PATH=/usr/bin:/bin TERM=${TERM} P4CONFIG=P4ENV $*
exit $?

or variants on this to run make (as in 'cleanenv make'). This tends to 
try and limit the chaos from environment assumptions.

I don't think it is make's job, or the build tree's job, to enforce this 
cleanliness- mostly because it's really hard to do. It's just a lot 
easier to be a canonical simple 'user' when building.

On 2/18/2011 9:24 AM, Dimitry Andric wrote:
> On 2011-02-18 17:36, Alexander Best wrote:
> ...
>> i'd say no. imo nothing from /usr/local/* should ever be invoked when 
>> compiling
>> a target in /usr/src. everything that's needed is in /usr/* 
>> (excluding local).
>>
>> so $PATH should unconditionally be set to sth. like:
>>
>> PATH=/sbin:/bin:/usr/sbin:/usr/bin;
>>
>> to be sure no tools, libs or whatever from any foreign place such as
>> /usr/local/* get sucked into a build.
>
> I'm not sure if you modified anything in your source tree, but my
> /usr/src/Makefile has this line very close to the start of the file:
>
> PATH=   /sbin:/bin:/usr/sbin:/usr/bin
>
> so what is the problem, exactly? :)
>
> If you are building stuff by hand, you are outside regular territory
> anyway, and you should simply pay attention to your PATH yourself.
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to 
> "freebsd-current-unsubscribe_at_freebsd.org"
Received on Fri Feb 18 2011 - 16:48:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:11 UTC