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

Build issues on macOS 10.13.4

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3(EOL)
    • 5.5.62, 10.0.37, 10.3.9
    • None

    Description

      This is a master issue used to track all the build issues on latest macOS 10.13.4, which fails in multiple storage engines. Steps for building followed from MariaDB.org

      Attaching individual errors bellow:

      Inno

      /Users/shinnok/Work/mariadb/server/storage/innobase/include/sync0policy.h:53:4: error: cannot initialize a member subobject of type 'ulint'
            (aka 'unsigned long') with an rvalue of type 'os_thread_id_t' (aka '_opaque_pthread_t *')
                              m_thread_id(os_thread_id_t(ULINT_UNDEFINED))
                              ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /Users/shinnok/Work/mariadb/server/storage/innobase/include/sync0policy.h:79:4: error: cannot initialize a parameter of type 'int64' (aka 'long long') with
            an rvalue of type 'os_thread_id_t' (aka '_opaque_pthread_t *')
                              my_atomic_storelint(&m_thread_id, os_thread_get_curr_id());
      

      RocksDB

      [ 79%] Building CXX object storage/rocksdb/CMakeFiles/mysql_ldb.dir/tools/mysql_ldb.cc.o
      [ 79%] Linking CXX executable mysql_ldb
      Undefined symbols for architecture x86_64:
        "__db_flush_", referenced from:
            myrocks::rdb_get_global_perf_counters(myrocks::Rdb_perf_counters*) in librocksdb_aux_lib.a(rdb_perf_context.cc.o)
      

      Was missing lib to dbug lib.

      TokuDB

      TokuDB especially is in a bad shape on macOS, maybe it didn't receive much attention in that regard.

      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/ft-ops.cc:830:17: error: format specifies type 'long' but the argument has type 'int64_t'
            (aka 'long long') [-Werror,-Wformat]
                      blocknum.b);
                      ^~~~~~~~~~
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/ft-ops.cc:840:17: error: format specifies type 'long' but the argument has type 'int64_t'
            (aka 'long long') [-Werror,-Wformat]
                      blocknum.b,
                      ^~~~~~~~~~
      

      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc:1177:13: error: format specifies type 'long' but the argument
            has type 'int64_t' (aka 'long long') [-Werror,-Wformat]
                  blocknum.b,
                  ^~~~~~~~~~
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc:1204:13: error: format specifies type 'long' but the argument
            has type 'int64_t' (aka 'long long') [-Werror,-Wformat]
                  node->blocknum.b,
                  ^~~~~~~~~~~~~~~~
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/serialize/ft_node-serialize.cc:1260:13: error: format specifies type 'long' but the argument
            has type 'int64_t' (aka 'long long') [-Werror,-Wformat]
                  node->blocknum.b,
                  ^~~~~~~~~~~~~~~~
      ...
      

      [ 84%] Building CXX object storage/tokudb/PerconaFT/ft/CMakeFiles/ft_static.dir/serialize/ft-serialize.cc.o
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc:736:13: error: format specifies type 'unsigned long' but the
            argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
                  dump_state_of_toku_deserialize_ft_from();
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc:666:13: note: expanded from macro
            'dump_state_of_toku_deserialize_ft_from'
                  max_acceptable_lsn.lsn, \
                  ^~~~~~~~~~~~~~~~~~~~~~
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/serialize/ft-serialize.cc:736:13: error: format specifies type 'unsigned long' but the
            argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
                  dump_state_of_toku_deserialize_ft_from();
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ...
      

      Needs proper %ll format specifier.

      [ 84%] Building CXX object storage/tokudb/PerconaFT/ft/CMakeFiles/ft_static.dir/txn/txn.cc.o
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/txn/txn.cc:271:19: error: missing field '__opaque' initializer
            [-Werror,-Wmissing-field-initializers]
          .state_cond = ZERO_COND_INITIALIZER,  // Not TOKU_COND_INITIALIZER
                        ^
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/portability/toku_pthread.h:167:13: note: expanded from macro 'ZERO_COND_INITIALIZER'
              { 0 }                 \
                  ^
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/txn/txn.cc:271:19: error: missing field 'psi_cond' initializer
            [-Werror,-Wmissing-field-initializers]
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/portability/toku_pthread.h:168:5: note: expanded from macro 'ZERO_COND_INITIALIZER'
          }
          ^
      

      ZERO_COND_INITIALIZER is using wrong toku_cond_t struct initializer for first member of type pthread_cond_t and not considering the TOKU_PTHREAD_DEBUG case which has one extra struct member of type pfs_key_t.

      [ 75%] Performing install step for 'build_lzma'
      Making install in api
      /bin/sh:maria/build-mariadb/storage/tokudb/PerconaFT/xz/src/build_lzma/build-aux/install-sh: Permission denied
      

      This issue can be fixed by doing chmod +x for install-sh script. It is being discussed on the mailing list.

      /Users/shinnok/Work/mariadb/server/storage/tokudb/tokudb_thread.h:378:13: error: use of undeclared identifier 'pthread_mutex_timedlock'
          int r = pthread_mutex_timedlock(&_mutex, &waittime);
                  ^
      /Users/shinnok/Work/mariadb/server/storage/tokudb/tokudb_thread.h:486:13: error: use of undeclared identifier 'pthread_mutex_timedlock'
          int r = pthread_mutex_timedlock(&_mutex, &waittime);
                  ^
      

      pthread_mutex_timedlock() is not available in pthreads for Mac, as it's not part of the POSIX pthreads spec, I need a suggestion on how to proceed.The encompassing event_t::wait() method seems to be unused. Could be removed? Otherwise rewrite without timedlock.

      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/util/omt.cc:946:13: error: taking address of packed member 'value' of class or structure 'toku::omt_internal::omt_node_templated<referenced_xid_tuple, false>' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
          *out = &n->value;
                  ^~~~~~~~
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/util/omt.cc:871:13: note: in instantiation of member function 'toku::omt<referenced_xid_tuple, referenced_xid_tuple *, false>::copyout' requested here
                  copyout(value, &n);
                  ^
      In file included from /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/ft/txn/txn.h:46:
      In file included from /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/util/omt.h:759:
      /Users/shinnok/Work/mariadb/server/storage/tokudb/PerconaFT/util/omt.cc:762:24: error: taking address of packed member 'value' of class or structure 'toku::omt_internal::omt_node_templated<referenced_xid_tuple, false>' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
                  int r = f(&n.value, idx_root, iterate_extra);
                             ^~~~~~~
                               ^
      2 errors generated. 
      

      This is happening because omt_ classes are declared as packed and clang has -Waddress-of-packed-member when passing the address of a packed member, a legit concern on different architectures. The easiest way to get rid of the errors is to remove the packed attribute from said structs. Also reported MDEV-14223.

      [ 87%] Linking CXX shared library libtokufractaltree.dylib
      Undefined symbols for architecture x86_64:
        "_debug_sync_C_callback_ptr", referenced from:
            toku_debug_sync(tokutxn*, char const*) in ydb_row_lock.cc.o
       
      ....
      

      Was missing link to dbug lib.

      [ 88%] Linking CXX shared library libtokufractaltree.dylib
      Undefined symbols for architecture x86_64:
        "_opt_debug_sync_timeout", referenced from:
            toku_debug_sync(tokutxn*, char const*) in ydb_row_lock.cc.o
      ld: symbol(s) not found for architecture x86_64
      

      Not sure what's happening here, I see that opt_debug_sync_timeout is declared as extern, however no immediate definition is available. It is used to inform the compiler via __builtin_expect branch prediction on line toku_debug_sync.h:66:

      if (likely(!opt_debug_sync_timeout))
              return;
      

      Attachments

        Issue Links

          Activity

            People

              teodor Teodor Mircea Ionita (Inactive)
              teodor Teodor Mircea Ionita (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.