Bug 440673 - qt: makes incorrect assumptions aboug mysql_config --libs
qt: makes incorrect assumptions aboug mysql_config --libs
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: qt (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Ngo Than
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks: F12Target
  Show dependency treegraph
 
Reported: 2008-04-04 09:38 EDT by Rex Dieter
Modified: 2009-06-15 21:35 EDT (History)
3 users (show)

See Also:
Fixed In Version: 4.2.3-3.fc11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-15 21:35:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
first try to implement --libdir, --linkdir options in mysql_config (1.79 KB, patch)
2009-05-03 18:49 EDT, Rex Dieter
no flags Details | Diff
implement, mysql_config --pkglibdir (846 bytes, patch)
2009-05-04 08:48 EDT, Rex Dieter
no flags Details | Diff

  None (edit)
Description Rex Dieter 2008-04-04 09:38:30 EDT
$ pg_config --libs
-lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lcrypt
-ldl -lm

but postgresql-devel is missing deps on many(all?) of these, including:
krb5-devel
libxslt-devel
openssl-devel
pam-devel
readline-devel

Simplest/best approach, imo, would be to omit static libs and simplify the above
to just
LIBS = -lpgport
then no additional deps would be required.
Comment 1 Rex Dieter 2008-04-04 09:39:16 EDT
Oh and don't forget:
-lz => zlib-devel
Comment 2 Tom Lane 2008-04-04 10:40:15 EDT
As near as I can tell, this bug report is complete nonsense: the spec file does have BuildRequires for all 
those packages, and it would in fact not build in the current Fedora build system if it were missing those 
requires.  What exactly are you concerned about?
Comment 3 Rex Dieter 2008-04-04 11:05:02 EDT
I think you misunderstand:
postgresql-devel is missing Requires

My package (qt), 
BuildRequires: postgresql-devel
and fails to build because of missing (devel) libraries.

Does that clarify?
Comment 4 Tom Lane 2008-04-04 12:03:24 EDT
But you shouldn't need any of those libraries to build stuff depending on libpq.

Are you supposing that pg_config --libs denotes libraries that you are expected to link with?  That's not 
what Postgres uses it for.
Comment 5 Rex Dieter 2008-04-04 12:12:15 EDT
Ugh, ok, then qt's configure script depending on that is broken.
Comment 6 Rex Dieter 2008-04-04 12:13:27 EDT
reassigning -> qt
Comment 7 Rex Dieter 2008-04-04 12:14:04 EDT
fyi, this is when trying to build qt-4.4.0-rc1
Comment 8 Kevin Kofler 2008-04-04 12:19:36 EDT
> Are you supposing that pg_config --libs denotes libraries that you are 
expected to link with?

s/you/Trolltech/ And don't you think it's because that's what pkg-config --libs 
* and almost all the *-config --libs scripts do? IMHO this inconsistency is 
something to complain about to PostgreSQL upstream.
Comment 9 Tom Lane 2008-04-04 12:30:26 EDT
Oh, then I bet you'll be complaining to me about mysql_config real soon, too ... both of those packages 
think that config --libs exists to record what they linked with internally, not what clients have to mention 
to link to them.
Comment 10 Rex Dieter 2008-04-04 12:49:25 EDT
yep, fwiw, qt makes the same incorrect assumption about mysql_config too.
Comment 11 Kevin Kofler 2008-04-04 12:52:08 EDT
Why would a package care about what PostgreSQL or MySQL are internally linked 
to? --libs is supposed to be the ldflags to be used to link to a package.
Comment 12 Rex Dieter 2008-04-04 12:54:41 EDT
Tom, for my own curiosity, is there some official/preferred method that
pgsql/mysql using apps to query for cflags, libs, ldflags to use?

Kevin's right, the misconception is that's precisely what pg_config and
mysql_config are for.
Comment 13 Tom Lane 2008-04-04 13:11:55 EDT
I can't speak to mysql's thought processes, but the Postgres project thinks of pg_config as being mostly 
for forensic purposes, ie "just how was this installation built, anyway?"

Actually, looking at it more closely, I think --libs does have some use if you are trying to link a Postgres 
server extension module.  But in a modern Linux system I don't see the point of obtaining build flags from 
a standard library package at all.  You shouldn't particularly need any -I or -L flags, you certainly 
shouldn't be adopting any -D flags, and as for -l you really ought to only need to mention the libraries 
you are directly dependent on.
Comment 14 Kevin Kofler 2008-04-04 13:20:18 EDT
Well, not all libraries are as easy to link to as -lfoo, some require you to 
link to multiple libraries, sometimes a -L flag is needed etc. Likewise, 
*config --cflags usually isn't about -D flags, but -I flags.
Comment 15 Tom Lane 2008-04-04 13:31:55 EDT
No doubt there are complicated cases where you have to have such things, but for simple libraries like 
libpq or libmysqlclient, I would argue that the need for any such flag indicates that the package is 
presenting a gratuitously nonstandard API.
Comment 16 Tim Niemueller 2008-04-05 04:53:37 EDT
I'm building the lua-sql package (see bug #440679) and I made the same
assumption about pg_config (and mysql_config as well actually).

Maybe we could add simple pkgconfig files to the packages?
Comment 17 Bug Zapper 2008-05-14 04:39:58 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 18 Steven M. Parrish 2008-06-23 16:22:35 EDT
Ok read all the back and forth on this one.  So where do we go from here, is
this now an issue or non-issue?
Comment 19 Rex Dieter 2008-06-23 16:37:34 EDT
Still and issue, qt needs fixing.
Comment 20 Tom Lane 2008-06-23 16:44:10 EDT
Is there any interest in the pkgconfig idea?  I think the odds of getting either upstream project to redefine 
what their config programs should return are about nil, but maybe pkgconfig would be a useful 
compromise.  I don't know much of anything about pkgconfig, though.
Comment 21 Rex Dieter 2008-06-23 16:52:44 EDT
Tom, sure, pkgconfig is a viable (and preferred) option.  When I have a few
cycles, I can help out with the pkgconfig bits.
Comment 22 Steven M. Parrish 2009-01-10 14:08:00 EST
6 months later.....?
Comment 23 Rex Dieter 2009-01-10 14:53:06 EST
Yep still todo, retargetting rawhide/f11
Comment 24 Steven M. Parrish 2009-03-21 15:04:57 EDT
Is this still an issue with Qt4.5?
Comment 25 Rex Dieter 2009-05-03 16:48:53 EDT
Yes, still an issue.

Looks like pkgconfig support to mysql/postgresql will have to come before any changes in qt (for mysql where at least -L%{_libdir}/mysql is needed).
Comment 26 Rex Dieter 2009-05-03 16:53:57 EDT
alternatively, looks like pg_config has enough information to use (libdir and/or ldflags in particular).  Perhaps mysql_config could be augmented to provide similar useful information.
Comment 27 Rex Dieter 2009-05-03 18:27:44 EDT
I was working on the mysql patch, and while looking at mysql_config manpage it says to use --libs to link client apps, which is contrary to what Tom said.  I'll leave that alone I guess.

Turns out qt only uses pg_config --libdir and pg_config --includedir , so postgresql is good to go now (adjusting summary).
Comment 28 Rex Dieter 2009-05-03 18:49:28 EDT
Created attachment 342257 [details]
first try to implement --libdir, --linkdir options in mysql_config
Comment 29 Rex Dieter 2009-05-03 18:52:27 EDT
Once either of these (or something like it) is available in mysql, I can make qt make use of them.  Unfortunately, mysql_config doesn't return an error code or output help text to STDERR when passed unknown options, so it's hard to check this at qt-buildtime.

Tom, is this a good start?
Comment 30 Tom Lane 2009-05-03 20:21:35 EDT
What makes you say it doesn't return an error code?  I see "exit 1" when the option is unrecognized.

As for the patch details, I'd suggest just exporting $pkglibdir as --pkglibdir rather than inventing something unusual.  And why touch the existing variable definitions?  This should be a two-line patch.

But the real issue is you can't push this upstream to qt unless you can persuade upstream mysql to adopt it ... my experience with getting them to take back portability fixes has been grim ...
Comment 31 Rex Dieter 2009-05-04 08:42:46 EDT
OK, error code was wrong... not sure what I was smokin.   
I just thought using the new definitions consistently throughout mysql_config would make sense, but I'll simply the patch as you suggest.

With the error code I can make it work both ways, but qt accepting the change will likely be contingent upon mysql adopting it too, correct.
Comment 32 Rex Dieter 2009-05-04 08:48:13 EDT
Created attachment 342300 [details]
implement, mysql_config --pkglibdir
Comment 33 Rex Dieter 2009-05-04 10:17:13 EDT
OK, qt patched accordingly to use mysql_config --pkglibdir, if option is present.

http://cvs.fedoraproject.org/viewvc/devel/qt/qt-x11-opensource-src-4.5.1-mysql_config.patch
Comment 34 Fedora Update System 2009-05-11 13:48:57 EDT
qt-4.5.1-10.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/qt-4.5.1-10.fc11
Comment 35 Fedora Update System 2009-05-12 00:07:15 EDT
qt-4.5.1-10.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update qt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-4813
Comment 36 Fedora Update System 2009-05-20 19:52:49 EDT
qt-4.5.1-10.fc11, kdelibs-4.2.3-3.fc11, kdeplasma-addons-4.2.3-2.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update qt kdelibs kdeplasma-addons'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-4813
Comment 37 Fedora Update System 2009-05-25 17:17:15 EDT
kdelibs-4.2.3-3.fc11, kdeplasma-addons-4.2.3-2.fc11, qt-4.5.1-11.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kdelibs kdeplasma-addons qt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-4813
Comment 38 Fedora Update System 2009-06-02 10:37:04 EDT
kdelibs-4.2.3-3.fc11, kdeplasma-addons-4.2.3-2.fc11, qt-4.5.1-13.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kdelibs kdeplasma-addons qt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-4813
Comment 39 Fedora Update System 2009-06-15 21:35:10 EDT
kdelibs-4.2.3-3.fc11, kdeplasma-addons-4.2.3-2.fc11, qt-4.5.1-13.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

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