[Nix-dev] Patching uname in stdenv?

Shea Levy shea at shealevy.com
Wed Aug 17 16:46:18 CEST 2011


On 08/17/2011 05:46 AM, Eelco Dolstra wrote:
> Hi,
>
> On 08/17/2011 05:03 AM, shea at shealevy.com wrote:
>
>> What would people think of a patch that made stdenv's uname return the
>> same value on every linux?
>
> I assume you're referring to the kernel version returned by ‘uname -r’.
>
> Since ‘uname’ is also used outside of builders, this is not a good 
> idea — it would change the behaviour that users expect from it.
I can think of two ways off the top of my head to localize it to builds: 
Have it check for an env var that stdenv sets, or leave the coreutils 
version alone and put the patched version directly into stdenv's $out 
(though I may be misunderstanding how name collisions are resolved, and 
this would be a problem for anyone with stdenv in their environment).

>
> BTW, the kernel version does matter sometimes, for instance, APR 
> (IIRC) at compile-time decides whether to use the accept4() system 
> call based on the kernel version of the build system.  So if you try 
> to run the resulting library on an older kernel, it doesn't work.  
> Arguably the kernel version should be part of the "system" value, but 
> that would be too painful.
>
Why wouldn't just depending on the kernel headers be enough here? 
Shouldn't that be how packages determine the kernel API anyway?



More information about the nix-dev mailing list