[MDEV-23117] Galera build script does not work in RHLE 8 Created: 2020-07-07  Updated: 2023-04-11  Resolved: 2023-04-11

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

Type: Bug Priority: Critical
Reporter: Timofey Turenko Assignee: Julius Goryavsky
Resolution: Fixed Votes: 0
Labels: affects-tests

Issue Links:
Relates
relates to MDEV-17875 Galera Build Failures on RHEL 8 Closed

 Description   

./scripts/build.sh: line 418: scons: command not found

RHEL8 scoons has different name scons-3

workaround - sudo ln -s /usr/bin/scons-3 /usr/bin/scons before executing build.sh

please do proper fix i build.sh



 Comments   
Comment by Timofey Turenko [ 2023-04-05 ]

my build command is simple

./scripts/build.sh 

or

./scripts/build.sh -p

I guess scons problem disappeared for me after https://github.com/codership/galera/commit/958ce348bd1a228af6ed6b17b67647caa3653b92 - after making cmake a default tool to build Galera.

But in the current form build.sh does not work wit `--scons` option for RHEL8, because RHEL8 contains `scons-3` executable instead of `scons`

in Enterprise this was fixed in this way:

diff --git a/scripts/build.sh b/scripts/build.sh
index 4ec0ceda..ebe07416 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-set -eu
+set -eux
 
 # $Id$
 
@@ -50,6 +50,10 @@ Options:
 EOF
 }
 
+# Scons executable on RHEL-8 is scons-3
+SCONSBIN=scons
+[[ -n "$(which scons-3)" ]] && SCONSBIN=scons-3
+
 OS=$(uname)
 # disable building vsbes by default
 DISABLE_VSBES=${DISABLE_VSBES:-"yes"}
@@ -135,9 +139,9 @@ last_stage="galera-enterprise"
 gainroot=""
 TARGET=${TARGET:-""} # default target
 
-while test $# -gt 0 
+while test $# -gt 0
 do
-    case $1 in 
+    case $1 in
         --stage)
             initial_stage=$2
             shift
@@ -410,12 +414,12 @@ then
 
     if [ "$SCRATCH" == "yes" ]
     then
-        scons -Q -c --conf=force $scons_args $SCONS_OPTS
+        ${SCONSBIN} -Q -c --conf=force $scons_args $SCONS_OPTS
turenko@turenko-ThinkPad-T490:~/es-galera$ git diff 5b76d64e07b4082ab6c6fe2e0563d88eca8b4a87^!
diff --git a/scripts/build.sh b/scripts/build.sh
index 4ec0ceda..ebe07416 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-set -eu
+set -eux
 
 # $Id$
 
@@ -50,6 +50,10 @@ Options:
 EOF
 }
 
+# Scons executable on RHEL-8 is scons-3
+SCONSBIN=scons
+[[ -n "$(which scons-3)" ]] && SCONSBIN=scons-3
+
 OS=$(uname)
 # disable building vsbes by default
 DISABLE_VSBES=${DISABLE_VSBES:-"yes"}
@@ -135,9 +139,9 @@ last_stage="galera-enterprise"
 gainroot=""
 TARGET=${TARGET:-""} # default target
 
-while test $# -gt 0 
+while test $# -gt 0
 do
-    case $1 in 
+    case $1 in
         --stage)
             initial_stage=$2
             shift
@@ -410,12 +414,12 @@ then
 
     if [ "$SCRATCH" == "yes" ]
     then
-        scons -Q -c --conf=force $scons_args $SCONS_OPTS
+        ${SCONSBIN} -Q -c --conf=force $scons_args $SCONS_OPTS
     fi
 
     if [ "$SKIP_BUILD" != "yes" ]
     then
-        scons $scons_args -j $JOBS $SCONS_OPTS
+        ${SCONSBIN} $scons_args -j $JOBS $SCONS_OPTS
     fi
 
 elif test "$SKIP_BUILD" == "no"; then # Build using autotools

in any case, it is not very important now because cmake works

Comment by Jan Lindström [ 2023-04-06 ]

https://github.com/MariaDB/galera/pull/8

Comment by Julius Goryavsky [ 2023-04-11 ]

Fix pushed to head revision (https://github.com/MariaDB/galera/pull/8/commits/2c40f55cd3ea65d4da15a93817b94d8808b8ce30)

Generated at Thu Feb 08 09:19:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.