Bug 596433 - Behavior change for .private dependency causes rpm dependency detection breakage
Behavior change for .private dependency causes rpm dependency detection breakage
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: redhat-rpm-config (Show other bugs)
rawhide
All Linux
high Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 582106
  Show dependency treegraph
 
Reported: 2010-05-26 14:23 EDT by Mamoru TASAKA
Modified: 2010-05-27 13:26 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-27 08:45:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch (640 bytes, patch)
2010-05-26 19:42 EDT, Matthias Clasen
no flags Details | Diff

  None (edit)
Description Mamoru TASAKA 2010-05-26 14:23:23 EDT
Description of problem:
With this build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=2211258
Build failed with
--------------------------------------------------------
Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
Package 'dbus-1', required by 'gconf', not found
--------------------------------------------------------

Now rpmbuild detects and adds pkgconfig based dependency, the
issue like this should not occur (because GConf2-devel is surely
in buildroot!)

gconf-2.0.pc says:
------------------------------------------------------
Requires: glib-2.0
Requires.private: ORBit-2.0 dbus-1
------------------------------------------------------
However with GConf2-devel-2.31.3-1.fc14.i686 :
http://koji.fedoraproject.org/koji/rpminfo?rpmID=1990870
Requires(dbus-1) does not appear in Requires. On the other hand,
with GConf2-devel-2.28.1-1.fc13.i686:
http://koji.fedoraproject.org/koji/rpminfo?rpmID=1896589
Requires(dbus-1) is actually there.

/usr/lib/rpm/pkgconfigdeps.sh says:
=======================================================
    34  -R|--requires)
    35      while read filename ; do
    36      case "${filename}" in
    37      *.pc)
    38          i="`expr $i + 1`"
    39          [ $i -eq 1 ] && echo "$pkgconfig"
    40          DIR="`dirname ${filename}`"
    41          export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
    42          $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
    43              [ -n "$n" ] || continue
    44              echo -n "pkgconfig($n) "
    45              [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"
    46              echo
    47          done
    48      esac
======================================================
so the dependency detection by rpmbuild uses the result
of "pkg-config --print-requires".

With pkgconfig-0.23-9.fc12.i686:
$ pkg-config --print-requires ./gconf-2.0.pc
glib-2.0
ORBit-2.0
dbus-1
glib-2.0

With pkgconfig-0.24-2.fc14.i686:
$ pkg-config --print-requires ./gconf-2.0.pc
glib-2.0

And even if with pkgconfig-0.24-2.fc14.i686, even if --print-requires
only returns glib-2.0, if dbus-1.pc is not found, pkg-config shows
the error:
$ pkg-config --cflags gconf-2.0
Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
Package 'dbus-1', required by 'gconf', not found

Version-Release number of selected component (if applicable):
pkgconfig-0.24-2.fc14

How reproducible:
100%
Comment 1 Mamoru TASAKA 2010-05-26 14:31:45 EDT
(In reply to comment #0)
> However with GConf2-devel-2.31.3-1.fc14.i686 :
> http://koji.fedoraproject.org/koji/rpminfo?rpmID=1990870
> Requires(dbus-1) does not appear in Requires. On the other hand,
> with GConf2-devel-2.28.1-1.fc13.i686:
> http://koji.fedoraproject.org/koji/rpminfo?rpmID=1896589
> Requires(dbus-1) is actually there.
> 

should be read as "pkgconfig(dbus-1)".
Comment 2 Matthias Clasen 2010-05-26 19:33:33 EDT
What happened here is that our patch to add --print-requires finally moved upstream. But on the way, it got split up into --print-requires and --print-requires-private. To keep the same behavior, find-requires.pkg-config needs to be updated to pass both options to pkg-config.
Comment 3 Matthias Clasen 2010-05-26 19:42:42 EDT
Created attachment 417064 [details]
patch

I'd be happy to build this if you have no objections
Comment 4 Mamoru TASAKA 2010-05-27 00:29:08 EDT
(In reply to comment #3)
> Created an attachment (id=417064) [details]
> patch
> 
> I'd be happy to build this if you have no objections    

Seems good to me (this patch should only be applied
to rawhide redhat-rpm-config, because pkg-config 0.23 does not
seem to accept --print-requires-private).
Comment 5 Panu Matilainen 2010-05-27 03:19:10 EDT
Good to hear it finally got upstreamed.

Just FYI, find-requires.pkg-config isn't what normally gets used. It only runs when the internal dependency generator is disabled (which is strongly frowned upon in Fedora as various important bits are missed by the older, external dep generator). What really needs patching is this in rpm's main macros file (will fix):

%__pkgconfig_requires   %{_rpmconfigdir}/pkgconfigdeps.sh --requires
Comment 6 Panu Matilainen 2010-05-27 08:45:42 EDT
Oops, of course its pkgconfigdeps.sh which needs patching, the arguments from the macro dont directly reflect what pkgconfigdeps.sh calls pkg-config with.

Anyway, fixed in both rpm-4.8.0-16.fc14 and redhat-rpm-config-9.1.0-5.fc14 now.
Comment 7 Mamoru TASAKA 2010-05-27 13:26:53 EDT
I rebuilt GConf2 and it seems good, thank you.

Note You need to log in before you can comment on or make changes to this bug.