[Nix-dev] Seemingly inexplicable proliferation of gcc/glibc runtimes

Guillaume Maudoux (Layus) layus.on at gmail.com
Thu Jul 28 17:22:54 CEST 2016



Le 27/07/16 à 19:28, Kosyrev Serge a écrit :
> zimbatm <zimbatm at zimbatm.com> writes:
>> Is it possible some of them are kept from the bootstrap? What you need is a
>> tool that constructs the dependency tree(s).
> The key question is -- what this tool would use as source of
> information?
>
> Let me repeat the steps:
>
> 1. find out the glibcs:
>
> [deepfire at andromedae:~]$ nix-analyze-rootlike glibc               # sources at [1]
> ; analyzing "/nix/store/*-glibc-*" (minus noise)
> referrers	| disc	| correlation to profile
> closure	direct  | size	| user	system
> 1397	1062	| 22M	| 113	25	/nix/store/dad9vxniabwzidvvxfsfj6vb0xncsbbb-glibc-2.23
> 210	165	| 22M	| 0	0	/nix/store/phffgv3pwihmpdyk8xsz3wv8ydysch8w-glibc-2.23
> 159	22	| 34M	| 0	0	/nix/store/i0l0jjkk82wsqz9z5yhg35iy78bjq684-glibc-2.21
> 5	5	| 22M	| 0	0	/nix/store/62n981f02b56wjqfdq00pq706k11xz4d-glibc-2.21
>
> 2. pick an easy-to-analyze anomaly:
>
> [deepfire at andromedae:~]$ nix-store -q --referrers-closure /nix/store/62n981f02b56wjqfdq00pq706k11xz4d-glibc-2.21
> /nix/store/62n981f02b56wjqfdq00pq706k11xz4d-glibc-2.21
> /nix/store/5m6i1h71xp6r7k381hrsv5qwn3s6b93h-libXau-1.0.8
> /nix/store/kx1l6yis70h9sly7cs4b95jq0j8yxjqr-libXdmcp-1.1.2
> /nix/store/bxsi9xrrfc0qw3ndys83rppwqxbn33ma-libxcb-1.11.1
> /nix/store/62bmpi8kll9kj8il89kdaddvzib3r4pm-libX11-1.6.3
>
> What would the tool help with?  That's all the information the Nix store has.
>
> Again, it seems a contradiction to me:
>
>   - the referrer closure for the rogue glibc doesn't touch anything root-related
>   - yet the GC doesn't collect it
>
> So, can anyone confirm that it indeed is a bug?
>
No, it is probably not a bug.

If you think the path is useless, you can remove it from the store with
`nix-store --delete`.
Most probably, nix-store will refuse to do that, as the derivation is
"live".

This means that while the derivation is not required by some root, it is
kept to satisfy other functionalities of nix.
In some cases it is helpful to keep access to build inputs like gcc,
even if they are not used by the running system.

Please give us the content of your /etc/nix/nix.conf.
You may also find http://nixos.org/nix/manual/#conf-gc-keep-outputs a
good introduction.

-- Layus.

PS: if you want to dig deeper, try `grep
/nix/store/62n981f02b56wjqfdq00pq706k11xz4d-glibc-2.21
/nix/store/*.drv`, you may get something.


More information about the nix-dev mailing list