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

Cannot build aws-key-management.so

    XMLWordPrintable

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

        1. cmake_output_unchanged_w_patch.txt
          48 kB
          Tanner Trautrim
        2. make_output_w_patch.txt
          93 kB
          Tanner Trautrim
        3. make_output.txt
          12 kB
          Tanner Trautrim

        Activity

          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.