[Nix-dev] Patching uname in stdenv?

Lluís Batlle i Rossell viriketo at gmail.com
Wed Aug 17 12:47:18 CEST 2011


On Wed, Aug 17, 2011 at 12:33:37PM +0200, Marco Maggesi wrote:
> 
> On Aug 17, 2011, at 11: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.
> > 
> > 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.
> 
> Just for the record, it happens that I rely on uname -r "impurity" in some build scripts that generated checkpointed binaries with BLCR.
> 
> The point is that these scripts depend on the version of the running kernel.
> Also they do work on Linux in general, not necessarily on NixOS, and they need to be re-run each time the kernel is updated.

How can it be? I assume you mean blcr built from nixpkgs.

BLCR should fail to work in kernels older to the kernelHeaders in nixpkgs. And
the kernelHeaders in nixpkgs should be the only determinant of what kernels blcr
can work on.



More information about the nix-dev mailing list