Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 914768 - dev-db/mysql-connector-c++: fails to build with new protobuf (needs c++14)
Summary: dev-db/mysql-connector-c++: fails to build with new protobuf (needs c++14)
Status: RESOLVED DUPLICATE of bug 912944
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-26 21:03 UTC by pva
Modified: 2023-09-26 21:05 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info.txt,9.54 KB, text/plain)
2023-09-26 21:04 UTC, pva
Details
mysql-connector-c++-8.0.32.ebuild build.log with failure due to protobuf requires c++14 (build.log.gz,34.92 KB, application/gzip)
2023-09-26 21:05 UTC, pva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pva 2023-09-26 21:03:53 UTC
dev-db/mysql-connector-c++ with protobuf-23.3-r2 fails to build with the following error:

=======================================
cd /var/tmp/portage/portage/dev-db/mysql-connector-c++-8.0.32/work/mysql-connector-c++-8.0.32-src_build/cdk/protocol/mysqlx &&
 /usr/bin/c++ -DCONCPP_BUILD_SHARED -I/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.0.32/work/mysql-connector-c++-8.0.
32-src/cdk/include -I/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.0.32/work/mysql-connector-c++-8.0.32-src_build/cdk/
include -I/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.0.32/work/mysql-connector-c++-8.0.32-src_build/cdk/protocol/my
sqlx -I/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.0.32/work/mysql-connector-c++-8.0.32-src/cdk/extra/rapidjson/incl
ude  -Wall -O2 -pipe -march=haswell -mtune=skylake -fdebug-prefix-map=/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.0.
32/work/mysql-connector-c++-8.0.32-src=. -O2 -g -DNDEBUG -std=c++11 -fPIC -fvisibility=hidden -Wall -DRAPIDJSON_HAS_CXX11_NOEX
CEPT=1 -DRAPIDJSON_HAS_CXX11_RANGE_FOR=1 -DRAPIDJSON_HAS_CXX11_RVALUE_REFS=1 -w -MD -MT cdk/protocol/mysqlx/CMakeFiles/cdk_pro
to_mysqlx.dir/protobuf/mysqlx_notice.pb.cc.o -MF CMakeFiles/cdk_proto_mysqlx.dir/protobuf/mysqlx_notice.pb.cc.o.d -o CMakeFile
s/cdk_proto_mysqlx.dir/protobuf/mysqlx_notice.pb.cc.o -c /var/tmp/portage/portage/dev-db/mysql-connector-c++-8.0.32/work/mysql
-connector-c++-8.0.32-src_build/cdk/protocol/mysqlx/protobuf/mysqlx_notice.pb.cc
In file included from /usr/include/absl/base/config.h:86,
                 from /usr/include/absl/base/attributes.h:37,
                 from /usr/include/absl/strings/string_view.h:39,
                 from /usr/include/google/protobuf/stubs/common.h:44,
                 from /usr/include/google/protobuf/io/zero_copy_stream.h:110,
                 from /var/tmp/portage/portage/dev-db/mysql-connector-c++-8.0.32/work/mysql-connector-c++-8.0.32-src/cdk/proto
col/mysqlx/protocol.cc:39:
/usr/include/absl/base/policy_checks.h:79:2: ошибка: #error "C++ versions less than C++14 are not supported."
   79 | #error "C++ versions less than C++14 are not supported."
      |  ^~~~~
=======================================

Error is clear. How to fix it?

Although, starting with 8.0.17 it should be possible (see release notes[1]) to build with C++14 I failed to enable this option. append-cxxflags -std=c++14 is not working since cmake appends c++11 at the end. So I decided to try 8.1.0 that switched to c++17. Nevertherless it fails to build with system protobuf as well.  mysql-connector-c++ uses older protobuf, that defines log_handler function and LogLevel. In newer protobuf they were completely removed, so I got the following error compiling mysql-connector-c++-8.1.0:


=======================================
cd /var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src_build/cdk/protocol/mysqlx && /usr/bin/c++ -DCONCPP_BUILD_SHARED -I/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src/cdk/include -I/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src_build/cdk/include -I/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src_build/cdk/protocol/mysqlx -I/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src/cdk/extra/rapidjson/include  -Wall -O2 -pipe -march=haswell -mtune=skylake -fdebug-prefix-map=/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src=. -O2 -g -DNDEBUG -std=c++17 -fPIC -fvisibility=hidden -Wall -DRAPIDJSON_HAS_CXX11_NOEXCEPT=1 -DRAPIDJSON_HAS_CXX11_RANGE_FOR=1 -DRAPIDJSON_HAS_CXX11_RVALUE_REFS=1 -w -MD -MT cdk/protocol/mysqlx/CMakeFiles/cdk_proto_mysqlx.dir/protobuf/mysqlx.pb.cc.o -MF CMakeFiles/cdk_proto_mysqlx.dir/protobuf/mysqlx.pb.cc.o.d -o CMakeFiles/cdk_proto_mysqlx.dir/protobuf/mysqlx.pb.cc.o -c /var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src_build/cdk/protocol/mysqlx/protobuf/mysqlx.pb.cc
/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src/cdk/protocol/mysqlx/protocol.cc:120:13: ошибка: переменная или поле «log_handler» объявлено void
  120 | static void log_handler(LogLevel level, const char* filename, int line, const std::string& message);
      |             ^~~~~~~~~~~
/var/tmp/portage/portage/dev-db/mysql-connector-c++-8.1.0/work/mysql-connector-c++-8.1.0-src/cdk/protocol/mysqlx/protocol.cc:120:25: ошибка: нет декларации «LogLevel» в этой области видимости
  120 | static void log_handler(LogLevel level, const char* filename, int line, const std::string& message);
      |                         ^~~~~~~~
=======================================

Now, if I disable system protobuf I've manged to build it sucessfully.


So, I think good solution for the problem will be bumping mysql-connector-c (ebuild works without modifications)/mysql-connector-c++ to 8.1.0 and disabling system protobuf. At least until upstream makes library work with newer protobuf.


Refs:
[1] https://downloads.mysql.com/docs/connector-cpp-relnotes-en.pdf
Comment 1 pva 2023-09-26 21:04:24 UTC
Created attachment 871516 [details]
emerge --info
Comment 2 pva 2023-09-26 21:05:16 UTC
Created attachment 871517 [details]
mysql-connector-c++-8.0.32.ebuild build.log with failure due to protobuf requires c++14
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-26 21:05:34 UTC

*** This bug has been marked as a duplicate of bug 912944 ***