[Nix-dev] A bug in stdenv/generic/setup.sh

Eelco Dolstra e.dolstra at tudelft.nl
Fri Nov 14 11:22:03 CET 2008


Hi,

Jeevakan Suresh wrote:

> I was trying to add django to nix, and ran into a problem in the
> 'generic' setup.sh
> 
> After we unpack the source, we try to make them writable - this doesn't
> quote the '$sourceRoot' variable. Which means any files with spaces
> break the build.

I fear that there are lots of places in stdenv where we don't handle filenames
with spaces properly.  The Unix shell is kind of broken that way :-)

> The patch to fix this is straightforward (included below) however the
> effects of such a change is far-reaching - it would cause *everything*
> to rebuild (which I think is bad).

Thanks, I've committed this in the stdenv-branch
(https://svn.nixos.org/repos/nix/nixpkgs/branches/stdenv-updates), which is the
place where we collect these far-reaching changes so that we can merge them into
the trunk periodically.

However, it is possible to use a new version of the stdenv setup script for
specific packages by saying

  myPackage = import ... {
    stdenv = overrideSetup stdenv ../path/to/new/setup/script;
  };

in all-packages.nix.  And actually there is a stdenvNew in all-packages.nix that
uses stdenv/generic/setup-new.sh, which is basically a branch of setup.sh
containing changes like yours.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list