[Nix-dev] Re: [PATCH 1/2] t/scons

7c6f434c at mail.ru 7c6f434c at mail.ru
Wed Jan 5 16:29:06 CET 2011


> > * Marc's patch updated the installed SCons so that when run it would
> >   automatically read the user's PATH env variable for its internal
> >   path searching.
>Yes. Please note that this patch has been superfluous from the very
>beginning, because SCons doesn't have to be patched to accomplish that.
>Marc has admitted himself that this patch is unnecessary.

Neither does gcc has to be wrapped, technically speaking.

> > I believe that Marc's patch is along the right direction for using
> > SCons in a personal development tree (i.e. outside of a nix
> > derivation) [...]
>
>That may or may not be true, but the fact of the matter is that this
>question is irrelevant in the context of NixOS. The authors of SCons
>have made the conscious decision to ignore the contents of $PATH. It's

The only problem with this statement of fact is a small loss of context. 

SCons explicitly does includes some paths (recommended by FHS) and ignores 
PATH - so we can be sure that it prefers relying on FHS (Filesystem
Hierarchy Standard) rather than relying on PATH. 

Our problem is that NixPkgs cannot use "least modifications" way in some
cases. We have thrown away FHS in the very beginning. In NixOS, we use
/nix/var/nix/profiles/system instead of /usr, we use both profiles/system
and profiles/$USER as /usr/local without making too much of a distinction.
In Nixpkgs, there is nothing that can be considered a replacement for
/usr/. And during builds we pretend that dependencies are everything that 
is installed on the system at all (at least in chroot) and use PATH to 
provide them.

>not our place to revert that decision, because NixOS is a
>*distribution*. We didn't write SCons, we just distribute it. If you

If only it all was true for any distribution. Even ArchLinux sometimes 
patches packages because of relatively minor issues - and they claim a 
policy of not using too much patching... 

>would like to change SCons default behavior, then you are talking to the
>wrong group of people. Instead, you should be talking to the authors of
>SCons.

SCons in Nixpkgs is in a situation where no default behaviour may be 
expressed without further interpretation.

>If you would like SCons to use $PATH to find build tools, then you can
>do that in numerous ways. The documentation recommends adding the lines
>
>  import os
>  env = Environment(ENV = {'PATH' : os.environ['PATH']})
>
>to the SConsfile, which sounds reasonable enough. Furthermore, you are
>absolutely welcome create a patched version of SCons in Nix that behaves
>the way you want it to, but please don't call it "scons". Instead, call
>it "scons-patched" or whatever, so that other users have the chance to
>distinguish your version from the pristine one.

You mean "the most broken on Nixpkgs" as "pristine"?

>Personally, I believe that SCons made a mistake when they provided any
>default search path *at all*. The default environment ought to be empty,
>really. I realize, though, that other people prefer things differently,
>and so I refrain from forcing my preferred view on everyone else.
>Instead, I make the necessary changes in my local nixpkgs tree. I would
>respectfully request that you and Marc and everyone else who wants SCons
>to behave differently than it does to do the same: please make those
>changes in such a way that your preferred solution isn't forced on me.

So, what you want is that Scons expression has a build-time parameter 
for default search path which can be trivially overriden to be empty?

And you haven't given an example where you need scons to ignore PATH,
unfortunately.






More information about the nix-dev mailing list