Hard work by INTERNET

ベンチャーで働くひとりぼっちWEB開発者が頑張るブログ

MySQL5.6をソースからインストールする

dockerの中で作業します。 docker run -it debian:sid bash

環境

root@c12674db7ecf:/mysql-server/bld_debug# cat /etc/debian_version 
10.0
root@c12674db7ecf:/mysql-server/bld_debug# gcc --version |grep gcc
gcc (Debian 9.2.1-21) 9.2.1 20191130

sidなので、、、。

作業ログ

apt-get update
apt-get install build-essential git cmake cmake-gui libssl-dev bison libncurses5-dev
git clone --branch '5.6' --depth 1 https://github.com/mysql/mysql-server
cd mysql-server

ここからは公式ドキュメントに従って進めます。

dev.mysql.com

https://dev.mysql.com/doc/internals/en/cmake-howto-quick-debug-configuration.html

mkdir bld_debug
cd bld_debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
make

cmakeは成功したんですが、makeでエラーになりました。

root@c12674db7ecf:/mysql-server/bld_debug# make
[  0%] Built target INFO_SRC
[  0%] Built target INFO_BIN
[  0%] Built target abi_check
[  2%] Built target zlib
[  5%] Built target edit
[  6%] Built target event
[  8%] Built target event_extra
[ 10%] Built target event_core
[ 13%] Built target strings
[ 19%] Built target mysys
[ 19%] Built target dbug
[ 20%] Built target mysys_ssl
[ 20%] Built target comp_err
[ 20%] Built target GenError
[ 20%] Building CXX object storage/archive/CMakeFiles/archive_embedded.dir/ha_archive.cc.o
In file included from /mysql-server/sql/table.h:40,
                 from /mysql-server/sql/field.h:27,
                 from /mysql-server/sql/unireg.h:179,
                 from /mysql-server/sql/log.h:26,
                 from /mysql-server/sql/sql_class.h:35,
                 from /mysql-server/storage/archive/ha_archive.cc:27:
/mysql-server/sql/table_id.h: In member function 'Table_id Table_id::operator++(int)':
/mysql-server/sql/table_id.h:64:12: error: implicitly-declared 'constexpr Table_id::Table_id(const Table_id&)' is deprecated [-Werror=deprecated-copy]
   64 |     return id;
      |            ^~
/mysql-server/sql/table_id.h:47:8: note: because 'Table_id' has user-provided 'void Table_id::operator=(const Table_id&)'
   47 |   void operator=(const Table_id &tid) { m_id = tid.m_id; }
      |        ^~~~~~~~
In file included from /mysql-server/sql/unireg.h:179,
                 from /mysql-server/sql/log.h:26,
                 from /mysql-server/sql/sql_class.h:35,
                 from /mysql-server/storage/archive/ha_archive.cc:27:
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_num::Field_num(const Field_num&)':
/mysql-server/sql/field.h:1461:7: error: implicitly-declared 'constexpr Field::Field(const Field&)' is deprecated [-Werror=deprecated-copy]
 1461 | class Field_num :public Field {
      |       ^~~~~~~~~
/mysql-server/sql/field.h:463:8: note: because 'Field' has user-provided 'void Field::operator=(Field&)'
  463 |   void operator=(Field &);
      |        ^~~~~~~~
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_real::Field_real(const Field_real&)':
/mysql-server/sql/field.h:1572:7: note: synthesized method 'constexpr Field_num::Field_num(const Field_num&)' first required here
 1572 | class Field_real :public Field_num {
      |       ^~~~~~~~~~
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_decimal::Field_decimal(const Field_decimal&)':
/mysql-server/sql/field.h:1598:7: note: synthesized method 'constexpr Field_real::Field_real(const Field_real&)' first required here
 1598 | class Field_decimal :public Field_real {
      |       ^~~~~~~~~~~~~
/mysql-server/sql/field.h: In member function 'virtual Field_decimal* Field_decimal::clone(MEM_ROOT*) const':
/mysql-server/sql/field.h:1626:46: note: synthesized method 'constexpr Field_decimal::Field_decimal(const Field_decimal&)' first required here
 1626 |     return new (mem_root) Field_decimal(*this);
      |                                              ^
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_str::Field_str(const Field_str&)':
/mysql-server/sql/field.h:1501:7: error: implicitly-declared 'constexpr Field::Field(const Field&)' is deprecated [-Werror=deprecated-copy]
 1501 | class Field_str :public Field {
      |       ^~~~~~~~~
/mysql-server/sql/field.h:463:8: note: because 'Field' has user-provided 'void Field::operator=(Field&)'
  463 |   void operator=(Field &);
      |        ^~~~~~~~
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_null::Field_null(const Field_null&)':
/mysql-server/sql/field.h:2102:7: note: synthesized method 'constexpr Field_str::Field_str(const Field_str&)' first required here
 2102 | class Field_null :public Field_str {
      |       ^~~~~~~~~~
/mysql-server/sql/field.h: In member function 'virtual Field_null* Field_null::clone(MEM_ROOT*) const':
/mysql-server/sql/field.h:2142:43: note: synthesized method 'constexpr Field_null::Field_null(const Field_null&)' first required here
 2142 |     return new (mem_root) Field_null(*this);
      |                                           ^
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_temporal::Field_temporal(const Field_temporal&)':
/mysql-server/sql/field.h:2155:7: error: implicitly-declared 'constexpr Field::Field(const Field&)' is deprecated [-Werror=deprecated-copy]
 2155 | class Field_temporal :public Field {
      |       ^~~~~~~~~~~~~~
/mysql-server/sql/field.h:463:8: note: because 'Field' has user-provided 'void Field::operator=(Field&)'
  463 |   void operator=(Field &);
      |        ^~~~~~~~
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_temporal_with_date::Field_temporal_with_date(const Field_temporal_with_date&)':
/mysql-server/sql/field.h:2363:7: note: synthesized method 'constexpr Field_temporal::Field_temporal(const Field_temporal&)' first required here
 2363 | class Field_temporal_with_date :public Field_temporal {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_temporal_with_date_and_time::Field_temporal_with_date_and_time(const Field_temporal_with_date_and_time&)':
/mysql-server/sql/field.h:2437:7: note: synthesized method 'constexpr Field_temporal_with_date::Field_temporal_with_date(const Field_temporal_with_date&)' first required here
 2437 | class Field_temporal_with_date_and_time :public Field_temporal_with_date {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_timestamp::Field_timestamp(const Field_timestamp&)':
/mysql-server/sql/field.h:2551:7: note: synthesized method 'constexpr Field_temporal_with_date_and_time::Field_temporal_with_date_and_time(const Field_temporal_with_date_and_time&)' first required here
 2551 | class Field_timestamp :public Field_temporal_with_date_and_time {
      |       ^~~~~~~~~~~~~~~
/mysql-server/sql/field.h: In member function 'virtual Field_timestamp* Field_timestamp::clone(MEM_ROOT*) const':
/mysql-server/sql/field.h:2582:48: note: synthesized method 'constexpr Field_timestamp::Field_timestamp(const Field_timestamp&)' first required here
 2582 |     return new (mem_root) Field_timestamp(*this);
      |                                                ^
/mysql-server/sql/field.h: In copy constructor 'constexpr Field_bit::Field_bit(const Field_bit&)':
/mysql-server/sql/field.h:3663:7: error: implicitly-declared 'constexpr Field::Field(const Field&)' is deprecated [-Werror=deprecated-copy]
 3663 | class Field_bit :public Field {
      |       ^~~~~~~~~
/mysql-server/sql/field.h:463:8: note: because 'Field' has user-provided 'void Field::operator=(Field&)'
  463 |   void operator=(Field &);
      |        ^~~~~~~~
/mysql-server/sql/field.h: In member function 'virtual Field_bit* Field_bit::clone(MEM_ROOT*) const':
/mysql-server/sql/field.h:3756:42: note: synthesized method 'constexpr Field_bit::Field_bit(const Field_bit&)' first required here
 3756 |     return new (mem_root) Field_bit(*this);
      |                                          ^
cc1plus: all warnings being treated as errors
make[2]: *** [storage/archive/CMakeFiles/archive_embedded.dir/build.make:76: storage/archive/CMakeFiles/archive_embedded.dir/ha_archive.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:496: storage/archive/CMakeFiles/archive_embedded.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

私はgccコンパイラ事情についてを疎く、 https://github.com/rails/rails/issues/38087 あたりを見るとgcc9特有の出力みたいです。 gcc8にすればmakeが成功するだろうか。

続く。