Bug #89401 -DWITH_PROTOBUF=system broken on macOS with brew-installed Protobuf
Submitted: 25 Jan 2018 10:30 Modified: 13 Mar 2018 8:33
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.4 OS:MacOS (10.12.6)
Assigned to: CPU Architecture:Any

[25 Jan 2018 10:30] Laurynas Biveinis
Description:
Installing protobuf from Brew and then trying to use -DWITH_PROTOBUF=system results in compilation errors (only the first one pasted):

[ 33%] Building CXX object rapid/plugin/x/client/CMakeFiles/mysqlxclient_lite.dir/xrow.cc.o
/Users/laurynas/percona/mysql-8.0.4/rapid/plugin/x/client/xrow.cc:49:3: error: no type named 'uint64_t' in namespace 'google::protobuf'; did you mean simply 'uint64_t'?
  pb::uint64_t value;
  ^~~~~~~~~~~~
  uint64_t
/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^

How to repeat:
On mac:
$ brew install protobuf
$ cmake ../mysql-8.0.4 -DWITH_BOOST=... -DWITH_PROTOBUF=system
$ make
[25 Jan 2018 18:41] MySQL Verification Team
Thank you for the bug report.

[ 86%] Building CXX object rapid/plugin/x/client/CMakeFiles/mysqlxclient.dir/xrow.cc.o
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:49:3: error: no type named 'uint64_t' in namespace 'google::protobuf'; did you mean simply 'uint64_t'?
  pb::uint64_t value;
  ^~~~~~~~~~~~
  uint64_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:76:3: error: no type named 'uint64_t' in namespace 'google::protobuf'; did you mean simply 'uint64_t'?
  pb::uint64_t value;
  ^~~~~~~~~~~~
  uint64_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:96:3: error: no type named 'uint64_t' in namespace 'google::protobuf'; did you mean simply 'uint64_t'?
  pb::uint64_t value;
  ^~~~~~~~~~~~
  uint64_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:115:3: error: no type named 'uint64_t' in namespace 'google::protobuf'; did you mean simply 'uint64_t'?
  pb::uint64_t value;
  ^~~~~~~~~~~~
  uint64_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:154:3: error: no type named 'uint64_t' in namespace 'google::protobuf'; did you mean simply 'uint64_t'?
  pb::uint64_t len;
  ^~~~~~~~~~~~
  uint64_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:190:3: error: no type named 'uint64_t' in namespace 'google::protobuf'; did you mean simply 'uint64_t'?
  pb::uint64_t len;
  ^~~~~~~~~~~~
  uint64_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:224:3: error: no type named 'uint32_t' in namespace 'google::protobuf'; did you mean simply 'uint32_t'?
  pb::uint32_t value;
  ^~~~~~~~~~~~
  uint32_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_types/_uint32_t.h:31:22: note: 'uint32_t' declared here
typedef unsigned int uint32_t;
                     ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:242:3: error: no type named 'uint64_t' in namespace 'google::protobuf'; did you mean simply 'uint64_t'?
  pb::uint64_t value;
  ^~~~~~~~~~~~
  uint64_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/_types/_uint64_t.h:31:28: note: 'uint64_t' declared here
typedef unsigned long long uint64_t;
                           ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:296:15: error: use of undeclared identifier 'sign'; did you mean 'sin'?
  pb::uint8_t sign;
              ^~~~
              sin
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:946:1: note: 'sin' declared here
sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);}
^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:296:14: error: expected ';' after expression
  pb::uint8_t sign;
             ^
             ;
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:296:7: error: no member named 'uint8_t' in namespace 'google::protobuf'
  pb::uint8_t sign;
  ~~~~^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:296:15: error: reference to overloaded function could not be resolved; did you mean to call it?
  pb::uint8_t sign;
              ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:946:1: note: possible target for call
sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);}
^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:301:30: error: use of undeclared identifier 'sign'
  if (!input_stream.ReadRaw(&sign, 1))
                             ^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:309:25: error: use of undeclared identifier 'sign'; did you mean 'sin'?
    *out_result = Time((sign != 0x00),
                        ^~~~
                        sin
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:946:1: note: 'sin' declared here
sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);}
^
/Users/miguel/Downloads/mysql-8.0.4-rc/rapid/plugin/x/client/xrow.cc:309:25: error: reference to overloaded function could not be resolved; did you mean to call it?
    *out_result = Time((sign != 0x00),
                        ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:946:1: note: possible target for call
sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);}
^
15 errors generated.
make[2]: *** [rapid/plugin/x/client/CMakeFiles/mysqlxclient.dir/xrow.cc.o] Error 1
make[1]: *** [rapid/plugin/x/client/CMakeFiles/mysqlxclient.dir/all] Error 2
make: *** [all] Error 2
miguel:Downloads miguel$
[13 Mar 2018 3:50] Laurynas Biveinis
See bug 89915
[13 Mar 2018 8:33] Terje Røsten
Hi!

Thanks for heads up!

Bug closed as dup of #89915