[MDEV-20392] Build Failure on rhel 8.0: CMake Error at /build/cmake/do_abi_check.cmake:82 Created: 2019-08-20  Updated: 2021-06-22  Resolved: 2021-06-10

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.4.6
Fix Version/s: 10.2.40, 10.3.31, 10.4.21, 10.5.12, 10.6.3

Type: Bug Priority: Major
Reporter: Vitthal Bagal Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

OS : Red Hat Enterprise Linux 8.0 (Ootpa)
uname -m : x86_64


Attachments: Text File build_mariadb_rh8.0.txt     PNG File screenshot-1.png    

 Description   

I am trying to build mariadb(v10.4.6) from source on rhel 8.0 and Observed build failure as below:

Scanning dependencies of target abi_check
CMake Error at /home/test/server-mariadb-10.4.6/cmake/do_abi_check.cmake:81 (MESSAGE):
  ABI check found difference between
  /home/test/server-mariadb-10.4.6/include/mysql/plugin_audit.h.pp and
  /home/test/build_mariadb/abi_check.out
 
make[2]: *** [CMakeFiles/abi_check.dir/build.make:57: CMakeFiles/abi_check] Error 1
make[1]: *** [CMakeFiles/Makefile2:168: CMakeFiles/abi_check.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

I have followed below steps :

export SOURCE_ROOT=$PWD && sudo yum install -y git gcc bison gcc-c++ make wget tar cmake openssl-devel ncurses-devel python2 boost-devel check-devel perl-Test-Simple perl-Time-HiRes openssl pcre-devel pam-devel
 
wget https://github.com/MariaDB/server/archive/mariadb-10.4.6.tar.gz
tar xzf mariadb-10.4.6.tar.gz
cd $SOURCE_ROOT
git clone https://github.com/MariaDB/mariadb-connector-c.git
cd mariadb-connector-c
git checkout v3.1.2
cp -r $SOURCE_ROOT/mariadb-connector-c/* $SOURCE_ROOT/server-mariadb-10.4.6/libmariadb/
cd $SOURCE_ROOT
git clone https://github.com/codership/wsrep-lib.git
cd wsrep-lib
git checkout fd66bdef0bbcdeb3a5189c7f93319cb5f9d77ea7
git submodule update --init --recursive
cp -r $SOURCE_ROOT/wsrep-lib/* $SOURCE_ROOT/server-mariadb-10.4.6/wsrep-lib/
mkdir $SOURCE_ROOT/build_mariadb
cd $SOURCE_ROOT/build_mariadb
cmake $SOURCE_ROOT/server-mariadb-10.4.6
make 

Please help me to resolve this failure. Also let me know if i missed anything ?



 Comments   
Comment by Sergei Golubchik [ 2019-08-20 ]

You've probably used wrong revisions for submodules or something.

If you download sources from github, better use git clone, not wget https://github.com/MariaDB/server/archive.
If you don't need the history, use --depth 1

Or download sources from downloads.mariadb.org — then you won't need git at all.

Comment by Vitthal Bagal [ 2019-08-22 ]

@Sergei Golubchik Thanks for quick reply. As per your comment I have tried both ways:
i) git clone
ii) download sources from downloads.mariadb.org
But I am still facing the same build failure. Any help would be appreciated.

Please find below steps that I followed:
first way :
cd $SOURCE_ROOT/
git clone https://github.com/MariaDB/server.git
cd server
git checkout mariadb-10.4.6
git submodule update --init --recursive
mkdir $SOURCE_ROOT/build_mariadb
cd $SOURCE_ROOT/build_mariadb
cmake $SOURCE_ROOT/mariadb-10.4.6
make

second way :
wget https://mirror.its.dal.ca/mariadb//mariadb-10.4.6/source/mariadb-10.4.6.tar.gz
tar xzf mariadb-10.4.6.tar.gz
mkdir $SOURCE_ROOT/build_mariadb
cd $SOURCE_ROOT/build_mariadb
cmake $SOURCE_ROOT/mariadb-10.4.6
make

Comment by Sergei Golubchik [ 2019-08-23 ]

Okay, so if you're getting the same failure, it should be

CMake Error at /home/test/server-mariadb-10.4.6/cmake/do_abi_check.cmake:81 (MESSAGE):
  ABI check found difference between
  /home/test/server-mariadb-10.4.6/include/mysql/plugin_audit.h.pp and
  /home/test/build_mariadb/abi_check.out

Could you please diff them manually? Just paste or attach the output of

diff -u /home/test/server-mariadb-10.4.6/include/mysql/plugin_audit.h.pp /home/test/build_mariadb/abi_check.out

May be a truncated output, if it's long.
Thanks!

Comment by Vitthal Bagal [ 2019-08-27 ]

@Sergei Golubchik Now I could build mariadb in fresh RHEL 8.0 container using both ways that you have suggested.
The above build failure(with both ways) was observed as I had used previously built mariadb folder(cmake $SOURCE_ROOT/mariadb-10.4.6) unknowingly.
Thanks...

Comment by Otto Kekäläinen [ 2021-05-30 ]

I am reopening the "bug", or rather usability error. This is still happening on latest MariaDB and googling on the error brings up thousands of pages where people complain about it.

The root cause is that the binary 'diff' is missing from the system, and CMake gets an exit code which it thinks was from diff, but in reality it was that diff was not even found.

Workaround: apt/yum install diffutils

Proper fix: extend CMake code to check for binary diff and emit a proper error message if it was not found at all

Comment by Otto Kekäläinen [ 2021-05-30 ]

serg Fix available at https://github.com/MariaDB/server/pull/1846, please merge.

Comment by Sergei Golubchik [ 2021-05-31 ]

otto, how did you know that the root cause was missing diff? I wasn't able to find it any hints in the logs.

Comment by Otto Kekäläinen [ 2021-05-31 ]

serg Because Vittal posted his exact steps and nothing in them installs diffutils. He tried to compile MariaDB out of pristine sources and this is what happens 100% of the time if one does so without diffutils. See my PR for proof.

Vittal never replied to your request to diff the files. It would have most likely shown that there is no diff, but diff itself was missing.

This error message has 1600 hits on Google, it is very common. But it is fixed now from 10.6 onwards if you approve my PR.

Comment by Sergei Golubchik [ 2021-06-10 ]

Pushed. Thanks, otto!

Generated at Thu Feb 08 08:59:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.