Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33420

HASHICORP_KEY_MANAGEMENT fails on Windows with libcurl installed

Details

    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
      

      Attachments

        Issue Links

          Activity

            sysprg Julius Goryavsky added a comment - Fix merged with head revision: https://github.com/MariaDB/server/commit/11aeef2aa2696e5fca26c0606c7da575b1044e66

            sysprg thank you for merge.
            I don't see any changes you have merged wrt PR on GitHub.
            In this situation one should just close fully functional PR leaving bad statistic in GitHub, what is not good.
            I would appreciate if you could merge my PR in 11.4 branch.
            I have rebased the PR on top of 11.4 (before it gets from 10.11 to 11.4).
            Thanks

            anel Anel Husakovic added a comment - sysprg thank you for merge. I don't see any changes you have merged wrt PR on GitHub. In this situation one should just close fully functional PR leaving bad statistic in GitHub, what is not good. I would appreciate if you could merge my PR in 11.4 branch. I have rebased the PR on top of 11.4 (before it gets from 10.11 to 11.4). Thanks

            I don't think we can merge the same commit twice.

            It's unfortunate that github doesn't allow to mark the commit as "merged" explicitly. All I think we can do now is to close it with the comment "Merged"

            serg Sergei Golubchik added a comment - I don't think we can merge the same commit twice. It's unfortunate that github doesn't allow to mark the commit as "merged" explicitly. All I think we can do now is to close it with the comment "Merged"

            It is not supposed to be the same commit

            • one is on 10.11 (that is already merged),
            • other should be on 11.4, PR that is rebased to the last branch that currently doesn't have commit from 10.11 (that should be merged via GitHub).

            In regular merge process from 10.11- 11.4, you will skip 11.4, since it will need rebase, that will change commit hash, so having different hashes in different branches shouldn't the problem and is still fixable.
            This can be done, and shouldn't be problem, I'm pretty sure.

            sysprg I appreciate your time and work and have no problem that you closed my PR and bad statistics (even though I still think it can be fixed) , but for other contributors outside of MariaDB this may be bigger problem.
            Kind regards,
            Anel

            anel Anel Husakovic added a comment - It is not supposed to be the same commit one is on 10.11 (that is already merged), other should be on 11.4, PR that is rebased to the last branch that currently doesn't have commit from 10.11 (that should be merged via GitHub). In regular merge process from 10.11- 11.4, you will skip 11.4, since it will need rebase, that will change commit hash, so having different hashes in different branches shouldn't the problem and is still fixable. This can be done, and shouldn't be problem, I'm pretty sure. sysprg I appreciate your time and work and have no problem that you closed my PR and bad statistics (even though I still think it can be fixed) , but for other contributors outside of MariaDB this may be bigger problem. Kind regards, Anel

            Added post-fix corrections (after testing on the main buildbot): https://github.com/MariaDB/server/commit/8fd515e0d24de7e437d988aebfa4cc43af7a2fb0

            sysprg Julius Goryavsky added a comment - Added post-fix corrections (after testing on the main buildbot): https://github.com/MariaDB/server/commit/8fd515e0d24de7e437d988aebfa4cc43af7a2fb0

            People

              sysprg Julius Goryavsky
              anel Anel Husakovic
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.