Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 912944 - dev-db/mysql-connector-c++-8.0.32 - /.../span.h: error: Container was not declared in this scope
Summary: dev-db/mysql-connector-c++-8.0.32 - /.../span.h: error: Container was not dec...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords: PATCH
: 914768 (view as bug list)
Depends on:
Blocks: 912819
  Show dependency tree
 
Reported: 2023-08-24 07:46 UTC by Toralf Förster
Modified: 2023-10-14 08:34 UTC (History)
4 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,17.14 KB, text/plain)
2023-08-24 07:46 UTC, Toralf Förster
Details
CMakeCache.txt (CMakeCache.txt,14.14 KB, text/plain)
2023-08-24 07:46 UTC, Toralf Förster
Details
dev-db:mysql-connector-c++-8.0.32:20230824-034940.log (dev-db:mysql-connector-c++-8.0.32:20230824-034940.log,144.34 KB, text/plain)
2023-08-24 07:46 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,95.89 KB, text/plain)
2023-08-24 07:46 UTC, Toralf Förster
Details
environment (environment,95.78 KB, text/plain)
2023-08-24 07:46 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,892 bytes, application/x-xz)
2023-08-24 07:46 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,11.33 KB, application/x-xz)
2023-08-24 07:46 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,30.83 KB, application/x-xz)
2023-08-24 07:46 UTC, Toralf Förster
Details
mysql-connector-c++-8.1.0.ebuild.patch (mysql-connector-c++-8.1.0.ebuild.patch,658 bytes, patch)
2023-09-26 21:11 UTC, pva
Details | Diff
mysql-connector-c++-8.1.0-library_loader.h.patch (mysql-connector-c++-8.1.0-library_loader.h.patch,359 bytes, patch)
2023-09-26 21:12 UTC, pva
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2023-08-24 07:46:28 UTC
  119 |   using Container = std::remove_const_t<T>;
      |                          ^~~~~~~~~~~~~~
      |                          remove_const
/usr/include/absl/types/internal/span.h:121:44: error: parse error in template argument list
  121 |       decltype(span_internal::GetData(std::declval<const Container&>()));
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/types/internal/span.h:122:64: error: Container was not declared in this scope
  122 | sing MutData = decltype(span_internal::GetData(std::declval<Container&>()));
      |                                                             ^~~~~~~~~

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_no_multilib_hardened-20230822-115612

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 16.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/16/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/16
16.0.6
Python 3.11.4
Available Rust versions:
  [1]   rust-1.71.1 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JDK 17.0.7_p7 [openjdk-bin-17]
*)	Eclipse Temurin JDK 8.372_p07 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8  system-vm
  [2]   openjdk-bin-17 

php cli (if any):
go version go1.21.0 linux/amd64

  HEAD of ::gentoo
commit 7bab5be5af564e0f2a79f4552ce9d886c7c6c255
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Thu Aug 24 02:31:42 2023 +0000

    2023-08-24 02:31:42 UTC

emerge -qpvO dev-db/mysql-connector-c++
[ebuild  N    ] dev-db/mysql-connector-c++-8.0.32  USE="legacy"
Comment 1 Toralf Förster gentoo-dev 2023-08-24 07:46:29 UTC
Created attachment 868614 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2023-08-24 07:46:30 UTC
Created attachment 868615 [details]
CMakeCache.txt
Comment 3 Toralf Förster gentoo-dev 2023-08-24 07:46:31 UTC
Created attachment 868616 [details]
dev-db:mysql-connector-c++-8.0.32:20230824-034940.log
Comment 4 Toralf Förster gentoo-dev 2023-08-24 07:46:32 UTC
Created attachment 868617 [details]
emerge-history.txt
Comment 5 Toralf Förster gentoo-dev 2023-08-24 07:46:33 UTC
Created attachment 868618 [details]
environment
Comment 6 Toralf Förster gentoo-dev 2023-08-24 07:46:34 UTC
Created attachment 868619 [details]
etc.clang.tar.xz
Comment 7 Toralf Förster gentoo-dev 2023-08-24 07:46:35 UTC
Created attachment 868620 [details]
etc.portage.tar.xz
Comment 8 Toralf Förster gentoo-dev 2023-08-24 07:46:36 UTC
Created attachment 868621 [details]
temp.tar.xz
Comment 9 milan hodoscek 2023-09-13 13:02:39 UTC
Maybe this is a problem (cut out from your log file) ?


/usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
   79 | #error "C++ versions less than C++14 are not supported."
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-26 21:05:34 UTC
*** Bug 914768 has been marked as a duplicate of this bug. ***
Comment 11 pva 2023-09-26 21:10:56 UTC
In bug 914768 I've started to discuss possible solution for this problem.

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. Nevertheless, it fails to build with system protobuf as well.  mysql-connector-c++ uses older protobuf, that defines log_handler function and LogLevel (s) that were removed in newer protobuf and thus compilation of mysql-connector-c++-8.1.0 fails with:

=======================================
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 managed to build it successfully.


So, I think a 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.

I'll attach ebuild patch that allowed me to build protobuf, but it needs more work. At least remove following cmake options that cmake reports as nonexistent:

    CMAKE_TOOLCHAIN_FILE
    WITH_BOOST


Refs:
[1] https://downloads.mysql.com/docs/connector-cpp-relnotes-en.pdf
Comment 12 pva 2023-09-26 21:11:27 UTC
Created attachment 871518 [details, diff]
mysql-connector-c++-8.1.0.ebuild.patch
Comment 13 pva 2023-09-26 21:12:56 UTC
Created attachment 871519 [details, diff]
mysql-connector-c++-8.1.0-library_loader.h.patch

Also, I've needed this patch but it's a good idea to recheck and if the build without this patch fails we should report upstream.
Comment 14 Harris Landgarten 2023-10-09 20:29:37 UTC
I can confirm it built and runs with mysql-workbench with the patch and 8.1.0 uprade
Comment 15 Larry the Git Cow gentoo-dev 2023-10-14 08:34:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=312d85dd421b79117d0225b789a4b93dcc15bcae

commit 312d85dd421b79117d0225b789a4b93dcc15bcae
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-10-14 08:30:24 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-14 08:30:47 +0000

    dev-db/mysql-connector-c++: add 8.0.33
    
    Closes: https://bugs.gentoo.org/912944
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-db/mysql-connector-c++/Manifest                |  1 +
 .../mysql-connector-c++-8.0.33.ebuild              | 45 ++++++++++++++++++++++
 2 files changed, 46 insertions(+)