[Buildroot] [PATCH] Makefile: unset MAKEFLAGS

Thomas De Schampheleire patrickdepinguin+buildroot at gmail.com
Thu Jul 11 12:08:20 UTC 2013

Hi Yann,

On Thu, Jul 11, 2013 at 2:02 PM, Yann E. MORIN <yann.morin.1998 at free.fr> wrote:
> Thomas, All,
> On Thursday 11 July 2013 13:46:46 Thomas Petazzoni wrote:
>> On Thu, 11 Jul 2013 12:33:42 +0200, Bjørn Forsman wrote:
>> > How about going all the way: clean out the environment completely, and
>> > explicitly add env vars to builders as needed. That would result in a
>> > more deterministic build environment, IMHO.
>> I don't think this works: there are a bunch of environment variables
>> that we accept (to tune the uClibc config file, the Busybox config
>> file, the host gcc to use, etc.). And we also accept the feature that
>> all BR2_<foo> values can be overridden using environment variables. So
>> I don't think wiping out the entire environment is possible. However,
>> we could /maybe/ (if that's possible), wipe out the entire environment
>> *except* the BR2_<foo> variables, and the few other variables that we
>> explicitly accept. But I'm not sure how to achieve that.
> Even that would not work. For example, I have LD_PRELOAD set to tsocksify
> all network connections, without which I could not download anything.
> So, even though LD_PRELOAD looks like a good candidate to dump, it can be
> valid in some cases.
> I believe it is much better that Buildroot chokes on a select list of
> variables, warn about a few others, and accept the rest.

But with this policy, all existing 'unexports' in the Makefile should
be removed, and it's up to the user to fix his stuff.
In corporate environments, for one, this is not always feasible. Many
developers will build with buildroot as part of an overall build
process, and will not know anything about buildroot itself nor its
requirements. So either the overall build process should clear the
user's environment before starting the buildroot build, or buildroot
itself should clean up what it knows is problematic.

Since there already are several variables cleared in that way, I'm
more in favor in going down that path and adding some more troublesome
variables, rather than removing these bits altogether.

More information about the buildroot mailing list