[opensuse-factory] pkgconfigdeps.sh causes huge dependency bloat
Hi: The script that generates -devel package "pkgconfig" dependencies does not quite do the right thing. It honors *.private fields even when packages do not contain static libraries, hence adding a lot of unneeded stuff into the dependency chain. I you have ever wondered why every time you build a package it downloads and inject half of the distribution into your buildroot, this is a likely candidate to look in ;-) Will be cool if someone can take a look at it. Cheers. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 30 May 2012 20:48, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
Hi:
The script that generates -devel package "pkgconfig" dependencies does not quite do the right thing.
It honors *.private fields even when packages do not contain static libraries, hence adding a lot of unneeded stuff into the dependency chain.
I you have ever wondered why every time you build a package it downloads and inject half of the distribution into your buildroot, this is a likely candidate to look in ;-)
Will be cool if someone can take a look at it.
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". So I don't see a way to fix it. It would require pkgconfigdeps.sh to somehow keep a state between calls. And even if that would be done, there seems to be no way to warranty the .a files would be processed before the .pc ones. The only option I see is supposing %__pkgconfig_path ^((%{_libdir}|%{_datadir})/pkgconfig/.*\.pc|%{_bindir}/pkg-config)$ (something that could change...) and from every call to pkgconfigdeps.sh check for $(dirname ${filename})/../*.a -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
El 30/05/12 19:30, Cristian Morales Vega escribió:
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". The only option I see is supposing
%__pkgconfig_path ^((%{_libdir}|%{_datadir})/pkgconfig/.*\.pc|%{_bindir}/pkg-config)$
:-| My current hack is nicer, I just use sed to remove Requires.private/Libs.private from the .pc files. ;-P -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thursday 2012-05-31 01:30, Cristian Morales Vega wrote:
On 30 May 2012 20:48, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
Hi:
The script that generates -devel package "pkgconfig" dependencies does not quite do the right thing.
It honors *.private fields even when packages do not contain static libraries, hence adding a lot of unneeded stuff into the dependency chain.
I you have ever wondered why every time you build a package it downloads and inject half of the distribution into your buildroot, this is a likely candidate to look in ;-)
Will be cool if someone can take a look at it.
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". So I don't see a way to fix it.
All you nay sayers! :) --- r/usr/lib/rpm/pkgconfigdeps.sh 2011-10-29 05:21:34.000000000 +0200 +++ pkgconfigdeps.sh 2012-05-31 08:13:35.259115193 +0200 @@ -16,6 +16,20 @@ $pkgconfig --atleast-pkgconfig-version=" exit 0 } +# +# (The desired side effect of `head` should be that `find` terminates early on, +# after one line, due to SIGPIPE.) +# +static_archives=""; +result=$(find "$RPM_BUILD_ROOT" -type f -name "*.a" | head -n1); +if [ -n "$result" ]; then + # It looks like at least one RPM subpackage will have .a files + static_archives="--print-requires-private"; + echo "$0: Will include Requires.private as Provides: due to $result" >&2; +else + echo "$0: No static archives found. Requires.private will not contribute to Provides:." >&2; +fi + case $1 in -P|--provides) while read filename ; do @@ -44,7 +58,7 @@ case $1 in [ $i -eq 1 ] && echo "$pkgconfig" DIR="`dirname ${filename}`" export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" - $pkgconfig --print-requires --print-requires-private "$filename" 2> /dev/null | while read n r v ; do + $pkgconfig --print-requires $static_archives "$filename" 2> /dev/null | while read n r v ; do [ -n "$n" ] || continue echo -n "pkgconfig($n) " [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v" -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 31 May 2012 07:19, Jan Engelhardt <jengelh@inai.de> wrote:
On Thursday 2012-05-31 01:30, Cristian Morales Vega wrote:
On 30 May 2012 20:48, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
Hi:
The script that generates -devel package "pkgconfig" dependencies does not quite do the right thing.
It honors *.private fields even when packages do not contain static libraries, hence adding a lot of unneeded stuff into the dependency chain.
I you have ever wondered why every time you build a package it downloads and inject half of the distribution into your buildroot, this is a likely candidate to look in ;-)
Will be cool if someone can take a look at it.
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". So I don't see a way to fix it.
All you nay sayers! :)
--- r/usr/lib/rpm/pkgconfigdeps.sh 2011-10-29 05:21:34.000000000 +0200 +++ pkgconfigdeps.sh 2012-05-31 08:13:35.259115193 +0200 @@ -16,6 +16,20 @@ $pkgconfig --atleast-pkgconfig-version=" exit 0 }
+# +# (The desired side effect of `head` should be that `find` terminates early on, +# after one line, due to SIGPIPE.) +# +static_archives=""; +result=$(find "$RPM_BUILD_ROOT" -type f -name "*.a" | head -n1); +if [ -n "$result" ]; then + # It looks like at least one RPM subpackage will have .a files + static_archives="--print-requires-private"; + echo "$0: Will include Requires.private as Provides: due to $result" >&2; +else + echo "$0: No static archives found. Requires.private will not contribute to Provides:." >&2; +fi + case $1 in -P|--provides) while read filename ; do @@ -44,7 +58,7 @@ case $1 in [ $i -eq 1 ] && echo "$pkgconfig" DIR="`dirname ${filename}`" export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" - $pkgconfig --print-requires --print-requires-private "$filename" 2> /dev/null | while read n r v ; do + $pkgconfig --print-requires $static_archives "$filename" 2> /dev/null | while read n r v ; do [ -n "$n" ] || continue echo -n "pkgconfig($n) " [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"
Is $RPM_BUILD_ROOT defined there? If so, please, submit it. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thursday 2012-05-31 11:13, Cristian Morales Vega wrote:
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". So I don't see a way to fix it.
All you nay sayers! :)
--- r/usr/lib/rpm/pkgconfigdeps.sh 2011-10-29 05:21:34.000000000 +0200 +++ pkgconfigdeps.sh 2012-05-31 08:13:35.259115193 +0200 [...]
Is $RPM_BUILD_ROOT defined there? If so, please, submit it.
I made sure of it. Therefore, #123039. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
El 31/05/12 07:39, Jan Engelhardt escribió:
On Thursday 2012-05-31 11:13, Cristian Morales Vega wrote:
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". So I don't see a way to fix it.
All you nay sayers! :)
I made sure of it. Therefore, #123039.
thank you very much Jan for setting this thing straight :-) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thursday 2012-05-31 18:33, Cristian Rodríguez wrote:
El 31/05/12 07:39, Jan Engelhardt escribió:
On Thursday 2012-05-31 11:13, Cristian Morales Vega wrote:
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". So I don't see a way to fix it.
All you nay sayers! :)
I made sure of it. Therefore, #123039.
thank you very much Jan for setting this thing straight :-)
Yeah but does not work, as mls explains in the decline message. Requires.private is too coarse; people use it for both headers and static libs. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
El 31/05/12 12:43, Jan Engelhardt escribió:
On Thursday 2012-05-31 18:33, Cristian Rodríguez wrote:
El 31/05/12 07:39, Jan Engelhardt escribió:
On Thursday 2012-05-31 11:13, Cristian Morales Vega wrote:
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". So I don't see a way to fix it.
All you nay sayers! :)
I made sure of it. Therefore, #123039.
thank you very much Jan for setting this thing straight :-)
Yeah but does not work, as mls explains in the decline message. Requires.private is too coarse; people use it for both headers and static libs.
Wow, it is even more awfully broken than I though, the manual says " Requires.private: A list of packages required by this package. The difference from Requires is that the packages listed under Requires.private are not taken into account when a flag list is computed for dynamically linked executable (i.e., when --static was not specified). **In the situation where each .pc file corresponds to a library, Requires.private shall be used exclusively to specify the dependencies between the libraries.**" -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 31 May 2012 20:25, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
El 31/05/12 12:43, Jan Engelhardt escribió:
On Thursday 2012-05-31 18:33, Cristian Rodríguez wrote:
El 31/05/12 07:39, Jan Engelhardt escribió:
On Thursday 2012-05-31 11:13, Cristian Morales Vega wrote:
> http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new > generators get called once per each file of a type". > So I don't see a way to fix it.
All you nay sayers! :)
I made sure of it. Therefore, #123039.
thank you very much Jan for setting this thing straight :-)
Yeah but does not work, as mls explains in the decline message. Requires.private is too coarse; people use it for both headers and static libs.
Wow, it is even more awfully broken than I though, the manual says
" Requires.private: A list of packages required by this package. The difference from Requires is that the packages listed under Requires.private are not taken into account when a flag list is computed for dynamically linked executable (i.e., when --static was not specified). **In the situation where each .pc file corresponds to a library, Requires.private shall be used exclusively to specify the dependencies between the libraries.**"
This is kind of official documentation: http://people.freedesktop.org/~dbn/pkg-config-guide.html#faq. The second FAQ explains it... The fix is to manually patch your .pc files if you don't package static libraries... but keeping an eye into the headers dependencies. (Perhaps it would be faster to remove --print-requires-private and patch the few packages that would break? ;-) ) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, May 31, 2012 at 4:38 PM, Cristian Morales Vega <reddwarf@opensuse.org> wrote:
This is kind of official documentation: http://people.freedesktop.org/~dbn/pkg-config-guide.html#faq. The second FAQ explains it...
The fix is to manually patch your .pc files if you don't package static libraries... but keeping an eye into the headers dependencies. (Perhaps it would be faster to remove --print-requires-private and patch the few packages that would break? ;-) )
If you ask me, which, granted you didn't, pkgconfig needs a separate entry for headers. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 1 June 2012 02:06, Claudio Freire <klaussfreire@gmail.com> wrote:
On Thu, May 31, 2012 at 4:38 PM, Cristian Morales Vega <reddwarf@opensuse.org> wrote:
This is kind of official documentation: http://people.freedesktop.org/~dbn/pkg-config-guide.html#faq. The second FAQ explains it...
The fix is to manually patch your .pc files if you don't package static libraries... but keeping an eye into the headers dependencies. (Perhaps it would be faster to remove --print-requires-private and patch the few packages that would break? ;-) )
If you ask me, which, granted you didn't, pkgconfig needs a separate entry for headers.
I totally agree. Feel free to send a patch upstream. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Friday 2012-06-01 21:06, Cristian Morales Vega wrote:
On 1 June 2012 02:06, Claudio Freire <klaussfreire@gmail.com> wrote:
On Thu, May 31, 2012 at 4:38 PM, Cristian Morales Vega <reddwarf@opensuse.org> wrote:
This is kind of official documentation: http://people.freedesktop.org/~dbn/pkg-config-guide.html#faq. The second FAQ explains it...
The fix is to manually patch your .pc files if you don't package static libraries... but keeping an eye into the headers dependencies. (Perhaps it would be faster to remove --print-requires-private and patch the few packages that would break? ;-) )
If you ask me, which, granted you didn't, pkgconfig needs a separate entry for headers.
I totally agree. Feel free to send a patch upstream.
And at the same time change "Cflags" to "Cppflags", because that's what they really are. (Note that automake has a corresponding AM_CPPFLAGS already.) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (4)
-
Claudio Freire
-
Cristian Morales Vega
-
Cristian Rodríguez
-
Jan Engelhardt