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

Error while compiling MariaDB Server 10.2 on macOS 10.13.6 (readline related)

    XMLWordPrintable

    Details

      Description

      Current MariaDB 10.2 from GitHub source and configured like this:

      cmake .. -DCMAKE_INSTALL_PREFIX=/Users/Valerii/dbs/maria10.2 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_DTRACE=1
      

      can not be compiled "as is" on macOS 10.13.6 High Sierra. It fails while compiling mysql.cc:

      ...
      [ 99%] Linking CXX executable test_hash
      [ 99%] Built target test_hash
      [ 99%] Building CXX object client/CMakeFiles/mysql.dir/completion_hash.cc.o
      [ 99%] Building CXX object client/CMakeFiles/mysql.dir/mysql.cc.o
      /Users/Valerii/git/server/client/mysql.cc:1055:16: error: redefinition of
            '_hist_entry'
      typedef struct _hist_entry {
                     ^
      /opt/local/include/editline/readline.h:57:16: note: previous definition is here
      typedef struct _hist_entry {
                     ^
      1 error generated.
      make[2]: *** [client/CMakeFiles/mysql.dir/mysql.cc.o] Error 1
      make[1]: *** [client/CMakeFiles/mysql.dir/all] Error 2
      make: *** [all] Error 2
      Yuliyas-Air:buildtmp Valerii$ sudo port list readline
      readline                       @8.1.000        devel/readline
      

      The following lame patch fixes the problem:

      Yuliyas-Air:server Valerii$ git diff
      diff --git a/client/mysql.cc b/client/mysql.cc
      index 382c216f772..495e769d460 100644
      --- a/client/mysql.cc
      +++ b/client/mysql.cc
      @@ -1052,10 +1052,12 @@ static const char *embedded_server_groups[]=
        Need to redefine it for real readline to find it
       */
       #if !defined(HAVE_HIST_ENTRY)
      +/*
       typedef struct _hist_entry {
         const char      *line;
         const char      *data;
      -} HIST_ENTRY;
      +} HIST_ENTRY;
      +*/
       #endif
       
       extern "C" int add_history(const char *command); /* From readline directory */
      

      but there is no such problem with 10.1 or 10.3+ at all. So, it looks like something 10.2-specific related to readline check in cmake.

        Attachments

          Activity

            People

            Assignee:
            shulga Dmitry Shulga
            Reporter:
            valerii Valerii Kravchuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

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