Skip to contentSkip to conversation

fix test-meson-builds for older distros

PATCH In review Bruce Richardson 3 participants 8 messages Apr 10, 2019 – Apr 17, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover fix test-meson-builds for older distros

In order to ensure good test coverage, we sometimes need to run builds on distros with older compilers, such as gcc 4.8 on RHEL/Centos 7. This patchset does a small amount of clean-up to test-meson-builds.sh script to allow it to be used for such gcc builds.

Bruce Richardson (3):
devtools/test-meson-builds: skip missing compilers devtools/test-meson-builds: support older compilers devtools/test-meson-builds: fix bash-isms

 devtools/test-meson-builds.sh | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/3 devtools/test-meson-builds: skip missing compilers

if either gcc or clang are missing, skip doing those builds. This allows a setup to only do, e.g. gcc tests.

---
 devtools/test-meson-builds.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
devtools/test-meson-builds.sh +6 -4
index b3b5cfb..60e4168 100755
@@ -54,10 +54,12 @@ fi
 
 # shared and static linked builds with gcc and clang
 for c in gcc clang ; do
-	for s in static shared ; do
-		export CC="ccache $c"
-		build build-$c-$s --default-library=$s
-	done
+	if command -v $c >/dev/null 2>&1 ; then
+		for s in static shared ; do
+			export CC="ccache $c"
+			build build-$c-$s --default-library=$s
+		done
+	fi
 done
 
 # test compilation with minimal x86 instruction set
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH 1/3] devtools/test-meson-builds: skip missing compilers

10/04/2019 22:52, Bruce Richardson:

Quoted 10 lines

if either gcc or clang are missing, skip doing those builds. This allows a setup to only do, e.g. gcc tests.

---

devtools/test-meson-builds.sh +0 -0
 # shared and static linked builds with gcc and clang
 for c in gcc clang ; do

devtools/test-meson-builds.sh fi · line 62

Quoted 10 lines
devtools/test-meson-builds.sh +6 -4
-	for s in static shared ; do
-		export CC="ccache $c"
-		build build-$c-$s --default-library=$s
-	done
+	if command -v $c >/dev/null 2>&1 ; then
+		for s in static shared ; do
+			export CC="ccache $c"
+			build build-$c-$s --default-library=$s
+		done
+	fi

May I suggest this oneline change instead?

command -v $c >/dev/null 2>&1 || continue

#3 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH 1/3] devtools/test-meson-builds: skip missing compilers

Quoted 24 lines · Thomas Monjalon

10/04/2019 22:52, Bruce Richardson:

Quoted 10 lines

if either gcc or clang are missing, skip doing those builds. This allows a setup to only do, e.g. gcc tests.

---

devtools/test-meson-builds.sh +0 -0
 # shared and static linked builds with gcc and clang
 for c in gcc clang ; do

devtools/test-meson-builds.sh fi · line 62

Quoted 10 lines
devtools/test-meson-builds.sh +6 -4
-	for s in static shared ; do
-		export CC="ccache $c"
-		build build-$c-$s --default-library=$s
-	done
+	if command -v $c >/dev/null 2>&1 ; then
+		for s in static shared ; do
+			export CC="ccache $c"
+			build build-$c-$s --default-library=$s
+		done
+	fi

May I suggest this oneline change instead?

Quoted 2 lines

command -v $c >/dev/null 2>&1 || continue

Looks fine to me. Make the change on apply if you like, otherwise let me know if you want a V2.

#4 lore raw

PATCH 2/3 devtools/test-meson-builds: support older compilers

In reply to Bruce Richardson

Older versions of GCC, such as on Redhat/CentOS 7, don't support -march=nehalem, but need -march=corei7 instead.

---
 devtools/test-meson-builds.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +6 -1
index 60e4168..0b14030 100755
@@ -63,7 +63,12 @@ for c in gcc clang ; do
 done
 
 # test compilation with minimal x86 instruction set
-build build-x86-default -Dmachine=nehalem $use_shared
+default_machine='nehalem'
+ok=$(cc -march=$default_machine -E - < /dev/null > /dev/null 2>&1 || echo false)
+if [ "$ok" = "false" ] ; then
+	default_machine='corei7'
+fi
+build build-x86-default -Dmachine=$default_machine $use_shared
 
 # enable cross compilation if gcc cross-compiler is found
 c=aarch64-linux-gnu-gcc
Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 3/3 devtools/test-meson-builds: fix bash-isms

In reply to Bruce Richardson

The use of "==" is non-standard extension from bash, so use "=" for comparisons instead.

---
 devtools/test-meson-builds.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
devtools/test-meson-builds.sh +2 -2
index 0b14030..17680f8 100755
@@ -46,9 +46,9 @@ build () # <directory> <meson options>
 	fi
 }
 
-if [ "$1" == "-vv" ] ; then
+if [ "$1" = "-vv" ] ; then
 	TEST_MESON_BUILD_VERY_VERBOSE=1
-elif [ "$1" == "-v" ] ; then
+elif [ "$1" = "-v" ] ; then
 	TEST_MESON_BUILD_VERBOSE=1
 fi
 
Signature · 1 line
1.8.3.1
#6 lore raw
In reply to Bruce Richardson
Quoted 8 lines · Bruce Richardson

In order to ensure good test coverage, we sometimes need to run builds
on distros with older compilers, such as gcc 4.8 on RHEL/Centos 7. This
patchset does a small amount of clean-up to test-meson-builds.sh script
to allow it to be used for such gcc builds.

Quoted 7 lines

Bruce Richardson (3):
devtools/test-meson-builds: skip missing compilers devtools/test-meson-builds: support older compilers devtools/test-meson-builds: fix bash-isms

 devtools/test-meson-builds.sh | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
Signature · 2 lines
Kind regards,
Luca Boccassi
#7 lore raw

11/04/2019 10:48, Luca Boccassi:

Quoted 14 lines · Bruce Richardson
Quoted 13 lines

In order to ensure good test coverage, we sometimes need to run builds
on distros with older compilers, such as gcc 4.8 on RHEL/Centos 7. This
patchset does a small amount of clean-up to test-meson-builds.sh script
to allow it to be used for such gcc builds.

Bruce Richardson (3):
devtools/test-meson-builds: skip missing compilers devtools/test-meson-builds: support older compilers devtools/test-meson-builds: fix bash-isms

Quoted 4 lines
Quoted 2 lines
 devtools/test-meson-builds.sh | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

Applied with proposed change in patch 1, thanks.