tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Sanitising make environment in pkgsrc

On Wed, 17 Aug 2011, Greg Troxel wrote:
> Joerg Sonnenberger <> writes:
> > On Tue, Aug 16, 2011 at 04:36:08PM -0500, Tim Zingelman wrote:
> >> In that thread I pointed out that a common solaris boostrap passes
> >> variables in the environment...
> >> 
> >>     env CC=/opt/studio12/SUNWspro/bin/cc \
> >>           SUNWSPROBASE=/opt/studio12/SUNWspro \
> >>           ./bootstrap --abi=64
> >> 
> >> does this patch still allow that (I had hoped to answer that question
> >> myself by testing, but ENOTIME today.)
> >
> > Usage like this is exactly my concern with the wildcard scrub.
> > It's not specific to SunPRO either -- there are a number of other
> > environmental variables people might want to use sanely to affect the
> > build.
> I see your point, but on the other hand one of the core doctrines of
> pkgsrc is repeatable builds.  While this is primarily about not having
> installed packages be picked up as implicit dependencies, I can see the
> point of not having random environment variables in the user's
> environment affect things either.
> Perhaps a solution is to place environment variables in mk.conf, and
> thus control the environment?

Exactly, the best way to deal with an unknown environment is to scrub it
clean that add what's needed/wanted.  This method would be less
problematic than removing random variable environment variables that break
things when we become aware of them.

Also what's needed/wanted (or in the second case what should be removed)
is a vary large set of separate discussions.  As an example of what I mean
while Tim needs SUNWSPROBASE for his setup it could cause problems on
someone else's system, rather than debate whether to remove it from the
environment or not, scrub the environment then Tim is free to add it to


Home | Main Index | Thread Index | Old Index