[Nix-dev] replaceStdenv question

Peter Simons simons at cryp.to
Sun Jun 15 00:27:45 CEST 2008


Hi,

I observe some weird behavior with following ~/.nixpkg/config.nix file:

  {
    replaceStdenv = { stdenv, overrideSetup }: stdenv //
    {
      mkDerivation = args: stdenv.mkDerivation (args // { configureFlags = "CFLAGS=-O3"; });
    };
  }

When I install pcre from the unstable packages using "nix-env -i pcre",
the call to configure is exactly as I'd it expect to be:

  configure flags: --disable-dependency-tracking                        \
    --prefix=/nix/store/aaxgzf9qs1m2jwvmnfi88lk97n2ya9nn-pcre-7.4       \
    CFLAGS=-O3

When, I add the following attribute to config.nix

  {
    replaceStdenv = ... ;

    pcre = { unicode = true; };
  }

..., however, my custom CFLAGS disappear:

  configure flags: --disable-dependency-tracking                        \
    --prefix=/nix/store/dx1xhm7z0wip21wiaxfig8zrsqywan85-pcre-7.4       \
    --enable-unicode-properties --enable-shared --disable-static

I would assume that my overridden mkDerivation function evaluates
*after* the pcre builder, so as far as I can tell, configureFlags should
have the value my functions sets. But obviously that is not the case.
Why is that?

Any insight would be appreciated.

Peter


P.S.: On a side note, I tried to build pcre in a chroot environment too,
but my attempts failed because the environment lacks /bin/sh. Curiously
enough, adding /bin to 'build-chroot-dirs' doesn't seem to make a
difference. Is that a known problem?

P.P.S.: Is my impression incorrect that the --from-profile flag to
nix-env doesn't work at all in nix 0.12pre11304? No matter how I try to
use it, I always get an error saying "--from-profile requires an
argument".




More information about the nix-dev mailing list