[Nix-dev] problems installing on a shared system

Eelco Dolstra eelco at cs.uu.nl
Mon Jun 11 13:03:53 CEST 2007


Hi Erick,

Erick Tryzelaar wrote:

> It's been a while since I last played around with nix, so I wanted to
> check it out. I'm having some problems though. First off, the machine
> I'm on has /home/erickt symlinked to another directory. After I built
> nix and tried to install it, nix-update errored out saying that nix
> doesn't support being installed in a path with a symlink. I've manually
> specified the full path, but it would be a lot more handy if I didn't
> have to. 

The reason that it complains about symlinks is that some builders resolve
symlinks, so your package wouldn't work anymore when you point the symlink
somewhere else (or if you distribute the binaries to another machine where the
symlink points somewhere else, or is not a symlink at all).  Sad but true.

There is a workaround though: you can set the environment variable
NIX_IGNORE_SYMLINK_STORE and it won't complain anymore.  See
http://nix.cs.uu.nl/dist/nix/nix-0.11pre8825/manual/#sec-common-env

> The server may change the symlink in the future, and I'd hate
> to have to rebuild nix all over again if that happened.

An alternative to symlinks is to do a bind mount (assuming you're root...).

> Second, after I installed it with the full path, I'm getting this
> strange error. It looks like nix can't find tar, and I can't figure out
> how to install it Any idea what's going on?

[snip]

> building path(s)
> `/home/.expialidocious/erickt/nix/store/6wxcjdb7rb2hpd1jm9f8bpjsq4yq1639-static-tools'
> 
> /home/.expialidocious/erickt/nix/store/ly27nn2avxzkzllr5ggla7ml0camgbai-unpack.sh:
> line 6: ./.tar: Permission denied

This is in pkgs/stdenv/linux/scripts/unpack.sh:

$cp $tar .tar.bz2
$bunzip2 .tar.bz2

$bunzip2 -d < $tarball | ./.tar xvf -

I guess that ./.tar is not executable.  Could you run nix-env with the -K flag
to make it keep the temporary build directory, and then do an ls -la on that
directory to see what the permissions on .tar are?  Also, try adding

  /bin/chmod +x .tar

after the first $bunzip2 line.

Actually, the most likely problem is that tar.bz2 is not executable (since
bunzip2 just propagates the permissions of the input file).  Please check that
the tar.bz2 in your Nixpkgs tree is executable, e.g.,

$ ls -l ~/.nix-defexpr/nixpkgs-unstable/pkgs/stdenv/linux/bootstrap/i686/tar.bz2
-r-xr-xr-x 1 root nixbld 94989 1970-01-01 01:00 .../tar.bz2

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



More information about the nix-dev mailing list