[MDEV-17875] Galera Build Failures on RHEL 8 Created: 2018-11-29  Updated: 2020-07-07  Resolved: 2020-07-07

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Galera
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Daniel Bartholomew Assignee: Teemu Ollakka
Resolution: Fixed Votes: 1
Labels: None

Attachments: File 2018-11-29-rhel8-scons3.patch    
Issue Links:
Relates
relates to MDEV-23117 Galera build script does not work in ... Closed

 Description   

There are galera build failures on the RHEL 8.0 beta when using the build.sh script due to RHEL8 moving to scons-3 and changing the name of the `scons` package to `python3-scons`.

I was able to work around the build failures and create an rpm using the attached patch, but someone with more packaging experience should do a proper fix that will work with multiple versions of scons and multiple versions of RHEL/CentOS (my patch probably breaks RHEL7/CentOS7 builds for example).



 Comments   
Comment by Timofey Turenko [ 2020-04-14 ]

tried different tricks with RHEL8:

sudo pip2 install scons
sudo ln -s /usr/bin/python2 /usr/bin/python

build started, but failed at the package creation:

+ /usr/bin/rpmbuild --clean --define '_topdir /home/timofey_turenko_mariadb_com/galera/scripts/packages/rpm_top_dir' --define 'optflags -O3 -fno-omit-frame-pointer -mtune=core2' --define 'version 26.4.4' --define 'release 1.rhel8.1' --define '_foo bar' -bb /home/timofey_turenko_mariadb_com/galera/scripts/packages/galera.spec
error: Failed build dependencies:
scons is needed by galera-enterprise-4-26.4.4-1.rhel8.1.el8.x86_64

Comment by Timofey Turenko [ 2020-04-14 ]

galera.spec contains `BuildRequires: scons` , but rpm -qa shows `python3-scons-3.0.1-8.el8.noarch`

Comment by Teemu Ollakka [ 2020-04-16 ]

Would the following patch fix the issue with build requirements?

diff --git a/scripts/packages/galera.spec b/scripts/packages/galera.spec
index 33cec5b2..e2e9e549 100644
--- a/scripts/packages/galera.spec
+++ b/scripts/packages/galera.spec
@@ -60,7 +60,11 @@ BuildRoot:     %{_tmppath}/%{name}-%{version}
 #BuildRequires: check-devel
 BuildRequires: glibc-devel
 BuildRequires: openssl-devel
+%if 0%{?rhel} >= 8
+BuildRequires: python3-scons
+%else
 BuildRequires: scons
+%endif
 %if 0%{?suse_version} == 1110
 # On SLES11 SPx use the linked gcc47 to build instead of default gcc43
 #BuildRequires: gcc47 gcc47-c++

Comment by Timofey Turenko [ 2020-05-06 ]

would this fix work for CentOS 8?

Comment by Daniel Bartholomew [ 2020-05-06 ]

I just did some test builds using teemu.ollakka's patch on our RHEL-8 and CentOS-8 builders and it worked well.

I also tested CentOS 6 and 7, SLES 15, and Fedora 31, just to make sure it didn't interfere with those, and there were no issues that I noticed.

My vote is to go ahead and apply this patch.

Comment by Daniel Bartholomew [ 2020-07-07 ]

Fixed in the following commits:

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