Bug #108389 Cannot compile with Performance schema disabled
Submitted: 5 Sep 2022 16:16 Modified: 6 Sep 2022 13:01
Reporter: Luke Kolin Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:8.0.30 OS:SUSE (OpenSUSE 15.4)
Assigned to: CPU Architecture:ARM

[5 Sep 2022 16:16] Luke Kolin
Description:
Cannot compile MySQL from source with performance schema disabled in CMake options, received following error:

[ 54%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/buf/buf0flu.cc.o
In file included from /usr/src/mysql-8.0.30/storage/innobase/buf/buf0flu.cc:67:
/usr/src/mysql-8.0.30/storage/innobase/include/ut0stage.h:702:37: error: ‘Alter_stages’ does not name a type; did you mean ‘Alter_stage’?
  702 |   void Alter_stage::aggregate(const Alter_stages &alter_stages) noexcept {}
      |                                     ^~~~~~~~~~~~
      |                                     Alter_stage
/usr/src/mysql-8.0.30/storage/innobase/include/ut0stage.h:702:8: error: extra qualification ‘Alter_stage::’ on member ‘aggregate’ [-fpermissive]
  702 |   void Alter_stage::aggregate(const Alter_stages &alter_stages) noexcept {}
      |        ^~~~~~~~~~~
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/build.make:286: storage/innobase/CMakeFiles/innobase.dir/buf/buf0flu.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3488: storage/innobase/CMakeFiles/innobase.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

How to repeat:
Compile with the following options:

-DDISABLE_PSI_COND=1 -DDISABLE_PSI_DATA_LOCK=1 -DDISABLE_PSI_ERROR=1 -DDISABLE_PSI_FILE=1 -DDISABLE_PSI_IDLE=1 -DDISABLE_PSI_MEMORY=0 -DDISABLE_PSI_METADATA=1 -DDISABLE_PSI_MUTEX=1 -DDISABLE_PSI_PS=1 -DDISABLE_PSI_RWLOCK=1 -DDISABLE_PSI_SOCKET=1 -DDISABLE_PSI_SP=1 -DDISABLE_PSI_STAGE=1 -DDISABLE_PSI_STATEMENT=1 -DDISABLE_PSI_STATEMENT_DIGEST=1 -DDISABLE_PSI_TABLE=1 -DDISABLE_PSI_THREAD=0 -DDISABLE_PSI_TRANSACTION=1

I suspect that DISABLE_PSI_MEMORY AND DISABLE_PSI_THREAD can also be set.
[6 Sep 2022 9:39] MySQL Verification Team
Hi,

This is not ARM related... same thing happens on intel build (fedora linux)

cmake -DDISABLE_PSI_COND=1 -DDISABLE_PSI_DATA_LOCK=1 -DDISABLE_PSI_ERROR=1 -DDISABLE_PSI_FILE=1 -DDISABLE_PSI_IDLE=1 -DDISABLE_PSI_MEMORY=0 -DDISABLE_PSI_METADATA=1 -DDISABLE_PSI_MUTEX=1 -DDISABLE_PSI_PS=1 -DDISABLE_PSI_RWLOCK=1  -DDISABLE_PSI_SOCKET=1 -DDISABLE_PSI_SP=1 -DDISABLE_PSI_STAGE=1 -DDISABLE_PSI_STATEMENT=1 -DDISABLE_PSI_STATEMENT_DIGEST=1 -DDISABLE_PSI_TABLE=1 -DDISABLE_PSI_THREAD=0 -DDISABLE_PSI_TRANSACTION=1 -DWITH_BOOST=../boost/boost_1_77_0  .. && make

...

[ 47%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/buf/buf0dump.cc.o
[ 47%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/buf/buf0flu.cc.o
In file included from /root/dev/MYSQL/mysql-8.0.30/storage/innobase/buf/buf0flu.cc:67:
/root/dev/MYSQL/mysql-8.0.30/storage/innobase/include/ut0stage.h:702:37: error: ‘Alter_stages’ does not name a type; did you mean ‘Alter_stage’?
  702 |   void Alter_stage::aggregate(const Alter_stages &alter_stages) noexcept {}
      |                                     ^~~~~~~~~~~~
      |                                     Alter_stage
/root/dev/MYSQL/mysql-8.0.30/storage/innobase/include/ut0stage.h:702:8: error: extra qualification ‘Alter_stage::’ on member ‘aggregate’ [-fpermissive]
  702 |   void Alter_stage::aggregate(const Alter_stages &alter_stages) noexcept {}
      |        ^~~~~~~~~~~
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/build.make:286: storage/innobase/CMakeFiles/innobase.dir/buf/buf0flu.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:7075: storage/innobase/CMakeFiles/innobase.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
[root@localdev BUILD]#
[6 Sep 2022 13:01] Luke Kolin
I agree it can be duplicated on Intel - I encounter this on my OpenSUSE 15.4 x64 instance as well, just takes too long to compile to get to that point to give logs :)