Otto Kekäläinen <o...@debian.org> writes: > 2016-10-30 1:45 GMT+03:00 Kristian Nielsen <kniel...@knielsen-hq.org>:
>> Maybe something like this is needed on the cmake command? >> >> -DINSTALL_PLUGINDIR=/usr/lib/x86_64-linux-gnu/mysql/lib18/plugin >> (This build option seems to be shared between the server plugins and the >> client plugins, which seems a bit of a mess, and might require a separate >> build for the server package and the client library package - but maybe that >> is already the case anyway?) > > I tried this avenue but indeed the PLUGINDIR parameter then also > changes where all the server plugins (TokuDB, Spider etc) are > installed, so that is not an option. > > Can you Kristian help us introduce in the makefiles a new parameter > CLIENTPLUGINDIR? Something like the attached patch could work. But what is the problem with putting the server plugins into an arch-dependent location as well? I discussed this briefly with Serg on IRC, he also suggested that. It seems simpler if all the plugins are in the same place, and there does not seem to be any harm in having server plugins with arch-dependent paths as well. > Or what if we keep the PLUGINDIR=lib/mysql/plugin but then in a later > stage in the rules file move the two client plugins? > mv lib/mysql/plugin/dialog.so > lib/$(DEB_HOST_MULTIARCH)/mariadb-lib18/plugin > mv lib/mysql/plugin/mysql_clear_password.so > lib/$(DEB_HOST_MULTIARCH)/mariadb-lib18/plugin The CMake option is not so much about where `make install` puts the files, but about where the server and client library looks to find the plugins at runtime. Otherwise we would need --plugindir options in my.cnf. > (For reference, in mariadb-connector-c shared libs are built with > 'dh_makeshlibs -X/mariadb/plugin/' and installed to > usr/lib/*/mariadb/plugin/*.so, and it has 'Multi-Arch: same' - see > https://anonscm.debian.org/cgit/pkg-mysql/mariadb-client-lgpl.git/tree/debian) So with usr/lib/*/ you mean for example usr/lib/x86_64-linux-gnu/, right? Seems just one more reason to do the same for the client library built from the 10.0 server sources. Wouldn't just doing this solve the problem? I did not so far get a definite answer as to whether client plugins are compatible with all major library versions or just the one they were built against. Since MariaDB never changed the major library version so far, it may not have a meaningful answer defined. But again, it seems safe enough to just include the major version number in the plugin path. It does not hurt, it satisfies Debian policy, and it makes things simpler if in the future a major version .so bump happens. - Kristian.
commit 9abe77a3c268d804ac99498f62e47d6467eaf08f (cmake_install_clientplugindir) Author: Kristian Nielsen <kniel...@knielsen-hq.org> Date: Thu Nov 10 09:44:04 2016 +0100 Add CMake -DINSTALL_CLIENTPLUGINDIR option for cmake. Idea is to be able to specify a separate location for client plugins than for server plugins. diff --git a/CMakeLists.txt b/CMakeLists.txt index 0adbb85..b4f88ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -318,6 +318,10 @@ ELSE() ENDIF() SET(DEFAULT_CHARSET_HOME "${DEFAULT_MYSQL_HOME}") SET(PLUGINDIR "${DEFAULT_MYSQL_HOME}/${INSTALL_PLUGINDIR}") +SET(INSTALL_CLIENTPLUGINDIR "${INSTALL_PLUGINDIR}" + CACHE STRING "CLIENTPLUGINDIR installation directory") +MARK_AS_ADVANCED(INSTALL_CLIENTPLUGINDIR) +SET(CLIENTPLUGINDIR "${DEFAULT_MYSQL_HOME}/${INSTALL_CLIENTPLUGINDIR}") IF(INSTALL_SYSCONFDIR AND NOT DEFAULT_SYSCONFDIR) SET(DEFAULT_SYSCONFDIR "${INSTALL_SYSCONFDIR}") ENDIF() diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index e1d2af2..27e9ec9 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -30,7 +30,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) MACRO(MYSQL_ADD_PLUGIN) MYSQL_PARSE_ARGUMENTS(ARG "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" - "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED" + "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENTPLUGIN" ${ARGN} ) @@ -214,8 +214,13 @@ MACRO(MYSQL_ADD_PLUGIN) ELSE() SET(ARG_COMPONENT Server) ENDIF() - MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT ${ARG_COMPONENT}) - #INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug COMPONENT ${ARG_COMPONENT}) + IF(ARG_CLIENTPLUGIN) + SET(PLUGIN_DESTINATION "${INSTALL_CLIENTPLUGINDIR}") + ELSE() + SET(PLUGIN_DESTINATION "${INSTALL_PLUGINDIR}") + ENDIF() + MYSQL_INSTALL_TARGETS(${target} DESTINATION ${PLUGIN_DESTINATION} COMPONENT ${ARG_COMPONENT}) + #INSTALL_DEBUG_TARGET(${target} DESTINATION ${PLUGIN_DESTINATION}/debug COMPONENT ${ARG_COMPONENT}) ELSE() IF(WITHOUT_${plugin}) # Update cache variable diff --git a/config.h.cmake b/config.h.cmake index 1fd1341..3d2a51b 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -630,6 +630,7 @@ #cmakedefine MYSQL_DATADIR "@MYSQL_DATADIR@" #cmakedefine DEFAULT_CHARSET_HOME "@DEFAULT_CHARSET_HOME@" #cmakedefine PLUGINDIR "@PLUGINDIR@" +#cmakedefine CLIENTPLUGINDIR "@CLIENTPLUGINDIR@" #cmakedefine DEFAULT_SYSCONFDIR "@DEFAULT_SYSCONFDIR@" #cmakedefine DEFAULT_TMPDIR @DEFAULT_TMPDIR@ diff --git a/plugin/audit_null/CMakeLists.txt b/plugin/audit_null/CMakeLists.txt index e87fc2a..34e067a 100644 --- a/plugin/audit_null/CMakeLists.txt +++ b/plugin/audit_null/CMakeLists.txt @@ -14,4 +14,4 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA MYSQL_ADD_PLUGIN(audit_null audit_null.c - MODULE_ONLY MODULE_OUTPUT_NAME "adt_null" COMPONENT Test) + MODULE_ONLY CLIENTPLUGIN MODULE_OUTPUT_NAME "adt_null" COMPONENT Test) diff --git a/plugin/auth_dialog/CMakeLists.txt b/plugin/auth_dialog/CMakeLists.txt index a235180..dc4be5b 100644 --- a/plugin/auth_dialog/CMakeLists.txt +++ b/plugin/auth_dialog/CMakeLists.txt @@ -15,4 +15,4 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA MYSQL_ADD_PLUGIN(dialog dialog.c ${CMAKE_SOURCE_DIR}/libmysql/get_password.c - MODULE_ONLY COMPONENT ClientPlugins) + MODULE_ONLY CLIENTPLUGIN COMPONENT ClientPlugins) diff --git a/plugin/auth_examples/CMakeLists.txt b/plugin/auth_examples/CMakeLists.txt index c7b7e5b..2add4ab 100644 --- a/plugin/auth_examples/CMakeLists.txt +++ b/plugin/auth_examples/CMakeLists.txt @@ -15,19 +15,19 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA MYSQL_ADD_PLUGIN(dialog_examples dialog_examples.c - MODULE_ONLY COMPONENT Test) + MODULE_ONLY CLIENTPLUGIN COMPONENT Test) MYSQL_ADD_PLUGIN(auth_test_plugin test_plugin.c - MODULE_ONLY COMPONENT Test) + MODULE_ONLY CLIENTPLUGIN COMPONENT Test) MYSQL_ADD_PLUGIN(qa_auth_interface qa_auth_interface.c - MODULE_ONLY COMPONENT Test) + MODULE_ONLY CLIENTPLUGIN COMPONENT Test) MYSQL_ADD_PLUGIN(qa_auth_server qa_auth_server.c - MODULE_ONLY COMPONENT Test) + MODULE_ONLY CLIENTPLUGIN COMPONENT Test) MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c - MODULE_ONLY COMPONENT Test) + MODULE_ONLY CLIENTPLUGIN COMPONENT Test) -MYSQL_ADD_PLUGIN(auth_0x0100 auth_0x0100.c MODULE_ONLY COMPONENT Test) +MYSQL_ADD_PLUGIN(auth_0x0100 auth_0x0100.c MODULE_ONLY CLIENTPLUGIN COMPONENT Test) MYSQL_ADD_PLUGIN(mysql_clear_password clear_password_client.c - MODULE_ONLY COMPONENT ClientPlugins) + MODULE_ONLY CLIENTPLUGIN COMPONENT ClientPlugins) diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt index 5131752..4cd3e98 100644 --- a/plugin/auth_pam/CMakeLists.txt +++ b/plugin/auth_pam/CMakeLists.txt @@ -8,6 +8,6 @@ IF(HAVE_PAM_APPL_H) IF(HAVE_STRNDUP) ADD_DEFINITIONS(-DHAVE_STRNDUP) ENDIF(HAVE_STRNDUP) - MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY) + MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY CLIENTPLUGIN) ENDIF(HAVE_PAM_APPL_H) diff --git a/plugin/auth_socket/CMakeLists.txt b/plugin/auth_socket/CMakeLists.txt index e4a8d1d..27937f7 100644 --- a/plugin/auth_socket/CMakeLists.txt +++ b/plugin/auth_socket/CMakeLists.txt @@ -65,6 +65,6 @@ ENDIF() ENDIF() IF(ok) - MYSQL_ADD_PLUGIN(auth_socket auth_socket.c) + MYSQL_ADD_PLUGIN(auth_socket auth_socket.c CLIENTPLUGIN) ENDIF() diff --git a/plugin/win_auth_client/CMakeLists.txt b/plugin/win_auth_client/CMakeLists.txt index 5d72d24..62ad122 100644 --- a/plugin/win_auth_client/CMakeLists.txt +++ b/plugin/win_auth_client/CMakeLists.txt @@ -29,7 +29,7 @@ IF(WIN32) MYSQL_ADD_PLUGIN(authentication_windows_client ${PLUGIN_SOURCES} ${HEADERS} LINK_LIBRARIES Secur32 - MODULE_ONLY COMPONENT ClientPlugins) + MODULE_ONLY CLIENTPLUGIN COMPONENT ClientPlugins) #IF(MSVC) # INSTALL_DEBUG_TARGET(auth_win_client DESTINATION ${INSTALL_LIBDIR}/debug) diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index dd87b01..01bd63d 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -360,7 +360,7 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, /* Compile dll path */ strxnmov(dlpath, sizeof(dlpath) - 1, mysql->options.extension && mysql->options.extension->plugin_dir ? - mysql->options.extension->plugin_dir : PLUGINDIR, "/", + mysql->options.extension->plugin_dir : CLIENTPLUGINDIR, "/", name, SO_EXT, NullS); DBUG_PRINT ("info", ("dlopeninig %s", dlpath));