[Nix-dev] How do you work on big packages?

zimbatm zimbatm at zimbatm.com
Sat Mar 18 23:24:36 CET 2017


Another option is to add a powerful remote builder on the local network. It
doesn't beat incremental rebuilds but helps with having the laptop taking
off and trying to burn my legs. Old desktop machines from ebay are not too
expensive and still beat the laptop capacity.

On Sat, 18 Mar 2017 at 02:19 Tuomas Tynkkynen <tuomas.tynkkynen at iki.fi>
wrote:

> A while ago I wrote a wrapper around nix-shell that helps with running
> the build steps in correct manner and order (among with other niceties
> like automatically creating a temporary build directory and making
> $out point to a path in /tmp/):
> https://github.com/dezgeg/nix-debug-shell
>
> I mainly wrote it for debugging build steps for existing packages, but
> I guess the same ideas/code could be used for local development as
> well.
>
> It is rigorously undocumented, so here's a short primer: in a nixpkgs
> tree, run /path/to/nix-debug-shell -A hello. That places you under
> /tmp/nds-build-hello/hello-2.10 with the sources unpacked. Run
> 'nd-step' as many times you want to step through the build phases
> (it's named after the 'step' command in GDB). When installPhase is
> done, it installs to /tmp/, e.g. /tmp/nds-install-hello/bin/hello.
>
> Hope anyone finds this useful.
>
> 2017-03-17 21:26 GMT+02:00 Profpatsch <mail at profpatsch.de>:
> > On 17-03-17 06:04pm, Volth wrote:
> >> "nix-shell" would be a super option here if it could handle
> >> "installPhase" (this seems easy to fix) and .nix files less trivial
> >> than "hello.nix" (this seems not easy to fix; for example "nix-shell
> >> '<nixpkgs>' -A linux_4_4" has no "configurePhase", and there are
> >> similar problems with almost every of the big projects; nix-shell
> >> launches "make" when "nix-build" launches "cmake" or vice-versa, etc)
> >
> > That’s a pretty common stumbling block.
> >
> > If someone defines his own `installPhase` for example,
> > the `installPhase` shell function is just the standard
> > stdenv `installPhase`. What you want to call is rather
> > the contents of `$installPhase` (the variable), since
> > that contains the phase you defined in `mkDerivation`.
> >
> > nix-shell
> > $ unpackPhase
> > unpacking …
> > $ configurePhase
> > configuring …
> > $ buildPhase
> > …
> > $ $installPhase
> > running your installPhase
> >
> >
> > There is not much abstraction. Every nix attribute within
> > `derivation` (and by extension `mkDerivation`) will end up
> > as a bash shell variable in your shell (and your build env).
> >
> > --
> > Proudly written in Mutt with Vim on NixOS.
> > Q: Why is this email five sentences or less?
> > A: http://five.sentenc.es
> > May take up to five days to read your message. If it’s urgent, call me.
> > _______________________________________________
> > nix-dev mailing list
> > nix-dev at lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170318/a9d072d2/attachment.html>


More information about the nix-dev mailing list