[MXS-3770] Bundle Connector-C plugins with MaxScale Created: 2021-09-16  Updated: 2021-09-28  Resolved: 2021-09-24

Status: Closed
Project: MariaDB MaxScale
Component/s: Packaging
Affects Version/s: None
Fix Version/s: 6.2.0

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

The Connector-C plugins used with MaxScale must be compatible with the version MaxScale uses. Since we also build the plugins, we could bundle them with MaxScale and change the default value of connector_plugindir to point to these plugins.



 Comments   
Comment by markus makela [ 2021-09-16 ]

Should be as simple as:

diff --git a/cmake/BuildMariaDBConnector.cmake b/cmake/BuildMariaDBConnector.cmake
index d6c9be1bd..1df865c1b 100644
--- a/cmake/BuildMariaDBConnector.cmake
+++ b/cmake/BuildMariaDBConnector.cmake
@@ -36,3 +36,5 @@ set(MARIADB_CONNECTOR_STATIC_LIBRARIES
 set(MARIADB_CONNECTOR_LIBRARIES
   ${CMAKE_BINARY_DIR}/connector-c/install/lib/mariadb/libmariadbclient.a
   CACHE INTERNAL "")
+
+install_directory(${CMAKE_BINARY_DIR}/connector-c/install/lib/mariadb/plugin ${MAXSCALE_LIBDIR} core)
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index 49467369f..95ab5b83c 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -23,7 +23,7 @@ set(DEFAULT_EXEC_SUBPATH "${MAXSCALE_BINDIR}" CACHE PATH "Default executable sub
 set(DEFAULT_CONFIG_SUBPATH "etc" CACHE PATH "Default configuration subpath")
 set(DEFAULT_CONFIG_PERSIST_SUBPATH "maxscale.cnf.d" CACHE PATH "Default persisted configuration subpath")
 set(DEFAULT_MODULE_CONFIG_SUBPATH "${DEFAULT_CONFIG_SUBPATH}/maxscale.modules.d" CACHE PATH "Default configuration subpath")
-set(DEFAULT_CONNECTOR_PLUGIN_SUBPATH "${CMAKE_INSTALL_LIBDIR}/mysql/plugin" CACHE PATH "Default connector plugin subpath")
+set(DEFAULT_CONNECTOR_PLUGIN_SUBPATH "${MAXSCALE_LIBDIR}/plugin" CACHE PATH "Default connector plugin subpath")
 
 set(DEFAULT_PIDDIR ${MAXSCALE_VARDIR}/${DEFAULT_PID_SUBPATH} CACHE PATH "Default PID file directory")
 set(DEFAULT_LOGDIR ${MAXSCALE_VARDIR}/${DEFAULT_LOG_SUBPATH} CACHE PATH "Default log directory")

Comment by markus makela [ 2021-09-16 ]

Did a quick test with this and it seemed to work locally. Testing it in the CI system caused it to fail in odd ways: needs more investigation.

Comment by markus makela [ 2021-09-23 ]

Turns out the problem was in the test itself, not in the plugin usage.

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