Bug 1693966 - missing -devel dep on zlib-devel
Summary: missing -devel dep on zlib-devel
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mariadb-connector-c
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Schorm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-29 07:55 UTC by Joe Orton
Modified: 2020-08-06 17:26 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-08-06 17:26:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Joe Orton 2019-03-29 07:55:59 UTC
Description of problem:
/usr/bin/mysql_config  --libs output is:

-L/usr/lib64/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto

this implies zlib-devel is required to link.  Up until

https://src.fedoraproject.org/rpms/openssl/c/7a654fc69c499b54f38543ca40f765fbaf9bdf84?branch=master

openssl-devel Requires: zlib-devel

but this is no longer true.

Version-Release number of selected component (if applicable):
mariadb-connector-c-devel-3.0.9-2.fc31.x86_64

How reproducible:
https://kojipkgs.fedoraproject.org/work/tasks/906/33810906/build.log

Steps to Reproduce:
1. link using mysql_config --libs

Actual results:
fail w/o zlib-devel

Expected results:
success

Additional info:

Comment 1 Joe Orton 2019-03-29 07:59:07 UTC
It would be very nice if libmariadb.pc was cleaned up, so it had a Libs/Libs.private split:

Libs: -lmariadb 
Libs.Private: -lz -ldl -lm -lpthread -lssl -lcrypto

since all I really need to link against is libmariadb.so and the dynamic linker will do the rest.

Comment 2 Joe Orton 2019-03-29 08:08:17 UTC
^ should be Libs.private: though I'm not sure it's case-sensitive.

Comment 4 Michal Schorm 2019-03-29 11:57:45 UTC
This looks like an upstream material.
However I haven't understood it deep enought yet, to be able to defent such PR.

--

The base problem is that you have a software building on top of "mariadb-connector-c", you are correctly using "mysql_config", but the build fail since the "-lz" linker flag was passed, but "zlib-devel" is not in the buildroot.

The fisrt part is adding "zlib-devel" as a "Requires" to the "mariadb-connector-c-devel" subpackage.
We do build the "mariadb-connector-c" package using "zlib", so this is a reasonable request.
Fixing now:
https://src.fedoraproject.org/rpms/mariadb-connector-c/c/8781fc38b459e984dddc0139028c1286d06452e4?branch=master
https://koji.fedoraproject.org/koji/taskinfo?taskID=33813071

--

For the rest of the problem:
I haven't really ever used pkgconfig, so I need to do some research on how it works and how it doesn't.

I'll be glad for a detailed description, what exactly are you trying to achieve and how does that work.
If that would make sense to me, I'd brought to the upstream.

Anyway - the first part of the fix (requiring "zlib-devel") should be enough for you for now, right?

Comment 5 Joe Orton 2019-03-29 15:15:02 UTC
Yup sure, fixing the -devel requirement for now is fine.  I rebased the PR anyway.

There is a good discussion of "overlinking" and why you should use Libs.private here https://wiki.openmandriva.org/en/Overlinking_issues_in_packaging

Essentially consumers of libmariadb.so only need to link against -lmariadb, not against -lmariadb -lz -lssl etc

apr-util's mysql plugin picks up library deps expressed in `mysql_config --libs` even though they are not needed in this binary.  If the pkg-config file used Libs.private, I could use the library list from there (just -lmariadb) and have a cleaner, less fragile and bugs like this would have been avoided.

$ ldd -u -r /usr/lib64/apr-util-1/apr_dbd_mysql-1.so 
Unused direct dependencies:
	/lib64/libz.so.1
	/lib64/libdl.so.2
	/lib64/libm.so.6
	/lib64/libpthread.so.0
	/lib64/libssl.so.1.1
	/lib64/libcrypto.so.1.1

Comment 6 Fedora Update System 2019-04-30 22:00:22 UTC
mariadb-connector-c-3.0.9-3.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-77efb803f9

Comment 7 Fedora Update System 2019-05-01 01:44:25 UTC
mariadb-connector-c-3.0.9-3.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-77efb803f9

Comment 8 Fedora Update System 2019-05-02 03:33:22 UTC
mariadb-connector-c-3.0.9-3.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Anthony Messina 2019-05-11 00:30:12 UTC
After upgrading to F30, I found that this build is missing /usr/lib64/mariadb/plugin/auth_gssapi_client.so

The last reported version containing that file is 3.0.9-2.fc30

Comment 10 Michal Schorm 2019-05-15 15:20:17 UTC
Anthony Messina

! THANKS FOR HEADS UP !

A krb5-devel package was removed from the buildroot, which made the plugin not building, since it didn't have the needed files.
Fix is on the way, together with 3.0.10 version.
https://koji.fedoraproject.org/koji/taskinfo?taskID=34872897  (Rawhide build)

Comment 11 Michal Schorm 2019-05-15 15:37:30 UTC
Partial fix for this BZ was released.
Second part still awaits.

Moving back to Assigned.

Comment 12 Honza Horak 2019-05-17 09:09:38 UTC
(In reply to Anthony Messina from comment #9)
> After upgrading to F30, I found that this build is missing
> /usr/lib64/mariadb/plugin/auth_gssapi_client.so

Michal, issues like this might be discovered sooner if we have more specific %files section, i.e. instead of plugin/* to include more specific list. It makes the spec longer, but maybe worth it. Keeping up to you to decide.

Comment 13 Michal Schorm 2019-05-21 13:43:19 UTC
Patch prepared and applied:
https://src.fedoraproject.org/rpms/mariadb-connector-c/c/ad54a14b2c46f9a75936fe1af80043deb6f77d87?branch=master

Please test in Rawhide by rebuilding the apr-util.

Comment 14 Ben Cotton 2019-08-13 16:50:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 15 Ben Cotton 2019-08-13 19:18:53 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 16 Michal Schorm 2020-02-12 13:22:53 UTC
NOT actively working on this task.

Comment 17 Michal Schorm 2020-08-06 17:26:03 UTC
Resolved by a PR accepted by upstream,
see https://src.fedoraproject.org/rpms/mariadb-connector-c/pull-request/8 for more info


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