[Nix-dev] Toward a Purer stdenv
Shea Levy
shea at shealevy.com
Wed Aug 17 21:37:32 CEST 2011
Hello,
I've been thinking about creating a nixpkgs branch to find and eliminate
some of the remaining impurities in the Linux stdenv. Before I get
started, I wanted to poll the list with a few questions that will shape
how I go about things.
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.
2. What kind of testing should I set up to see that my changes actually
remove impurities?
3. When might it be desirable to have impurities? I can think of three
cases: When knowledge of the performance of the system could potentially
speed up a build (e.g. knowing how many cores the CPU has for parallel
building), when knowledge of the performance of the system is necessary
for a test (e.g. checking that running a certain tool completes its task
in the right amount of time), and when a build would otherwise fail. My
current view is that the first two cases are OK as long as the
impurities (preferably provably) don't affect the output (think
unsafePerformIO), and that the for the third case we should attempt to
fix the build system in question if possible and should explicitly
include whatever system information is being accessed as a dependency if
not. Ideally our build system would give us ways to purposely allow
impurities when they are of the first two types, such as the
enableParallelBuilding variable the generic builder currently recognizes.
Cheers,
Shea Levy
More information about the nix-dev
mailing list