Bug 440673 - qt: makes incorrect assumptions aboug mysql_config --libs
Summary: qt: makes incorrect assumptions aboug mysql_config --libs
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: qt
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F12Target
TreeView+ depends on / blocked
 
Reported: 2008-04-04 13:38 UTC by Rex Dieter
Modified: 2009-06-16 01:35 UTC (History)
3 users (show)

Fixed In Version: 4.2.3-3.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-16 01:35:37 UTC
Type: ---
Embargoed:


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

Description Rex Dieter 2008-04-04 13:38:30 UTC
$ 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 13:39:16 UTC
Oh and don't forget:
-lz => zlib-devel

Comment 2 Tom Lane 2008-04-04 14:40:15 UTC
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 15:05:02 UTC
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 16:03:24 UTC
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 16:12:15 UTC
Ugh, ok, then qt's configure script depending on that is broken.

Comment 6 Rex Dieter 2008-04-04 16:13:27 UTC
reassigning -> qt

Comment 7 Rex Dieter 2008-04-04 16:14:04 UTC
fyi, this is when trying to build qt-4.4.0-rc1

Comment 8 Kevin Kofler 2008-04-04 16:19:36 UTC
> 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 16:30:26 UTC
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 16:49:25 UTC
yep, fwiw, qt makes the same incorrect assumption about mysql_config too.

Comment 11 Kevin Kofler 2008-04-04 16:52:08 UTC
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 16:54:41 UTC
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 17:11:55 UTC
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 17:20:18 UTC
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 17:31:55 UTC
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 08:53:37 UTC
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 08:39:58 UTC
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 20:22:35 UTC
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 20:37:34 UTC
Still and issue, qt needs fixing.

Comment 20 Tom Lane 2008-06-23 20:44:10 UTC
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 20:52:44 UTC
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 19:08:00 UTC
6 months later.....?

Comment 23 Rex Dieter 2009-01-10 19:53:06 UTC
Yep still todo, retargetting rawhide/f11

Comment 24 Steven M. Parrish 2009-03-21 19:04:57 UTC
Is this still an issue with Qt4.5?

Comment 25 Rex Dieter 2009-05-03 20:48:53 UTC
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 20:53:57 UTC
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 22:27:44 UTC
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 22:49:28 UTC
Created attachment 342257 [details]
first try to implement --libdir, --linkdir options in mysql_config

Comment 29 Rex Dieter 2009-05-03 22:52:27 UTC
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-04 00:21:35 UTC
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 12:42:46 UTC
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 12:48:13 UTC
Created attachment 342300 [details]
implement, mysql_config --pkglibdir

Comment 33 Rex Dieter 2009-05-04 14:17:13 UTC
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 17:48:57 UTC
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 04:07:15 UTC
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 23:52:49 UTC
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 21:17:15 UTC
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 14:37:04 UTC
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-16 01:35:10 UTC
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.