tech-pkg archive

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

Re: PKGSRC_SETENV?= ${SETENV} -i



On Tue, Jun 4, 2013 at 6:47 PM, Aleksej Saushev <asau%inbox.ru@localhost> wrote:

> Amitai Schlair <schmonz%schmonz.com@localhost> writes:
>
>> I don't agree. pkgsrc has a goal to isolate builds from their
>> surroundings, and goes to a great deal of trouble to do so. For a
>> system with buildlink and the wrappers, it's internally consistent to
>> clear environment variables as well.
>
> Isolation from which surroundings exactly?

As many as reasonably possible. The purpose of this isolation is not
for its own sake, but for the reproducibility of builds, which depends
on forcing settings that influence builds to be made explicit.

Buildlink was a lot of work, but it goes a long way toward preventing
an installed library on my system from getting linked into the build
unless I asked it to, so we decided it was reasonable to have. The
wrappers were a lot of work, but they go a long way toward preventing
toolchain differences from breaking builds (or complicating individual
packages), so we decided they were reasonable to have. Building with
environment variables cleared is a lot less work, and it goes a long
way toward preventing user preferences from affecting builds by
mistake.

We provide ways for users to explicitly specify intent. A single
environment variable may have been set with pkgsrc-specific intent,
but environment variables as a whole are not, and therefore the tool
is poorly suited to the purpose. Everything in my /etc/mk.conf is
there because I put it there with explicit intent to influence pkgsrc.
I can't say the same for everything set in my user environment, and I
don't think any typical user can, or should have to.

This change breaks backward compatibility with certain kinds of
settings, but almost all of them will be settings better expressed
some other way. And should it prove necessary to allow users to
configure environment variables they want passed through to builds,
that counts as explicit intent in my book. If that feature is actually
needed, I'd be happy to see it added.


Home | Main Index | Thread Index | Old Index