[Nix-dev] nix-build error: Use of uninitialized value in concatenation

Eelco Dolstra eelco at cs.uu.nl
Mon Jun 11 13:36:49 CEST 2007


Hi,

Christian Wagner wrote:

> I have previously added a couple of packages in exactly the same way already.
> Now I'm trying to build a simple application in Nix 0.11pre8858(svn) on
> Debian and get the following error (as root):
> 
> # nix-build top-level/all-packages.nix -A mc
> warning:
> `/nix/store/krz5pvfqmc6j0c84kb9zwxz83wqb8nh3-channels/nixpkgs-unstable/pkgs/.nix-build-tmp-derivation'

The problem is that you are running nix-build inside the Nix store (since your
~/.nix-defexpr is a symlink to the unpacked expressions from the channel, which
live in the store).  This causes nix-build to try to create a garbage collector
root inside the store, which isn't allowed (it won't be able to find such roots).

The real problem however is that you shouldn't edit the Nix expressions in the
channel, which are strictly read-only (since they're stored in the Nix store).
They're just a mechanism to get Nix expressions to end-users.  Working on the
channel files is also dangerous, since they could be garbage collected (e.g., if
you do a nix-channel --update followed by nix-collect-garbage).

So developers should do a checkout of the Nixpkgs tree:

$ svn co https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/trunk nixpkgs

and hack on that.  (Or you can grab a Nixpkgs tarball, but a SVN checkout will
make it much easier to contribute changes :-)

However, the error message is awful, so I've just committed a more user-friendly
check:

[root at tyros:/nix/store/arn0240lhzc4fq74s7sgzw4csj4mjahn-channels/nixpkgs-unstable/pkgs]$
nix-build top-level/all-packages.nix -A aterm
error: creating a garbage collector root
(/nix/store/arn0240lhzc4fq74s7sgzw4csj4mjahn-channels/nixpkgs-unstable/pkgs/.nix-build-tmp-derivation)
in the Nix store is forbidden (are you running nix-build inside the store?)

-- 
Eelco Dolstra | http://www.cs.uu.nl/~eelco



More information about the nix-dev mailing list