Subject: Re: bug#65550: Don't add propagated-inputs for all outputs

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 31 Aug 2023 22:16:25 -0400

Hi,

宋文武 <[email-masked]> writes:

> Liliana Marie Prikler <[email-masked]> writes:
>
>> I'd really like to avoid yet another special output, when "bin", "lib",
>> etc. have already been given clear meanings, one of which strongly
>> overlaps with "stuff that wants propagated inputs for pkg-config
>> reasons".
>
> The benefit to put headers files and libraries files into seperated
> outputs is to reduce the runtime closure size of packages, for example
> my home profile contains xfce, emacs, fonts, etc. has total 5GiB (by
> guix size), and they have 300MiB under include.
>
> calculated by:
>
> x=/gnu/store/0fyhci5kv03rfb9430jqs9wki2ifq5ja-profile
> guix size $x
> for i in `guix size $x`;
>   do [ -e $i/include ] && du -sb $i/include;
> done | awk '{ sum += $1 } END { print sum / 1024 / 1024 }'
>
> If put headers and other development files into a "dev" output, then
> those 300MiB can be saved (won't need to be substituted if substitutes
> available).  Note that use a "include" output won't help here if you
> leave pkg-config files in "lib", since pkg-config files need reference
> its include and binaries need reference its libraries.
>
> So it seems to me a "dev" output is unavoidable, also both Debian and
> Alpine Linux use '-dev' packages for the same reason, it should be
> familiar to learn..

I'm not convinced that saving 300 MiB on 5 GiB is worth making using
Guix packages more complicated, especially in this age of compressed
file systems (text files compress very well).  We'd also have to change
a couple things to make it convenient and not have to plaster the code
base with ugly `(,lib "dev") inputs ^^'.

I reckon it could all be automated, but I'm not sure it's worth the
effort at this stage (there bigger low hanging fruits to pick in my
opinion -- such as moving static libraries automatically in the gnu
build system, paying more attention to large documentation or unecessary
installed files, etc.).

-- 
Thanks,
Maxim