[Nix-dev] Re: Toward a Purer stdenv

Ludovic Courtès ludo at gnu.org
Sun Aug 21 12:03:04 CEST 2011


Hi,

Shea Levy <shea at shealevy.com> skribis:

> 1. What impurities does the current stdenv have? I can think of three
> off of the top of my head: timestamps in files, kernel version
> (e.g. via uname), and /bin/sh.

There’s uname(2), getrlimit(2), gettimeofday(2), getpid(2), /proc, /sys,
the ‘cpuid’ instruction, etc.

Fortunately few of these actually lead to non-deterministic or
kernel-dependent builds in practice (ISTR that one of Eelco’s early
papers mentioned this.)  There are a few broken build systems that
depend on ‘uname -r’, as was noted earlier, but hey, they’re broken
anyway.  ;-)

And then there’s software like GMP, which uses the ‘cpuid’ instruction
at configure-time to determine the exact CPU available, which can cause
problems when distributing pre-compiled binaries.  Fortunately, GMP has
a configure-time option to disable this behavior.  I think few other
pieces of software use ‘cpuid’, and when they do, there’s probably a
similar way to disable it.

Thanks,
Ludo’.




More information about the nix-dev mailing list