MariaDB Development
  1. MariaDB Development
  2. MDEV-5482

Rename libmysqclient files and sonames to libmariadbclient

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.0.7, 5.5.34, 5.3.12, 5.2.14, 5.1.67
    • Fix Version/s: None
    • Labels:
    • Environment:
      Debian/Ubuntu
    • Global Rank:
      4135

      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/pkg-mariadb.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.

        Activity

        Hide
        Michael Widenius added a comment -

        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

        Show
        Michael Widenius added a comment - 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
        Hide
        Otto Kekäläinen added a comment -

        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.

        Show
        Otto Kekäläinen added a comment - 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.
        Hide
        Otto Kekäläinen added a comment -

        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.

        Show
        Otto Kekäläinen added a comment - 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.
        Hide
        Otto Kekäläinen added a comment -

        Thanks to Sergei Golubchik 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

        Show
        Otto Kekäläinen added a comment - Thanks to Sergei Golubchik 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
        Hide
        Otto Kekäläinen added a comment -

        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.

        Show
        Otto Kekäläinen added a comment - 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.
        Hide
        Otto Kekäläinen added a comment -

        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.

        Show
        Otto Kekäläinen added a comment - 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.
        Hide
        Otto Kekäläinen added a comment -

        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

        Show
        Otto Kekäläinen added a comment - 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

          People

          • Assignee:
            Unassigned
            Reporter:
            Otto Kekäläinen
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: