[CONC-456] Implement INSTALL_PLUGINDIR build flag that only applies to MariaDB Connector C / MariaDB client Created: 2020-02-27  Updated: 2020-04-13  Resolved: 2020-04-05

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.1.7
Fix Version/s: 3.1.8

Type: Bug Priority: Major
Reporter: Otto Kekäläinen Assignee: Otto Kekäläinen
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Blocks
blocks MDEV-6284 Merge downstream Debian/Ubuntu packag... Closed
is blocked by MDEV-22053 Missing support for Debian Install La... Closed

 Description   

Currently libmariadb3.install packaging for Debian in upstream MariaDB looks like this:

usr/lib/*/libmariadb.so.*
usr/lib/mysql/plugin/client_ed25519.so
usr/lib/mysql/plugin/dialog.so
usr/lib/mysql/plugin/mysql_clear_password.so
usr/lib/mysql/plugin/sha256_password.so
usr/lib/mysql/plugin/client_ed25519.so

This has two problems:

  • plugins paths are not multi-archified
  • plugin paths are not versioned

In Debian official repos this is fixed like this:

usr/lib/*/libmariadb.so.*
usr/lib/*/mariadb19/plugin/client_ed25519.so
usr/lib/*/mariadb19/plugin/dialog.so
usr/lib/*/mariadb19/plugin/mysql_clear_password.so

This is however not an ideal fix.

First of all the path name mariadb19 is inherited from the server INSTALL_PLUGINDIR. This is set in debian/rules for the entire server+client build. The server binaries end up in a versioned path which isn't necessary. There should be a separate INSTALL_PLUGINDIR_CLIENT or something.

Secondly, the mariadb19 reflects the server ABI "version". For client stuff is should reflect the client version, so a better name would be for example mariadb3, libmariadb3 or mariadbclient3.

Implementing something like INSTALL_PLUGINDIR_CLIENT would allow to set this.

Eventually I would like to have this libmariadb3.install:

usr/lib/*/libmariadb.so.*
usr/lib/*/mariadb3/client_ed25519.so
usr/lib/*/mariadb3/dialog.so
usr/lib/*/mariadb3/mysql_clear_password.so

And one day, somewhere far far away, in libmariadb4.install:

usr/lib/*/libmariadb.so.*
usr/lib/*/mariadb4/client_ed25519.so
usr/lib/*/mariadb4/dialog.so
usr/lib/*/mariadb4/mysql_clear_password.so



 Comments   
Comment by Otto Kekäläinen [ 2020-02-27 ]

I just noticed in https://jira.mariadb.org/browse/MDEV-6135 a link to https://github.com/mariadb-corporation/mariadb-connector-c/commit/c1a5ed4d13c7bbe9eda6465ecc8dec9324e836a0#diff-87364c4677e09f50088671831b8ad597R93

So there was already an attempt at this, but the commit was not documented and it is still unclear to me how it is intended to be used?

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

Implementing this would essentially automatically solve both https://jira.mariadb.org/browse/MDEV-6135 and much of https://jira.mariadb.org/browse/MDEV-7664. I wish georg could take a look at this in the following weeks?

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

So this section in libmariadb/cmake/install.cmake should somehow be changed to define only for the client libraries the path /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/mariadb3/ ?

#
# DEB layout
#
SET(INSTALL_BINDIR_DEB "bin")
SET(INSTALL_LIBDIR_DEB "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
SET(INSTALL_PCDIR_DEB "lib/pkgconfig")
IF(PLUGINDIR_DEB)
  SET(INSTALL_PLUGINDIR_DEB "${INSTALL_LIBDIR_DEB}/${PLUGINDIR_DEB}/plugin")
ELSE()
  SET(INSTALL_PLUGINDIR_DEB "${INSTALL_LIBDIR_DEB}/mariadb/plugin")
ENDIF()
SET(INSTALL_INCLUDEDIR_DEB "include/mariadb")
SET(LIBMARIADB_STATIC_DEB "mariadb")

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

I tried to create a patch myself in https://salsa.debian.org/mariadb-team/mariadb-10.4/-/compare/master...feature%2Flibmariadb3-versioned-path but the build does not seem to apply the `INSTALL_PLUGINDIR_DEB` does not seem to apply to the build itself and client library plugins end up in the same usr/lib/x86_64-linux-gnu/mysql/plugin as server plugins.

Comment by Otto Kekäläinen [ 2020-03-14 ]

georg Any chance you could have a look at this?

Comment by Georg Richter [ 2020-03-26 ]

Hi Otto, I added now version number to plugindir (rev. 35860360690f0b10c87cdf06263a73cf8fa6ae9c)

IF(PLUGINDIR_DEB)
  SET(INSTALL_PLUGINDIR_DEB "${INSTALL_LIBDIR_DEB}/${PLUGINDIR_DEB}/plugin")
ELSE()
  SET(INSTALL_PLUGINDIR_DEB "${INSTALL_LIBDIR_DEB}/mariadb${CPACK_PACKAGE_VERSION_MAJOR}/plugin")
ENDIF()

Comment by Otto Kekäläinen [ 2020-03-26 ]

PR https://github.com/mariadb-corporation/mariadb-connector-c/pull/130 will fix this

Comment by Otto Kekäläinen [ 2020-04-05 ]

PR merged and issue fixed in https://github.com/mariadb-corporation/mariadb-connector-c/commit/28e1467475e5e4cc113e031291e8371d3a2a9c36

Generated at Thu Feb 08 03:05:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.