[CONC-397] Unfortunate error message for incompatible cmake config Created: 2019-02-18  Updated: 2019-03-24

Status: Stalled
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Aleksey Midenkov Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: cmake


 Description   

libmariadb configure fails when have PLUGIN_CLIENT_ED25519 in CMakeCache.txt from older version. Error message doesn't have a clue of how to fix the problem.

Reproduce

cmake -DPLUGIN_CLIENT_ED25519:STRING=NO ../src

Result

CMake Error at libmariadb/cmake/plugins.cmake:46 (message):
  Invald plugin type NO.  Allowed plugin types are DYNAMIC;STATIC;OFF
Call Stack (most recent call first):
  libmariadb/plugins/auth/CMakeLists.txt:45 (REGISTER_PLUGIN)
  libmariadb/plugins/CMakeLists.txt:7 (INCLUDE)
  libmariadb/CMakeLists.txt:383 (INCLUDE)

Debug code

--- a/cmake/plugins.cmake
+++ b/cmake/plugins.cmake
@@ -23,9 +23,11 @@ FUNCTION(REGISTER_PLUGIN)
 
   # overwrite default if it was specified with cmake option
   string(TOUPPER ${CC_PLUGIN_TARGET} cc_plugin)
+  message("1 ${CC_PLUGIN_DEFAULT}")
   if(NOT "${CLIENT_PLUGIN_${cc_plugin}}" STREQUAL "")
     SET(CC_PLUGIN_DEFAULT ${CLIENT_PLUGIN_${cc_plugin}})
   endif()
+  message("2 ${CC_PLUGIN_DEFAULT}")
 
   # use uppercase
   string(TOUPPER ${CC_PLUGIN_TARGET} target_name)
@@ -35,6 +37,7 @@ FUNCTION(REGISTER_PLUGIN)
     string(TOUPPER ${PLUGIN_${target_name}} PLUGIN_${target_name})
     set(CC_PLUGIN_DEFAULT ${PLUGIN_${target_name}})
   endif()
+  message("3 ${CC_PLUGIN_DEFAULT} ${target_name}")
 
 # check if default value is valid
   string(TOUPPER ${CC_PLUGIN_DEFAULT} CC_PLUGIN_DEFAULT)

Note

Help string for PLUGIN_AUTH_ED25519:

How to build plugin AUTH_ED25519. Options are: NO STATIC DYNAMIC YES AUTO



 Comments   
Comment by Aleksey Midenkov [ 2019-02-18 ]

Leftover config from older version. There is no such option now. But probably this can be a tip if someone will get something similar.

Comment by Sergei Golubchik [ 2019-03-24 ]

A simple improvement could be to change the error message to

Invald plugin type PLUGIN_CLIENT_ED25519=NO.  Allowed plugin types are DYNAMIC;STATIC;OFF

Or in somewhat better language

PLUGIN_CLIENT_ED25519 has an invalid value NO.  Allowed values are DYNAMIC, STATIC, and OFF

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