MDEV-40608 MariaDB-devel is incomplete for plugins - #5486
Conversation
|
|
|
@vaintroub FYI, it's a draft, I'm not proposing it for a merge yet. But see the direction. |
There was a problem hiding this comment.
Pull request overview
Adds an installable CMake config intended to make the MariaDB development package usable for building plugins, and refactors plugin CMake plumbing to support that packaging.
Changes:
- Introduces
support-files/mariadb-plugin-config.cmake.inand installs the configured result into${INSTALL_SHAREDIR}/cmake/mariadb-plugin/. - Refactors plugin discovery to live in the top-level
CMakeLists.txtand introducesVERIFY_PLUGINS()incmake/plugin.cmake. - Renames the primary plugin macro to
MARIADB_ADD_PLUGINwhile keepingMYSQL_ADD_PLUGINas a compatibility wrapper.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| support-files/mariadb-plugin-config.cmake.in | New installed CMake config template intended for plugin consumers. |
| support-files/CMakeLists.txt | Generates/installs the new plugin config CMake file. |
| CMakeLists.txt | Moves plugin subdirectory enumeration into the top-level build and calls VERIFY_PLUGINS(). |
| cmake/plugin.cmake | Introduces MARIADB_ADD_PLUGIN, keeps MYSQL_ADD_PLUGIN wrapper, and adds VERIFY_PLUGINS(). |
| .gitignore | Ignores the generated support-files/mariadb-plugin-config.cmake. |
you mean "find_package(mariadb-plugin CONFIG REQUIRED)" . Yes, I thought about something like that |
667da4a to
0c00074
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Suppressed comments (2)
support-files/mariadb-plugin-config.cmake.in:18
- should-fix:
support-files/mariadb-plugin-config.cmake.in:17-18computesbasedirfrom the installed location, butinstall_layout.cmakederives*DIRABSfromCMAKE_INSTALL_PREFIX(which defaults to/usr/localin a fresh external plugin build). This can cause external plugins to install into the wrong prefix unless the user manually sets-DCMAKE_INSTALL_PREFIX. Consider defaulting the install prefix to the detected MariaDB base dir when the prefix is still the CMake default.
SET(SERVER_VERSION @SERVER_VERSION@)
GET_FILENAME_COMPONENT(basedir "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
support-files/mariadb-plugin-config.cmake.in:53
- nit:
support-files/mariadb-plugin-config.cmake.in:49-53validates that the minor version fits in a byte, butPLUGIN_HEX_VERSIONalso encodes the major version asmajor*256+minor. If major exceeds 255, the encoding can overflow the intended 16-bit range / mismatch expectations.
IF(NOT ARG_VERSION MATCHES "^([0-9]+)\\.([0-9]+)" OR CMAKE_MATCH_2 GREATER 255)
MESSAGE(FATAL_ERROR "Plugin ${plugin} has no or invalid VERSION")
ENDIF()
SET(V_MAJOR ${CMAKE_MATCH_1})
SET(V_MINOR ${CMAKE_MATCH_2})
* create and install mariadb-plugin-config.cmake * adjust plugin.cmake to work for external plugins * move server-internal part to top-level CMakeLists.txt * remove WITH_WSREP from my_config.h (it upsets external plugins) * remove double-defined macros from unireg.h (the guard doesn't help if unireg.h is included first) ColumnStore, until fixed, needs a backward-compatibility workaround
0c00074 to
2cb8979
Compare
create and install mariadb-plugin-config.cmake