[MDEV-5482] Rename libmysqclient files and sonames to libmariadbclient Created: 2013-12-22  Updated: 2016-12-01  Resolved: 2016-11-25

Status: Closed
Project: MariaDB Server
Component/s: Platform Debian
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.34, 10.0.7
Fix Version/s: 10.2.3

Type: Bug Priority: Major
Reporter: Otto Kekäläinen Assignee: Otto Kekäläinen
Resolution: Fixed Votes: 1
Labels: Debian, packaging
Environment:

Debian/Ubuntu



 Description   

While packaging MariaDB for official Debian inclusion, one of the most invasive changes I made was to rename the shared library filenames in libmysqlclient.so & co to libmariadbclient.so.

The rationale (originally presented by Debian MySQL packagers team) was that as the MySQL and MariaDB libraries are not 100% identical, they should not have the same filename (or soname), otherwise there will be ungraceful failures when a software optimized for MariaDB is run in an environment with the non-MariaDB version of soname libmysqlclient.

In current official Debian packages (source at http://anonscm.debian.org/gitweb/?p=pkg-mysql/mariadb-5.5.git and -10.0.git) the packages libmariadbclient18 and libmysqlclient18 are co-installable and the filenames are not the same (libmariadbclient.so.18 and libmysqlclient.so.18).

It seems that the original MySQL version of libmysqlclient.so.18 can be used with the MariaDB client/server. Therefore software that link to libmysqlclient.so.18 will work just fine with MySQL libmysqlclient.so.18.so and MariaDB server/client. Also if any software was to link to libmariadbclient.so.18 if would work via MariaDB libmysqlclient.so.18.so and MariaDB server/client just fine.



 Comments   
Comment by Michael Widenius [ 2014-01-21 ]

Hi!

It's ok to rename the client library to libmariadbclient

The question is what to do with the include files (as both are named mysql_com.h, mysql.h etc).

When compiling, one have to take care that if one has the include files for MariaDB installed, that one is linking with libmariadbclient.

I assume one can't install both the MySQL and the MariaDB include files at the same time?

Regards,
Monty

Comment by Otto Kekäläinen [ 2014-01-21 ]

At the moment packages libmariadbclient-dev and libmysqlclient-dev (and libmariadbd-dev and libmysqld-dev) are NOT co-installable.

The mentioned files (mysql.h etc) are inside those -dev packages. Full file list e.g. at http://packages.debian.org/sid/i386/libmariadbclient-dev/filelist
As the paths and filenames are the same, the packages would conflict upon installation, thus they are now marked as conflicting and will remove each other if installed.

I'am not 100% sure of all the ramifications this SONAME change has, so I'd like to see upstream do the change properly, and then I can throw away my temporary hack in the Debian packages.

Comment by Otto Kekäläinen [ 2014-02-04 ]

I desperately need help with this. I don't feel comfortable just running s/mysqlclient/mariadbclient/g for libmysql/CMakeLists.txt. Somebody who has insight into what what affects what in regards on this SONAME should do it properly.

It does not need to be applied upstream directly, I can take it as a patch and put in debian/patches/ to get it applied for the Debian version.

Comment by Otto Kekäläinen [ 2014-02-04 ]

Thanks to serg I added some sed magic to debian/rules:

sed -i 's/mysqlclient/mariadbclient/g' client/CMakeLists.txt tests/CMakeLists.txt libmysql/CMakeLists.txt scripts/CMakeLists.txt
sed -i 's/mysqlclient/mariadbclient/g' libmysql/libmysql.ver.in
sed -i 's/mysqlclient/mariadbclient/g' man/mysql_config.1
sed -i 's/mysqlclient/mariadbclient/g' scripts/make_win_bin_dist scripts/mysql_config.sh scripts/mysql_config.pl.in

It builds OK (but haven't tested yet running the tests) and after installation SONAME is correct:

objdump -x /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18 | grep SONAME
SONAME libmariadbclient.so.18

Commit done at https://github.com/ottok/mariadb-5.5/commit/721872239

Comment by Otto Kekäläinen [ 2014-02-05 ]

Ok, after discussions we decided to rename the soname to libmysqlclient.so.18.1 instead of mariadbclient.so.18. I'll remove the sed lines from my debian/rules and update the debian/* content to be compatible with name libmysqlclient.so.18.1 and add a patch to debian/patches/ that modifies the source to generate libmysqlclient.so.18.1 once Serg sends me such a patch.

I will also change the dependencies so that libmysqclient18 is not automatically installed when MariaDB is installed.

Comment by Otto Kekäläinen [ 2014-02-18 ]

MariaDB 5.5.35 was now uploaded to Debian with soname libmariadbclient.

Debian issue https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732967 is now closed but I leave this open here at MariaDB so that we can re-visit the design decision later and come up with a better long term solution.

Comment by Otto Kekäläinen [ 2014-03-03 ]

For MariaDB 5.5.36 I removed the line

sed -i 's/mysqlclient/mariadbclient/g' libmysql/libmysql.ver.in

and replace it with

sed -i 's/mysqlclient/mariadbclient/g' libmysql/libmysql_versions.ld.in

https://github.com/ottok/mariadb-5.5/commit/a18bca2

Comment by Otto Kekäläinen [ 2014-04-26 ]

serg monty For your information, MySQL 5.6 in Debian has been packaged with shared filename 18.1: http://anonscm.debian.org/gitweb/?p=pkg-mysql/mysql-5.6.git;a=blob;f=debian/libmysqlclient18.1.install

..but it was pointed out that it isn't the proper thing to do: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741200

..and now MySQL 5.6 does not have any libmysqlclient18 package at all: https://packages.debian.org/source/experimental/mysql-5.6

The changelog at http://anonscm.debian.org/gitweb/?p=pkg-mysql/mysql-5.6.git;a=blob;f=debian/changelog states

d/control,rules: Drop libmysqlclient18.1* and libmysqld-5.6* due to conflicts
with libmysqlclient{18}-dev and incorrect SONAME naming (Closes: #741200).
NOTE: libmysqlclient* and libmysqld* can be re-instated when the 5.5->5.6
transition happens.

This is just background information in case some new ideas would stem out of it. At the moment I myself don't have any new ideas how to optimally do this.

Comment by Otto Kekäläinen [ 2014-04-26 ]

This Debian bug filed against MariaDB 5.5 is partly related, any advice on how to solve it? https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742172

Comment by Otto Kekäläinen [ 2014-07-05 ]

There is a person working on packaging the MariaDB LGPL packages: http://people.debian.org/~schepler/mariadb-client-lgpl/

Is the MariaDB LGPL libmariadb.so at least as good as the MySQL originated libmysqlclient18.so (even if not as good as the MariaDB originated libmysqlclient18.so)? Can we in Debian start using the LGPL library and put it inside the package libmariadbclient and call it libmariadbclient20.so or something?

Comment by Otto Kekäläinen [ 2014-08-30 ]

MariaDB LPGL client libs have passed the NEW queue and entered Debian: https://tracker.debian.org/pkg/mariadb-client-lgpl

Should I ditch the whole libmariadbclient (and libmariadbclient-dev) package and only provide mariadb-client-lgpl (and the three binary packages in creates)?

Comment by Sergei Golubchik [ 2014-09-04 ]

Yes, I think so. There's no much sense in providing libmariadbclient library, if it cannot be used as a drop-in replacement for libmysqlclient.

Comment by Elena Stepanova [ 2014-10-19 ]

otto, serg,

Is there anything left to do in the scope of this issue, or can it be closed now?

Comment by Otto Kekäläinen [ 2014-10-19 ]

I did this change some days ago: http://anonscm.debian.org/cgit/pkg-mysql/mariadb-10.0.git/commit/?id=24ed76b33cb076ef886b9637d96aa310cb8efa88

This issue has not come to a period yet and is still worth keeping open.

It would also be good if the author of the lgpl library would participate in the discussion and give his opinion if the latest mariadb-client-lgpl is on par with libmariadbclient shared library API's.

Comment by Elena Stepanova [ 2014-10-19 ]

georg, see above.

Comment by Georg Richter [ 2014-10-20 ]

Please note that the LGPL licensed MariaDB client library ( https://mariadb.com/kb/en/mariadb/client-libraries/client-library-for-c/) also provides libmariadb.so and libmaridbclient.a

Comment by Otto Kekäläinen [ 2014-10-20 ]

I didn't spot a libmariadbclient.a, only a libmariadb.a.

Here are the file listings of the binary packages as created from the mariadb-client-lgpl source package in Debian:
https://packages.debian.org/sid/amd64/libmariadb2/filelist
https://packages.debian.org/sid/amd64/libmariadb-client-lgpl-dev-compat/filelist
https://packages.debian.org/sid/amd64/libmariadb-client-lgpl-dev/filelist

georgrichter Is there a documentation somewhere that lists the symbols of the LGPL library vs. old libmysqlclient18.so? Or something else where we can read up on what the status of the new LGPL library is and what features are still missing so that it would be on par with the old library?

Comment by Otto Kekäläinen [ 2014-11-06 ]

I'd like to get the comments from georg or georgrichter before I put an period to this issue, thanks!

Comment by Georg Richter [ 2014-11-07 ]

LGPL Mariadb client library provides

libmariadbclient.a
libmariadb.so -> libmariadb.so.2
libmariadb.so.2

if it was builded with mysql compatibility fag (default) additionally:
libmysqlclient.a -> libmariadbclient.a
libmysqlclient_r.so -> libmariadb.so
ibmysqlclient.so -> libmariadb.so
libmysql.so -> libmariadb.so

Comment by Otto Kekäläinen [ 2014-11-23 ]

georg Apparently the mariadb_config is not yet as featureful as mysql_config? See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770650

Comment by Otto Kekäläinen [ 2016-11-25 ]

These are now fixed in multiple steps, among others in https://github.com/MariaDB/server/commit/dcfe6cb834b8106e384e24ac038cf6a6456fa9ee

From 10.2 onwards we have libmariadb3 and for backwards compatibliity symlinked libmariadbclient and libmysqlclient.

Generated at Thu Feb 08 07:04:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.