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

            anel Anel Husakovic created issue -
            wlad Vladislav Vaintroub made changes -
            Field Original Value New Value
            Assignee Julius Goryavsky [ sysprg ]

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

            wlad Vladislav Vaintroub added a comment - anel , I think it makes sense to list the hashicorp errors in the build
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            Description Install {{libcurl}} and build the binaries
            {code:noformat}
            >> 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")
             
            The following features have been enabled:
             * CONNECT_REST, Support for REST API in the CONNECT storage engine
             
            >> # Only building connect module
             
            >> cmake --build . --verbose --config Debug --target connect -- -m
            {code}

            The bug was found as part of MDEV-30432 where for connect SE {{libcurl}} is properly built and linked
            {code:noformat}
            # 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
            {code}

            Suggested fix
            {code:noformat}
            --- 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
            {code}
            Install {{libcurl}} and build the binaries
            {code:noformat}
            >> 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")
             
            The following features have been enabled:
             * CONNECT_REST, Support for REST API in the CONNECT storage engine
             
            >> 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)

            {code}

            The bug was found as part of MDEV-30432 where for connect SE {{libcurl}} is properly built and linked
            {code:noformat}
            # 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
            {code}

            Suggested fix
            {code:noformat}
            --- 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
            {code}
            anel Anel Husakovic made changes -
            Description Install {{libcurl}} and build the binaries
            {code:noformat}
            >> 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")
             
            The following features have been enabled:
             * CONNECT_REST, Support for REST API in the CONNECT storage engine
             
            >> 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)

            {code}

            The bug was found as part of MDEV-30432 where for connect SE {{libcurl}} is properly built and linked
            {code:noformat}
            # 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
            {code}

            Suggested fix
            {code:noformat}
            --- 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
            {code}
            Install {{libcurl}} and build the binaries
            {code:noformat}
            >> 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)

            {code}

            The bug was found as part of MDEV-30432 where for connect SE {{libcurl}} is properly built and linked
            {code:noformat}
            # 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
            {code}

            Suggested fix
            {code:noformat}
            --- 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
            {code}

            Yes, sure, have added,thanks .

            anel Anel Husakovic added a comment - Yes, sure, have added,thanks .
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            Assignee Julius Goryavsky [ sysprg ] Anel Husakovic [ anel ]

            sysprg can you please review https://github.com/MariaDB/server/pull/3068 ?
            I tested on Windows and it compiles and builds correctly.I have tested with --suite=vault and tests are skipped.

            anel Anel Husakovic added a comment - sysprg can you please review https://github.com/MariaDB/server/pull/3068 ? I tested on Windows and it compiles and builds correctly.I have tested with --suite=vault and tests are skipped .
            anel Anel Husakovic made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            anel Anel Husakovic made changes -
            Assignee Anel Husakovic [ anel ] Julius Goryavsky [ sysprg ]
            Status Confirmed [ 10101 ] In Review [ 10002 ]
            anel Anel Husakovic made changes -
            anel Anel Husakovic made changes -
            danblack Daniel Black made changes -
            wlad Vladislav Vaintroub made changes -
            Priority Major [ 3 ] Blocker [ 1 ]
            wlad Vladislav Vaintroub added a comment - - edited

            Changing to "Blocker", because it is a part of a "Blocker" MDEV-33073

            wlad Vladislav Vaintroub added a comment - - edited Changing to "Blocker", because it is a part of a "Blocker" MDEV-33073
            wlad Vladislav Vaintroub added a comment - - edited

            sysprg, apparently, it did not compile without problems. And what's the point of HASHICORP_HAVE_EXCEPTIONS ? There is no functionality it gives, it only adds more lines of code.

            If you want to understand what is with MSVC, MSVC warns that you're give exception variable a name, e.g in "catch (const std::out_of_range &e)", e is a name

            But, in the catch block, you do not use the variable e.

            The below excerpt is from the bug description (admittedly a little hidden, but those who seek shall find)

            hashicorp_key_management_plugin.cc(219,37): warning C4101: 'e': unreferenced local variable
            

            hashicorp_key_management_plugin.cc(219,37): warning C4101:     catch (const std::out_of_range &e) 
            

            So this is exactly the warning. which turns to an error, because on buildbot, on Windows, the compilation is strict.

            Also, if "in your opinion", the code should compile without warnings, it still makes sense to consult a real compiler, to prove the intuition. Of course nobody would touch or even read that code if this would compile without problems, but as shown below, compiler had different opinion from yours.

            Upon examination, I noticed that all this HASHICORP_HAVE_EXCEPTIONS is obsolete, there is no advantage in using map.at() over map.find() in this case, so I suggested to remove the HASHICORP_HAVE_EXCEPTIONS , the map.at(), and the exception catching , for the sake of clarity, for the sake of brevity, and of course, to fix the compiler warning/error that draw out attention to this code in the first place.

            wlad Vladislav Vaintroub added a comment - - edited sysprg , apparently, it did not compile without problems. And what's the point of HASHICORP_HAVE_EXCEPTIONS ? There is no functionality it gives, it only adds more lines of code. If you want to understand what is with MSVC, MSVC warns that you're give exception variable a name, e.g in "catch (const std::out_of_range &e)", e is a name But, in the catch block, you do not use the variable e . The below excerpt is from the bug description (admittedly a little hidden, but those who seek shall find) hashicorp_key_management_plugin.cc(219,37): warning C4101: 'e': unreferenced local variable hashicorp_key_management_plugin.cc(219,37): warning C4101: catch (const std::out_of_range &e) So this is exactly the warning. which turns to an error, because on buildbot, on Windows, the compilation is strict. Also, if "in your opinion", the code should compile without warnings, it still makes sense to consult a real compiler, to prove the intuition. Of course nobody would touch or even read that code if this would compile without problems, but as shown below, compiler had different opinion from yours. Upon examination, I noticed that all this HASHICORP_HAVE_EXCEPTIONS is obsolete, there is no advantage in using map.at() over map.find() in this case, so I suggested to remove the HASHICORP_HAVE_EXCEPTIONS , the map.at(), and the exception catching , for the sake of clarity, for the sake of brevity, and of course, to fix the compiler warning/error that draw out attention to this code in the first place.

            anel I have no comments on review; if we remove exception handling, then everything is fine. But you need to rebase the code and push it to version 10.11, and not to 11.4 - because these changes affect all branches with hashicorp, this is not some new feature that should appear only in 11.4.

            sysprg Julius Goryavsky added a comment - anel I have no comments on review; if we remove exception handling, then everything is fine. But you need to rebase the code and push it to version 10.11, and not to 11.4 - because these changes affect all branches with hashicorp, this is not some new feature that should appear only in 11.4.
            sysprg Julius Goryavsky made changes -
            Assignee Julius Goryavsky [ sysprg ] Anel Husakovic [ anel ]
            anel Anel Husakovic made changes -
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 10.5 [ 23123 ]

            sysprg have rebased to 10.11.

            anel Anel Husakovic added a comment - sysprg have rebased to 10.11.
            anel Anel Husakovic made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            anel Anel Husakovic made changes -
            Assignee Anel Husakovic [ anel ] Julius Goryavsky [ sysprg ]

            anel Thank you, everything is fine - you can do push (if there are no unexpected problems on buildbot)

            sysprg Julius Goryavsky added a comment - anel Thank you, everything is fine - you can do push (if there are no unexpected problems on buildbot)
            sysprg Julius Goryavsky made changes -
            Assignee Julius Goryavsky [ sysprg ] Anel Husakovic [ anel ]
            serg Sergei Golubchik made changes -
            Assignee Anel Husakovic [ anel ] Julius Goryavsky [ sysprg ]
            sysprg Julius Goryavsky added a comment - Fix merged with head revision: https://github.com/MariaDB/server/commit/11aeef2aa2696e5fca26c0606c7da575b1044e66
            sysprg Julius Goryavsky made changes -
            Fix Version/s 10.11.8 [ 29630 ]
            Fix Version/s 10.11 [ 27614 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 11.0.6 [ 29628 ]
            Fix Version/s 11.1.5 [ 29629 ]
            Fix Version/s 11.2.4 [ 29631 ]
            Fix Version/s 11.4.2 [ 29633 ]

            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
            anel Anel Husakovic made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]

            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"
            sysprg Julius Goryavsky made changes -
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            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
            JIraAutomate JiraAutomate made changes -
            JIraAutomate JiraAutomate made changes -
            Labels Cloned

            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.