Bug #94001 CHECK FOR SUPPORTED GCC VERSIONS ARE TOO WEAK
Submitted: 22 Jan 2019 15:14 Modified: 23 Jan 2019 8:56
Reporter: Valeriy Kravchuk Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.14 OS:Ubuntu (14.04)
Assigned to: CPU Architecture:x86
Tags: compiling, regression

[22 Jan 2019 15:14] Valeriy Kravchuk
Description:
I was not able to build new MySQL 8.0.14 from GitHub on my main build 'host" running up to date Ubuntu 14.04:

openxs@ao756:~/git/mysql-server$ cat /etc/issue
Ubuntu 14.04.5 LTS \n \l

openxs@ao756:~/git/mysql-server$ uname -a
Linux ao756 3.13.0-164-generic #214-Ubuntu SMP Wed Dec 5 10:42:33 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
openxs@ao756:~/git/mysql-server$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

openxs@ao756:~/git/mysql-server$ cmake --version
cmake version 3.7.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

openxs@ao756:~/git/mysql-server$ git branch
  5.5
  5.6
  5.7
* 8.0
openxs@ao756:~/git/mysql-server$ git log -1
commit 8e797a5d6eb3a87f16498edcb7261a75897babae
Author: Bjorn Munch <bjorn.munch@oracle.com>
Date:   Wed Dec 19 13:43:33 2018 +0100

    Updated copyright for DEB packaging to 2019 ahead of release

When I run make I get:

...
[ 52%] Built target rpl
[ 52%] Building CXX object sql/CMakeFiles/sql_main.dir/json_dom.cc.o
json_dom.cc: In function ‘Json_dom_ptr merge_doms(Json_dom_ptr, Json_dom_ptr)’:
json_dom.cc:112:12: error: cannot bind ‘Json_object_ptr {aka std::unique_ptr<Json_object>}’ lvalue to ‘std::unique_ptr<Json_object>&&’
     return left_object;
            ^
In file included from /usr/include/c++/4.8/memory:81:0,
                 from ../sql/json_dom.h:29,
                 from json_dom.cc:23:
/usr/include/c++/4.8/bits/unique_ptr.h:169:2: error:   initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = Json_object; _Ep = std::default_delete<Json_object>; <template-parameter-2-3> = void; _Tp = Json_dom; _Dp = std::default_delete<Json_dom>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
json_dom.cc:125:10: error: cannot bind ‘Json_array_ptr {aka std::unique_ptr<Json_array>}’ lvalue to ‘std::unique_ptr<Json_array>&&’
   return left_array;
          ^
In file included from /usr/include/c++/4.8/memory:81:0,
                 from ../sql/json_dom.h:29,
                 from json_dom.cc:23:
/usr/include/c++/4.8/bits/unique_ptr.h:169:2: error:   initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = Json_array; _Ep = std::default_delete<Json_array>; <template-parameter-2-3> = void; _Tp = Json_dom; _Dp = std::default_delete<Json_dom>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
json_dom.cc: In member function ‘virtual Json_dom_ptr Json_object::clone() const’:
json_dom.cc:1010:10: error: cannot bind ‘Json_object_ptr {aka std::unique_ptr<Json_object>}’ lvalue to ‘std::unique_ptr<Json_object>&&’
   return o;
          ^
In file included from /usr/include/c++/4.8/memory:81:0,
                 from ../sql/json_dom.h:29,
                 from json_dom.cc:23:
/usr/include/c++/4.8/bits/unique_ptr.h:169:2: error:   initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = Json_object; _Ep = std::default_delete<Json_object>; <template-parameter-2-3> = void; _Tp = Json_dom; _Dp = std::default_delete<Json_dom>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
json_dom.cc: In member function ‘virtual Json_dom_ptr Json_array::clone() const’:
json_dom.cc:1150:10: error: cannot bind ‘Json_array_ptr {aka std::unique_ptr<Json_array>}’ lvalue to ‘std::unique_ptr<Json_array>&&’
   return vv;
          ^
In file included from /usr/include/c++/4.8/memory:81:0,
                 from ../sql/json_dom.h:29,
                 from json_dom.cc:23:
/usr/include/c++/4.8/bits/unique_ptr.h:169:2: error:   initializing argument 1 of ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = Json_array; _Ep = std::default_delete<Json_array>; <template-parameter-2-3> = void; _Tp = Json_dom; _Dp = std::default_delete<Json_dom>]’
  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^
json_dom.cc: In function ‘Json_dom_ptr merge_doms(Json_dom_ptr, Json_dom_ptr)’:
json_dom.cc:127:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
json_dom.cc: In member function ‘virtual Json_dom_ptr Json_object::clone() const’:
json_dom.cc:1012:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
json_dom.cc: In member function ‘virtual Json_dom_ptr Json_array::clone() const’:
json_dom.cc:1152:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make[2]: *** [sql/CMakeFiles/sql_main.dir/json_dom.cc.o] Error 1
make[1]: *** [sql/CMakeFiles/sql_main.dir/all] Error 2
make: *** [all] Error 2

I had no problem to build 8.0.13 from GitHub there.

How to repeat:
Main steps are:

cd ~/git/mysql-server
git branch
git pull
git log -1
rm CMakeCache.txt
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF -DCMAKE_INSTALL_PREFIX=/home/openxs/dbs/8.0 -DWITH_BOOST=/home/openxs/boost -DDOWNLOAD_BOOST=1 -DFORCE_INSOURCE_BUILD=1
make

Suggested fix:
If the system can not be used to build 8.0.14 for some reason (gcc version, missing something, whatever), I'd expect cmake command to tell me that.

Also it's strange to hit such a regression/failure at GA stage.
[22 Jan 2019 19:54] Terje Røsten
Hi!

Thanks for report.

As seen from https://www.mysql.com/support/supportedplatforms/database.html Ubuntu 14.04 is not a supported platform for MySQL 8. T

From https://github.com/mysql/mysql-server/blob/8.0/cmake/os/Linux.cmake
is seems GCC  >= 4.8.3 should work, however is seems that's no longer true
and cmake checks for GCC should be further restricted.
[23 Jan 2019 8:22] MySQL Verification Team
Hello Valeriy,

Thank you for the report and feedback.
Verifying based on last note from Terje i.e cmake checks for GCC should be further restricted.

regards,
Umesh
[23 Jan 2019 8:22] MySQL Verification Team
test results

Attachment: 94001.results (application/octet-stream, text), 4.73 KiB.

[23 Jan 2019 8:56] Terje Røsten
Fixed in 8.0.15 under the heading of WL#12424: Enable use of C++14 in MySQL server

(which sets GCC 5.3 as required compiler version)
[4 Feb 2019 14:22] Axel Schwenke
I cannot confirm that this is fixed in 8.0.15. I just tried to build MySQL 8.0.15 (source release) on Ubuntu 14.0.4 (gcc 4.8.4). Cmake says everything is fine, build fails with the same error as in the original report.
[4 Feb 2019 14:49] Terje Røsten
Hi!

MySQL 8.0.15 contains just one bug fix (Bug #94004):

 https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-15.html

hence, fix for issue here will be in 8.0.16.

Sorry for the confusion.
[16 Mar 2019 2:30] Lyu Little
I try to upgrade GCC to 8.3.0, It works. Maybe you need to upgrade together gmp, mpc and mpfr.

wget https://mirror-hk.koddos.net/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz
tar -zxvf gcc-8.3.0.tar.gz
cd gcc-8.3.0
mkdir build
cd build
../configure --enable-languages=c,c++ --prefix=/usr --disable-bootstrap --disable-multilib