git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
To: git@vger.kernel.org
Cc: Doan Tran Cong Danh <congdanhqx@gmail.com>
Subject: [PATCH] ci: detect installed gcc in Travis CI
Date: Wed, 27 Nov 2019 23:15:55 +0700	[thread overview]
Message-ID: <20191127161555.26131-1-congdanhqx@gmail.com> (raw)
In-Reply-To: <20191126011536.GA30006@generichostname>

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@gmail.com>
---
 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


  reply	other threads:[~2019-11-27 16:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  1:15 Travis OS X gcc job is broken (again) Denton Liu
2019-11-27 16:15 ` Doan Tran Cong Danh [this message]
2019-11-27 16:48   ` [PATCH] ci: detect installed gcc in Travis CI SZEDER Gábor
2019-11-28 12:03     ` Danh Doan
2019-11-28 12:33       ` SZEDER Gábor
2019-11-27 16:24 ` [PATCH] ci: build Git with GCC 9 in the 'osx-gcc' build job SZEDER Gábor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191127161555.26131-1-congdanhqx@gmail.com \
    --to=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).