[Nix-dev] $out in configureFlags is not expanded

Peter Simons simons at cryp.to
Tue May 21 15:12:01 CEST 2013


Hi Lluís,

 > Mh I think the manual mainly helps to tell people "please read the
 > manual", when they ask the question. ;)

yes, that is true. We cannot expect that people will read the entire
user manual before they begin to hack Nix expressions.

However, Google's web crawler does read those manuals, so adding
information in there can be very beneficial even for those who don't
read the documents in their entirety. Searching for "nix configureflags
$out" will already produce a helpful result because of this thread.


 > Are these real cases? :)

Well, no, I made them up to illustrate the problems we might run into.
It was easy to find a real case in Nixpkgs, though:

  configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts";

That's from pkgs/servers/x11/xorg/default.nix. What I don't like about
this kind of issue is that we cannot easily detect it at build time. An
attempt to eval this flag will succeed (because the error occurs in a
sub-shell, so 'set -e' doesn't catch it), so we'll probably end up
building binaries with a broken search path.

Take care,
Peter



More information about the nix-dev mailing list