[Nix-dev] Ideas for systematically avoiding unwanted runtime dependencies

Rok Garbas rok at garbas.si
Thu Aug 27 05:27:20 CEST 2015


Quoting Kosyrev Serge (2015-08-27 00:26:46)
> Daniel Peebles <pumpkingod at gmail.com> writes:
> > Regardless of specifics, individual packages can
> > usually be fixed to reduce their runtime footprint, but I'm looking
> > for ideas for how to do so in a systematic manner, so we don't just
> > notice these things by accident and fix them one by one. Does anyone
> > have any thoughts?
> 
> Instead of practical solutions I'm going to provide some serious handwaving,
> but here it goes, for what it's worth.
> 
> One way would be to make the problem observable.
> 
> That is -- figure out a way to make a visualization of the dep graph
> fancy enough, that the unnatural deps are seen right away.
> 
> ..and make it easy enough to use it becomes a common tool.
> 

I was thinking about something similar. ncdu[1] is a nice console program that
can help drill down the size. i wrote a quick python script[2] to convert from
nix-store -q -tree format to ncdu format.


    % nix-env -iA nixpkgs.ncdu
    % curl https://gist.githubusercontent.com/garbas/453de961cf37131a7dec/raw/683969e1c8ee402a4091fb61c2e71778ca788d3d/nix2ncdu.py > nix2ncdu.py
    % nix-store --query --tree `realpath PATH` | grep -v "\[...\]" | python nix2ncdu.py | ncdu -f-

where PATH is path of /nix/store folder you wish to inspect.


[1] http://dev.yorhel.nl/ncdu/man
[2] https://gist.github.com/garbas/453de961cf37131a7dec

--
Rok Garbas - http://www.garbas.si
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150827/6cfb6f0e/attachment-0001.bin 


More information about the nix-dev mailing list