tech-pkg archive

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

Re: PKGSRC_SETENV?= ${SETENV} -i



Amitai Schlair <schmonz%schmonz.com@localhost> writes:

> On Tue, Jun 4, 2013 at 4:47 PM, Aleksej Saushev <asau%inbox.ru@localhost> 
> wrote:
>
>> There exists a lot of use cases where environment variables simplify
>> interaction with pkgsrc a lot. Clearing the whole environment makes all
>> of those much harder for a minimal gain. Blindly stripping environment
>> under pretense that users put garbage into there is wrong way to address
>> the real problem which, I think, is unsetting a couple of variables
>> that select cross-compilation mode in GNU configure.
>
> 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? Unless pkgsrc becomes
operating system on its own it cannot isolate from kernel, libc,
compilers (at least some of them). Buildlink and wrappers operate
under particular assumptions of reasonable behaviour of build system,
the latter is usually reasonable enough to let them work. Everything
is fine. If you need more, you need clean environment (chroot, jail,
zone, virtual or real machine depending on what you want exactly).

> As users of pkgsrc, we can't always be sure what effect our
> environment settings may have on builds. So I don't see how we can
> reasonably make ourselves responsible for not screwing it up. Perhaps
> there are environment variables that a user really wants to pass
> through. If it turns out that real people have real problems with
> this, we can easily make it configurable. In either case, we finally
> have the right default.

Above you make assumptions as if our users set environment variables
so as to penetrate pkgsrc protection and cause damage. I don't quite
understand it. Users don't control autoconf cache from their .profile
usually, and if they do, they know what they are doing.
I don't understand why you treat pkgsrc user as some kind of adversary.
You cannot be sure that /usr/bin/cc isn't specially crafted binary that
unwraps after pkgsrc wrappers. Do you really want to address this issue??

Environment variables are useful tool, and nobody uses them blindly
without any reason. If pkgsrc user really wants "extra clean" build,
he is capable of running bmake inside "env -i". I don't see reason to
introduce this sort of cleanup at all. If anything, it should be
additional wrapper around bmake, say, "pkgmake", that does
"env -i PATH=... bmake". Doing otherwise breaks sane and useful
use cases.


-- 
BECHA...
   CKOPO CE3OH...



Home | Main Index | Thread Index | Old Index