[MDEV-17648] Galera library on mariadb-4x should be galera-4 in packages Created: 2018-11-08  Updated: 2018-12-24  Resolved: 2018-11-29

Status: Closed
Project: MariaDB Server
Component/s: Galera
Fix Version/s: N/A

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

Issue Links:
Blocks
blocks MDEV-17647 Set buildbot to use galera 4 librarie... Closed
Relates
relates to MDEV-17646 start building Galera4 packages Closed

 Description   

http://buildbot.askmonty.org/buildbot/grid?category=galera&branch=mariadb-4.x

dpkg-buildpackage: source package galera-3
dpkg-buildpackage: source version 25.3.22-xenial
dpkg-buildpackage: source distribution xenial
dpkg-buildpackage: source changed by Codership Oy <info@codership.com>
 dpkg-source --before-build build
dpkg-buildpackage: host architecture arm64
dpkg-source: error: source package has two conflicting values - galera-4 and galera-3
dpkg-buildpackage: error: dpkg-source --before-build build gave error exit status 2



 Comments   
Comment by Daniel Bartholomew [ 2018-11-12 ]

Here's a full log for more info on the failure:
http://buildbot.askmonty.org/buildbot/builders/kvm-deb-bionic-amd64-gal/builds/12/steps/compile/logs/stdio

The build steps, from the log, are:

sudo dpkg -i /home/buildbot/libssl-dev_1.1.0g-2ubuntu4_amd64.deb
rm -Rf buildbot && mkdir -v buildbot
cd buildbot
mkdir -vp debs/binary debs/source
chmod -cR go+r debs
git clone -b mariadb-4.x "https://github.com/MariaDB/galera.git" build
cd build
git submodule init
git submodule update
./scripts/build.sh -p

So we're cloning from the mariadb-4.x repo, which is be the correct repo, but the version being reported is 25.3.22. And if you look in `./scripts/build.sh` that is the version number that is present. So that needs to be fixed, but fixing it manually (I tried setting the version to '25.4.0' manually) doesn't fix the error from `dpkg-source ...`.

After some investigation, it turns out that dpkg-src is getting the `galera-3` value from the `./debian/changelog` file. AFAICT, this file is used to generate the `changes` file used when creating apt repositories and it reads the galera-3 value from the first entry in the file. So this needs to be changed. There's also a url in the file that should probably be updated to the correct one, but I don't know what would be correct. Lastly, there's a version number in the changelog file (25.3.14-1), but this gets changed to the value of `VERSION` in the build.sh script, so it doesn't necessarily need to be updated.

Here's a diff of the changes I made to get `./scripts/build.sh -p` to build .deb packages on Ubuntu 18.04 Bionic:

buildbot@ubuntu-bionic-amd64:~/buildbot/build$ git diff
diff --git a/debian/changelog b/debian/changelog
index d35885be..0a640909 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-galera-3 (25.3.14-1) UNRELEASED; urgency=low
+galera-4 (25.3.14-1) UNRELEASED; urgency=low
 
   * Sync Debian packaging from downstream to include improvements developed at
     http://anonscm.debian.org/cgit/pkg-mysql/galera-3.git
diff --git a/scripts/build.sh b/scripts/build.sh
index c07a8bba..50f4a5de 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -5,7 +5,7 @@ set -eu
 # $Id$
 
 # Galera library version
-VERSION="25.3.22"
+VERSION="25.4.0"
 
 get_cores()
 {

Comment by Daniel Bartholomew [ 2018-11-12 ]

jplindst See my note. I don't know what the actual version number should be, so assigning this MDEV back to you to either handle or pass to Codership.

If you or someone at Codership makes changes in line with those I outline, then deb builds should start succeeding and all builds will have the correct version number. Thanks.

Comment by Jan Lindström (Inactive) [ 2018-11-14 ]

Fixed both on d71574654386c6c33e05abb8fd337404c14587bd but for some reason bb did not pick it.

Comment by Daniel Bartholomew [ 2018-11-14 ]

Chatted with you on slack, but will also add here so there's a record of it.

Our buildbot sometimes doesn't want to recognize new trees when they're added to the buildbot config file with just a reload. I've now done a full restart, so future pushes should be queued to build automatically.

I also updated the buildbot config to properly build specific pushes. Before it would always build whatever was the latest push into the mariadb-3.x or mariadb-4.x trees.

Comment by Daniel Bartholomew [ 2018-11-15 ]

Build failures still for sles 15, opensuse 15.0, and debian/ubuntu/sles ppc64le.

On sles15 and opensuse 15 I think the failures are because the packaging scripts aren't correctly identifying the OS. In previous sles and opensuse versions there was an /etc/SuSE-release file, but with version 15 they've gotten rid of that in favor of an /etc/os-release file. In the file are various variables we can use to identify the release and whether it's sles or opensuse.

The galera.spec file also needs to be updated to support sles/opensuse 15.

After looking some more at these failures I'll look into why ppc64le builds are failing...

Comment by Daniel Bartholomew [ 2018-11-15 ]

The following changes to the galera.spec and rpm.sh files look like they fix compilation on sles15 and opensuse15:

diff --git a/scripts/packages/galera.spec b/scripts/packages/galera.spec
index a5caaa30..7d0cd8aa 100644
--- a/scripts/packages/galera.spec
+++ b/scripts/packages/galera.spec
@@ -39,6 +39,12 @@
 %if 0%{?suse_version} == 1320
 %define dist .suse13.2
 %endif
+%if 0%{?sle_version} == 150000 
+%define dist .sles15
+%endif
+%if 0%{?suse_version} == 1500
+%define dist .opensuse15
+%endif
 
 
 Name:          %{name}
diff --git a/scripts/packages/rpm.sh b/scripts/packages/rpm.sh
index 442cae4b..7174c71f 100755
--- a/scripts/packages/rpm.sh
+++ b/scripts/packages/rpm.sh
@@ -34,6 +34,10 @@ then
 elif [ -r /etc/SuSE-release ]
 then
     DISTRO_VERSION=sles$(rpm -qf --qf '%{version}\n' /etc/SuSE-release | cut -d. -f1)
+elif [ -r /etc/os-release ]
+then
+    . /etc/os-release
+    DISTRO_VERSION=${VERSION}
 else
     DISTRO_VERSION=
 fi

Someone with more rpm packaging experience should do a proper fix though.

Comment by Daniel Bartholomew [ 2018-11-29 ]

AFAIK this issue is fixed. Please reopen with more details if it is not.

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