[PATCH] ci: detect installed gcc in Travis CI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Travis CI has continously updated their images, including updating gcc
installation.

Save us some headache by checking which version of gcc is installed in
the image, and use said version to run the build.

While gcc-10 hasn't been released, yet, add it to the list to save us
some headache in the future.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@xxxxxxxxx>
---
 ci/lib.sh | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/ci/lib.sh b/ci/lib.sh
index c8c2c38155..4040fc1a22 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -159,12 +159,21 @@ export DEFAULT_TEST_TARGET=prove
 export GIT_TEST_CLONE_2GB=YesPlease
 
 case "$jobname" in
-linux-clang|linux-gcc)
-	if [ "$jobname" = linux-gcc ]
-	then
-		export CC=gcc-8
-	fi
+*-gcc)
+	for gitcc in gcc-10 gcc-9 gcc-8
+	do
+		if command -v $gitcc >/dev/null 2>&1
+		then
+			export CC=$gitcc
+			break;
+		fi
+	done
+	unset gitcc
+	;;
+esac
 
+case "$jobname" in
+linux-clang|linux-gcc)
 	export GIT_TEST_HTTPD=true
 
 	# The Linux build installs the defined dependency versions below.
@@ -180,11 +189,6 @@ linux-clang|linux-gcc)
 	export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH"
 	;;
 osx-clang|osx-gcc)
-	if [ "$jobname" = osx-gcc ]
-	then
-		export CC=gcc-8
-	fi
-
 	# t9810 occasionally fails on Travis CI OS X
 	# t9816 occasionally fails with "TAP out of sequence errors" on
 	# Travis CI OS X
-- 
2.24.0.161.g2616cd003f.dirty




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux