Details

    Description

      Issue

      Cannot build AWS key management using:

      cmake -DPLUGIN_AWS_KEY_MANAGEMENT=DYNAMIC \
                 -DAWS_SDK_EXTERNAL_PROJECT=1 \
                 -DNOT_FOR_DISTRIBUTION=1 \
                  ../mariadb; \
       
      make aws_key_management;
      

      Steps to Reproduce

      echo "deb http://ftp.osuosl.org/pub/mariadb/repo/10.5/ubuntu bionic main" \
               | tee -a /etc/apt/sources.list.d/mariadb.list
       
      echo "deb-src http://ftp.osuosl.org/pub/mariadb/repo/10.5/ubuntu bionic main" \
               | tee -a /etc/apt/sources.list.d/mariadb-src.list
       
      apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
      apt-get update
      apt-get build-dep mariadb-10.5
       
      git clone --branch 10.5 https://github.com/MariaDB/server.git /tmp/mariadb
       
      mkdir /tmp/build-mariadb
      cd /tmp/build-mariadb
       
      cmake -DPLUGIN_AWS_KEY_MANAGEMENT=DYNAMIC \
                 -DAWS_SDK_EXTERNAL_PROJECT=1 \
                 -DNOT_FOR_DISTRIBUTION=1 \
                  ../mariadb; \
       
      make aws_key_management;
      

      Work around

      Initially a issue on the mariadb docker page (https://github.com/docker-library/mariadb/issues/322) @grooverdan provided me with a patch to allow me to build the AWS key management in a docker container. I have also tested this with a regular distribution of Ubuntu as stated from my environment above.

      After "git clone --branch 10.5 https://github.com/MariaDB/server.git /tmp/mariadb" add

      cd /tmp/mariadb
       
      wget -O aws.patch https://gist.githubusercontent.com/grooverdan/639557efa21fd4a67aee0002c7f81d3d/raw/d372e07772e3760fd7c1abaf117032b26db1d713/mariadb-10.5-patch-aws-plugin
       
      git apply aws.patch
      

      Then continue with the rest of the steps.

      Patch contents

      diff --git a/extra/aws_sdk/CMakeLists.txt b/extra/aws_sdk/CMakeLists.txt
      index 85a196dccce..7c4b8d8195c 100644
      --- a/extra/aws_sdk/CMakeLists.txt
      +++ b/extra/aws_sdk/CMakeLists.txt
      @@ -34,7 +34,7 @@ ENDFOREACH()
       IF(CMAKE_VERSION LESS "3.0")
         SET(GIT_TAG "1.0.8")
       ELSE()
      -  SET(GIT_TAG "1.2.11")
      +  SET(GIT_TAG "1.8.29")
       ENDIF()
       
       IF(MSVC_CRT_TYPE MATCHES "/MD")
      diff --git a/plugin/aws_key_management/aws_key_management_plugin.cc b/plugin/aws_key_management/aws_key_management_plugin.cc
      index 489dd375387..e2182336aa6 100644
      --- a/plugin/aws_key_management/aws_key_management_plugin.cc
      +++ b/plugin/aws_key_management/aws_key_management_plugin.cc
      @@ -161,6 +161,10 @@ class  MySQLLogSystem : public Aws::Utils::Logging::FormattedLogSystem
         {
         }
       
      +  virtual void Flush(void) override
      +  {
      +  }
      +
       protected:
         virtual void ProcessFormattedStatement(Aws::String&& statement) override
         {
      

      Attachments

        Activity

          danblack Daniel Black added a comment - In testing: https://github.com/MariaDB/server/commit/bebbc0a7023f30835ab7a878e21ef8fdffabe892#diff-47af931b17988296ff32a160f6a427c3c6c8157618f63d47cb7039eaae6ff780R167 wlad is this a strange way to flush stdout on windows in a plugin?

          danblack, you can do that, but this it is too pedantically written. You do not need the ACID guarantees in this case, and if your machine(not the process) crashes, you probably won't not care about a couple of unwritten bytes in the error log. Outside Windows, the stderr is also not buffered (in stdio meaning of buffering), so I'd omit that fflush too, and make Flush() dummy, like it was originally proposed

          wlad Vladislav Vaintroub added a comment - danblack , you can do that, but this it is too pedantically written. You do not need the ACID guarantees in this case, and if your machine(not the process) crashes, you probably won't not care about a couple of unwritten bytes in the error log. Outside Windows, the stderr is also not buffered (in stdio meaning of buffering), so I'd omit that fflush too, and make Flush() dummy, like it was originally proposed
          danblack Daniel Black added a comment -

          Thanks wlad. I've done that (keeping flush as empty).

          Fix pushed to 10.4

          danblack Daniel Black added a comment - Thanks wlad . I've done that (keeping flush as empty). Fix pushed to 10.4

          People

            danblack Daniel Black
            embernight Tanner Trautrim
            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.