[MDEV-16753] Galera doesn't build on opensuse 15.0 Created: 2018-07-13  Updated: 2018-09-23  Resolved: 2018-09-23

Status: Closed
Project: MariaDB Server
Component/s: Galera, Packaging
Affects Version/s: N/A
Fix Version/s: 10.2.18, 10.3.10, 10.1.37

Type: Bug Priority: Critical
Reporter: Daniel Bartholomew Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Attachments: File suse15-galera.patch    
Issue Links:
Blocks
blocks MDEV-16444 MariaDB isn't packaged for SUSE 15 (o... Closed
Relates
relates to MDEV-17152 Galera spec files need to be updated ... Closed

 Description   

There are a couple issues. First are some syntax issues with the Sconstruct file, probably due to the version in opensuse 15 being scons v3.0.1 (as opposed to v2.3.x in previous opensuse).

The error is:

TypeError: must be str, not bytes:
  File "/home/buildbot/buildbot/build/SConstruct", line 201:
    print('C compiler version is: ' + cc_version)

full build log

The error is also present on line 203, and I was able to work around both errors with the following quick-and-dirty patch:

diff --git a/SConstruct b/SConstruct
index 28a0b8b2..4f11ee96 100644
--- a/SConstruct
+++ b/SConstruct
@@ -194,8 +194,8 @@ if link != 'default':
     env.Replace(LINK = link)
 
 # Get compiler name/version, CXX may be set to "c++" which may be clang or gcc
-cc_version = read_first_line(env['CC'].split() + ['--version'])
-cxx_version = read_first_line(env['CXX'].split() + ['--version'])
+cc_version = str(read_first_line(env['CC'].split() + ['--version']))
+cxx_version = str(read_first_line(env['CXX'].split() + ['--version']))
 
 print('Using C compiler executable: ' + env['CC'])
 print('C compiler version is: ' + cc_version)

Once the syntax issues are worked around, there are also openssl errors that can currently be solved by installing libopenssl-1_0_0-devel. I would be nice if Galera was able to be compiled with the default libopenssl-devel instead, but for the time being, I have set up a -galera VM with libopenssl-1_0_0-devel installed on it (has to be a separate VM because libopenssl-devel and libopenssl-1_0_0-devel can't be installed at the same time) and with some minor modifications to the galera.spec file I was able to compile a galera package that seems to work.

Changes to galera.spec to fix packaging:

diff --git a/scripts/packages/galera.spec b/scripts/packages/galera.spec
index a5caaa30..495b42c5 100644
--- a/scripts/packages/galera.spec
+++ b/scripts/packages/galera.spec
@@ -39,6 +39,9 @@
 %if 0%{?suse_version} == 1320
 %define dist .suse13.2
 %endif
+%if 0%{?suse_version} == 1500
+%define dist .suse15.0
+%endif
 
 
 Name:          %{name}
@@ -57,7 +60,7 @@ BuildRoot:     %{_tmppath}/%{name}-%{version}
 #BuildRequires: boost-devel
 #BuildRequires: check-devel
 BuildRequires: glibc-devel
-BuildRequires: openssl-devel
+BuildRequires: libopenssl-1_0_0-devel
 BuildRequires: scons
 %if 0%{?suse_version} == 1110
 # On SLES11 SPx use the linked gcc47 to build instead of default gcc43

The attached suse15-galera.patch file has both fixes (to both the SConstruct and galera.spec files).



 Comments   
Comment by Jan Lindström (Inactive) [ 2018-07-17 ]

teemu.ollakka Can you have a look ?

Comment by Teemu Ollakka [ 2018-07-17 ]

Opened a ticket in Galera issue tracker: https://github.com/codership/galera/issues/513. We'll fix this for the next Galera release.

Comment by Daniel Bartholomew [ 2018-08-29 ]

FYI: this error also exists in SLES 15.0:

https://buildbot.askmonty.org/buildbot/builders/kvm-zyp-sles150-amd64-gal/builds/1

And different from openSUSE 15.0, SLES 15.0 does not have a libopenssl-1_0_0-devel package available (that I can see) so we can't work around it that way, we'll need to update galera to support openssl-1_1.

Comment by Teemu Ollakka [ 2018-09-12 ]

According to http://buildbot.askmonty.org/buildbot/builders/kvm-zyp-opensuse150-amd64-gal/builds/7/steps/compile/logs/stdio Galera library from https://github.com/MariaDB/galera branch galera-3.x complies now fine.

The job fails in rpm package build phase though, probably because of missing opensuse 15 definitions from galera.spec and rpm.sh.

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