Bug 1300432

Summary: pkg-config dependencies are not arch specific
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: ccecchi, jorton, jzeleny, novyjindrich, packaging-team-maint, pknirsch, pmatilai, sergio, yaneti
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-08 12:41:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2016-01-20 19:22:32 UTC
Description of problem:

On a Fedora 23 x86-64 host, doing:

  dnf install gtk3-devel

installs all the packages required to compile a Gtk3 program.
However on the same host doing:

  dnf install gtk3-devel.i686

does NOT install nearly enough dependencies.  It will not be
possible to compile a 32 bit program after this command.

Version-Release number of selected component (if applicable):

gtk3-3.18.6-1.fc23.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Grab the trivial Gtk3 program from the top of this page:
https://developer.gnome.org/gtk3/stable/gtk-getting-started.html
and save it into a file 'trivial.c'.
2. dnf install gtk3-devel.i686
3. Try to compile the trivial program:

  gcc -m32 trivial.c `PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig pkg-config --cflags --libs gtk+-3.0` -o trivial

Actual results:

You will see many missing packages.  The first one will probably
be 'pango' (ie. pango-devel.i686).

The full list of missing packages turns out to be:

{pango,pixman,zlib,libpng,expat,mesa-libEGL,libX11,libdrm,libxc
b,libXau,libXdamage,libXfixes,libXxf86vm,libXext,mesa-libGL,libXrender,harfbuzz,
graphite2,gdk-pixbuf2,atk,cairo-gobject,libXinerama,libXi,libXrandr,libXcursor,l
ibXcomposite,wayland,libwayland-client,libxkbcommon,libwayland-cursor,mesa-libwa
yland-egl,libepoxy,at-spi2-atk,at-spi2-core,dbus,glib2,glibc}-devel.i686

Expected results:

The dnf command should install everything required.

Additional info:

$ rpm -qR gtk3-devel | grep pkgconfig
pkgconfig
pkgconfig(atk)
pkgconfig(atk) >= 2.15.1
pkgconfig(atk-bridge-2.0)
pkgconfig(cairo)
[etc]

$ rpm -q --whatprovides 'pkgconfig(atk)'
atk-devel-2.18.0-1.fc24.i686
atk-devel-2.18.0-1.fc24.x86_64

It looks like the problem could be solved by using %_isa to
modify the pkgconfig() dependencies.

Thread on fedora-devel mailing list:

https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/message/AUELI2MN3VLCBWACS6ASHBR5G7DEWYY3/

Comment 1 Richard W.M. Jones 2016-01-20 19:27:20 UTC
As the dependencies are generated by /usr/lib/rpm/pkgconfigdeps.sh
which is part of rpm-build, I'm going to reassign this bug.

Comment 2 Richard W.M. Jones 2016-01-20 20:28:57 UTC
Applying the patch below changes the dependencies to:

pkgconfig(atk,x86_64)
pkgconfig(atk,x86_64) >= 2.15.1
pkgconfig(atk-bridge-2.0,x86_64)
pkgconfig(cairo,x86_64)
&c.

However this probably does NOT do the right thing for noarch
packages.  I'm not sure how to fix that.

--- pkgconfigdeps.sh.orig	2016-01-20 20:19:14.282308656 +0000
+++ pkgconfigdeps.sh	2016-01-20 20:24:19.877804174 +0000
@@ -6,6 +6,8 @@
     exit 0
 }
 
+arch=`uname -m`
+
 [ $# -ge 1 ] || {
     cat > /dev/null
     exit 0
@@ -28,7 +30,7 @@
 	    [ -n "$n" ] || continue
 	    # We have a dependency.  Make a note that we need the pkgconfig
 	    # tool for this package.
-	    echo -n "pkgconfig($n) "
+	    echo -n "pkgconfig($n,$arch) "
 	    [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"
 	    echo
 	done
@@ -46,7 +48,7 @@
 	export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
 	$pkgconfig --print-requires --print-requires-private "$filename" 2> /dev/null | while read n r v ; do
 	    [ -n "$n" ] || continue
-	    echo -n "pkgconfig($n) "
+	    echo -n "pkgconfig($n,$arch) "
 	    [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"
 	    echo
 	done

Comment 3 Yanko Kaneti 2016-01-21 08:38:42 UTC
I for one would rather see a fesco decree any type of different-than-native development (in contrast to runtime) enviroment installation unsupported.
IMHO it would be a huge waste of time to chase down all the corner cases and conflicts.

Comment 4 Yanko Kaneti 2016-01-21 08:45:21 UTC
Cross build environments not withstanding, of course. But these are already separate enough.

Comment 5 Richard W.M. Jones 2016-01-21 08:51:53 UTC
(In reply to Yanko Kaneti from comment #3)
> I for one would rather see a fesco decree any type of different-than-native
> development (in contrast to runtime) enviroment installation unsupported.
> IMHO it would be a huge waste of time to chase down all the corner cases and
> conflicts.

This kind of discussion should be on the Fedora devel mailing list.
There is already a thread discussing this bug - see link in comment 0.

Comment 6 Yanko Kaneti 2016-01-21 09:14:12 UTC
For some reason I glazed over that devel thread. Sorry. Brought my 2c there..

Comment 7 Sergio Basto 2016-01-22 00:02:59 UTC
I like the solution , but IMO syntax should be 
pkgconfig(cairo)(x86_64) and not pkgconfig(cairo,x86_64) as suggested,

noarch packages should not any last "()" , but how to know if it is arched or not  ? 

The best solution I found was :
pkg-config xbitmaps --variable=libdir

if /usr/share is noarch or /usr/lib64 is arched, but some cases pkgconfig don't have libdir and some files in /usr/share/pkgconfig have libdir as /usr/lib instead /usr/share ...

Comment 8 Sergio Basto 2016-01-26 16:10:07 UTC
Hello JFTR 

We already have 2 syntaxes on "()" one for .so for example:
libubsec.so(libubsec.so)(64bit)
and 32 bits means :
libubsec.so(libubsec.so) 

and for package versions !? 

openssl-libs(x86-64) = 2:1.0.2e-6.fc23
and 
openssl-libs(x86-32) = 2:1.0.2e-6.fc23

Comment 9 Jan Kurik 2016-02-24 14:18:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 10 Fedora End Of Life 2017-07-25 19:49:12 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 11 Fedora End Of Life 2017-08-08 12:41:09 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.