On 16 September 2013 13:26, Eelco Dolstra <[email protected]> wrote:
> Hi,
>
> On 15/09/13 14:30, Bjørn Forsman wrote:
>
>> Why doesn't a custom configurePhase (or buildPhase, installPhase etc.)
>> work when run from nix-shell? In nix-shell, all phases seem to be the
>> default, even if the derivation has customized some of them.
>
> That's because you're defining configurePhase as an environment variable, so 
> you
> need to run it as "$configurePhase" instead of "configurePhase".
>
> FYI, stdenv's setup.sh runs a phase as follows:
>
>   eval "${!curPhase:-$curPhase}"
>
> I.e. it evaluates the contents of the environment variable named after the 
> phase
> if defined, and otherwise the function named after the phase.

Thanks!

I was going to say "we must update the wiki[1]", but then I got an idea.

Why don't we make those default functions in stdenv figure out whether
to call the custom configure/build/installPhase snippets themselves?

Because as of now, "single stepping" through a build, and ensuring
custom phases are used, is a bit cumbersome:

curPhase=unpackPhase
eval "${!curPhase:-$curPhase}"

curPhase=configurePhase
eval "${!curPhase:-$curPhase}"
[...]

[1] https://nixos.org/wiki/Create_and_debug_nix_packages

Best regards,
Bjørn Forsman
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to