[MDEV-33420] HASHICORP_KEY_MANAGEMENT fails on Windows with libcurl installed Created: 2024-02-07  Updated: 2024-02-07

Status: Open
Project: MariaDB Server
Component/s: Configuration
Affects Version/s: 10.5.23
Fix Version/s: 10.5

Type: Bug Priority: Major
Reporter: Anel Husakovic Assignee: Julius Goryavsky
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows


Issue Links:
Relates
relates to MDBF-644 install libcurl on amd64-builder In Progress

 Description   

Install libcurl and build the binaries

>> cmake ../server -A x64 -DPLUGIN_ROCKSDB=NO -DMYSQL_MAINTAINER_MODE=ERR -Wno-dev -DCURL_LIBRARY=C:/ProgramData/chocolatey/lib/curl/tools/curl-7.85.0-win64-mingw/lib/libcurl.dll.a -DCURL_INCLUDE_DIR=C:/ProgramData/chocolatey/lib/curl/tools/curl-7.85.0-win64-mingw/include
-- Found CURL: C:/ProgramData/chocolatey/lib/curl/tools/curl-7.85.0-win64-mingw/lib/libcurl.dll.a (found version "7.85.0")
 
>> cmake --build . --verbose --config Debug -- -m
 
       "C:\Users\Administrator\Desktop\anel\bld\ALL_BUILD.vcxproj" (default target) (1) ->
       "C:\Users\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj" (default target) (13) ->
       (ClCompile target) ->
         C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(219,37): warning C4101: 'e': unreferenced local variable [C:\User
       s\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(219,37): warning C4101:     catch (const std::out_of_range &e) [C:\
       Users\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(219,37): warning C4101:                                     ^ [C:\U
       sers\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
         C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(254,35): warning C4101: 'e': unreferenced local variable [C:\User
       s\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(254,35): warning C4101:   catch (const std::out_of_range &e) [C:\Us
       ers\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(254,35): warning C4101:                                   ^ [C:\Use
       rs\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
         C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(313,35): warning C4101: 'e': unreferenced local variable [C:\User
       s\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(313,35): warning C4101:   catch (const std::out_of_range &e) [C:\Us
       ers\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(313,35): warning C4101:                                   ^ [C:\Use
       rs\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
         C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(341,35): warning C4101: 'e': unreferenced local variable [C:\User
       s\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(341,35): warning C4101:   catch (const std::out_of_range &e) [C:\Us
       ers\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(341,35): warning C4101:                                   ^ [C:\Use
       rs\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
 
 
       "C:\Users\Administrator\Desktop\anel\bld\ALL_BUILD.vcxproj" (default target) (1) ->
       "C:\Users\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj" (default target) (13) ->
       (ClCompile target) ->
         C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(219,37): error C2220: the following warning is treated as an erro
       r [C:\Users\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(219,37): error C2220:     catch (const std::out_of_range &e) [C:\Us
       ers\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(219,37): error C2220:                                     ^ [C:\Use
       rs\Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
         C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(985,8): error C2065: 'overwrite': undeclared identifier [C:\Users
       \Administrator\Desktop\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(985,8): error C2065:   if (!overwrite) [C:\Users\Administrator\Desk
       top\anel\bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
       C:\Users\Administrator\Desktop\anel\server\plugin\hashicorp_key_management\hashicorp_key_management_plugin.cc(985,8): error C2065:        ^ [C:\Users\Administrator\Desktop\anel\
       bld\plugin\hashicorp_key_management\hashicorp_key_management.vcxproj]
 
    4 Warning(s)
    2 Error(s)

The bug was found as part of MDEV-30432 where for connect SE libcurl is properly built and linked

# Only building connect module 
>> cmake --build . --verbose --config Debug --target connect -- -m
 
>> dumpbin /dependents storage\connect\Debug\ha_connect.dll
Microsoft (R) COFF/PE Dumper Version 14.33.31630.0
Copyright (C) Microsoft Corporation.  All rights reserved.
 
 
Dump of file storage\connect\Debug\ha_connect.dll
 
File Type: DLL
 
  Image has the following dependencies:
 
    ODBC32.dll
    IPHLPAPI.DLL
    libcurl-x64.dll
    server.dll
    KERNEL32.dll
    USER32.dll
    ole32.dll
    OLEAUT32.dll
    ADVAPI32.dll
    WS2_32.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-utility-l1-1-0.dll

Suggested fix

--- a/plugin/hashicorp_key_management/CMakeLists.txt
+++ b/plugin/hashicorp_key_management/CMakeLists.txt
@@ -1,5 +1,5 @@
 INCLUDE(FindCURL)
-IF(NOT CURL_FOUND)
+IF(NOT CURL_FOUND OR WIN32)
   # Can't build plugin



 Comments   
Comment by Vladislav Vaintroub [ 2024-02-07 ]

anel, I think it makes sense to list the hashicorp errors in the build

Comment by Anel Husakovic [ 2024-02-07 ]

Yes, sure, have added,thanks .

Generated at Thu Feb 08 10:38:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.