Bug #96263 8.0.17 protobuf-related build errors on macOS
Submitted: 22 Jul 2019 6:27 Modified: 30 Jul 2019 14:07
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.17 OS:MacOS (10.14.5)
Assigned to: CPU Architecture:Any
Tags: protobuf

[22 Jul 2019 6:27] Laurynas Biveinis
Description:
With protobuf installed with brew:

cmake ../mysql-8.0 -DBUILD_CONFIG.mysql_release ... -DWITH_SYSTEM_LIBS=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/protobuf/ ...
...
make
...
[ 46%] Building CXX object unittest/gunit/xplugin/CMakeFiles/xclient_unit_tests.dir/xcl/auth_chaining_t.cc.o
[ 46%] Building CXX object unittest/gunit/xplugin/CMakeFiles/xplugin_unit_tests.dir/xpl/account_verification_handler_t.cc.o
In file included from /Users/laurynas/percona/mysql-8.0/unittest/gunit/xplugin/xcl/auth_chaining_t.cc:27:
In file included from /Users/laurynas/percona/mysql-8.0/unittest/gunit/xplugin/xcl/session_t.h:35:
In file included from /Users/laurynas/percona/mysql-8.0/plugin/x/client/xsession_impl.h:40:
In file included from /Users/laurynas/percona/mysql-8.0/plugin/x/client/mysqlxclient/xsession.h:34:
In file included from /Users/laurynas/percona/mysql-8.0/plugin/x/client/mysqlxclient/xprotocol.h:39:
In file included from /Users/laurynas/percona/mysql-8.0/plugin/x/client/mysqlxclient/xmessage.h:31:
In file included from /usr/local/include/google/protobuf/dynamic_message.h:45:
In file included from /usr/local/include/google/protobuf/message.h:118:
In file included from /usr/local/include/google/protobuf/stubs/casts.h:36:
In file included from /usr/local/include/google/protobuf/stubs/common.h:46:
In file included from /usr/local/include/google/protobuf/stubs/port.h:49:
/usr/local/include/google/protobuf/port_def.inc:101:2: error: PROTOBUF_MIN_PROTOC_VERSION was previously defined
#error PROTOBUF_MIN_PROTOC_VERSION was previously defined
 ^

How to repeat:
See above
[22 Jul 2019 6:45] Laurynas Biveinis
Does not build with -DWITH_PROTOBUF=bundled neither:

In file included from /Users/laurynas/percona/mysql-8.0/router/src/metadata_cache/src/gr_notifications_listener.cc:28:
In file included from /Users/laurynas/percona/mysql-8.0/plugin/x/client/mysqlxclient/xsession.h:34:
In file included from /Users/laurynas/percona/mysql-8.0/plugin/x/client/mysqlxclient/xprotocol.h:39:
In file included from /Users/laurynas/percona/mysql-8.0/plugin/x/client/mysqlxclient/xmessage.h:56:
/Users/laurynas/percona/obj-mysql-8.0-debug-san/plugin/x/generated/protobuf_lite/mysqlx.pb.h:17:2: error: This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
 ^
/Users/laurynas/percona/obj-mysql-8.0-debug-san/plugin/x/generated/protobuf_lite/mysqlx.pb.h:18:2: error: incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers.  Please
 ^
/Users/laurynas/percona/obj-mysql-8.0-debug-san/plugin/x/generated/protobuf_lite/mysqlx.pb.h:19:2: error: regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
 ^
[22 Jul 2019 6:46] Laurynas Biveinis
Editing title accordingly
[22 Jul 2019 12:44] MySQL Verification Team
Hi Laurynas,

Thank you for the bug report.

Build worked for me with XCode, bundled PROTOBUF, enabled MYSQLX_PROTOBUF_LITE and enabled XPLUGIN_LOG_PROTOBUF, disabled protobuf_MSVC_STATIC_RUNTIME and enabled protobuf_BUILD_PROTOC_BINARIES.

Can you try that ???
[22 Jul 2019 13:56] MySQL Verification Team
Hi Laurynas,

No need to send any new info. Our Build department has verified this bug.
[23 Jul 2019 5:47] Tor Didriksen
I verified the build break with protobuf 3.7.1
I am not able to verify any breakage of the "bundled" version.
[30 Jul 2019 14:07] Paul DuBois
Posted by developer:
 
Fixed in 8.0.18.

Protobuf compilation failed on macOS.
[30 Jul 2019 15:25] MySQL Verification Team
Thank you, Paul.