Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-456

Implement INSTALL_PLUGINDIR build flag that only applies to MariaDB Connector C / MariaDB client

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.1.7
    • 3.1.8
    • None
    • None

    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
      

      Attachments

        Issue Links

          Activity

            otto Otto Kekäläinen added a comment - - edited

            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?

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

            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?

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

            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")
            

            otto Otto Kekäläinen added a comment - - edited 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")

            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.

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

            georg Any chance you could have a look at this?

            otto Otto Kekäläinen added a comment - georg Any chance you could have a look at this?
            georg Georg Richter added a comment -

            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()
            

            georg Georg Richter added a comment - 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()
            otto Otto Kekäläinen added a comment - PR https://github.com/mariadb-corporation/mariadb-connector-c/pull/130 will fix this
            otto Otto Kekäläinen added a comment - PR merged and issue fixed in https://github.com/mariadb-corporation/mariadb-connector-c/commit/28e1467475e5e4cc113e031291e8371d3a2a9c36

            People

              otto Otto Kekäläinen
              otto Otto Kekäläinen
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.