All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danh Doan <congdanhqx@gmail.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] ci: detect installed gcc in Travis CI
Date: Thu, 28 Nov 2019 19:03:30 +0700	[thread overview]
Message-ID: <20191128120330.GA9067@danh.dev> (raw)
In-Reply-To: <20191127164820.GF23183@szeder.dev>

On 2019-11-27 17:48:20+0100, SZEDER Gábor <szeder.dev@gmail.com> wrote:
> On Wed, Nov 27, 2019 at 11:15:55PM +0700, Doan Tran Cong Danh wrote:
> > 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
> 
> This assummes that some of these gcc-<N> binaries can be found in
> PATH, but that hasn't always been the case in the past: up until end
> of last week Travis CI's xcode10.1 image came with GCC 8 pre-installed
> but not linked and without GCC 9, i.e. neither 'gcc-8' nor 'gcc-9' was
> available in PATH.  While now that image does have GCC 9 properly
> installed, i.e. 'gcc-9' has been available in PATH for almost a week,
> I wouldn't want to rely on that...

I thought gcc-<N> executable should be linked by `brew-install'
itself, no?

This patch applied on top of the patch you replied works fine!

> With your changes if none of the listed gcc-<N> binaries were
> available in PATH, then we would silently build with the generic 'cc',
> which is 'clang' on OSX, and that's definitely not what we want.

I'm addressing this issue with a change in ci/lib.sh below.
By adding /bin/false as a fallback.

If we could agree that the previous patch and this patch, together,
could be good, I'll re-organise it and send again later.

Either that, or squash this into the previous patch

--------8<-------------------
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Thu, 28 Nov 2019 18:24:58 +0700
Subject: [PATCH/RFC] ci: install latest gcc from brew for macOS build on travis

Until now, we ask brew install the specific version of gcc (gcc@8),
but for some reason, brew decided to install the latest version instead.

With the previous change, we're assuming that gcc-<N> executable is
existed in $PATH, we will find that executable instead.

While we're at it, don't ask brew to link gcc, since it should be taken
by `brew-install' itself.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
---
 ci/install-dependencies.sh | 2 --
 ci/lib.sh                  | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 4e64a19112..a671ee1005 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -48,8 +48,6 @@ osx-clang|osx-gcc)
 	brew install caskroom/cask/perforce
 	case "$jobname" in
 	osx-gcc)
-		brew link gcc ||
-		brew link gcc@8
 		;;
 	esac
 	;;
diff --git a/ci/lib.sh b/ci/lib.sh
index 4040fc1a22..02cdb47419 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -131,7 +131,7 @@ then
 		echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1"
 	}
 
-	BREW_INSTALL_PACKAGES=gcc@8
+	BREW_INSTALL_PACKAGES=gcc
 	export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
 	export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
 	MAKEFLAGS="$MAKEFLAGS --jobs=10"
@@ -160,7 +160,7 @@ export GIT_TEST_CLONE_2GB=YesPlease
 
 case "$jobname" in
 *-gcc)
-	for gitcc in gcc-10 gcc-9 gcc-8
+	for gitcc in gcc-10 gcc-9 gcc-8 false
 	do
 		if command -v $gitcc >/dev/null 2>&1
 		then
-- 
2.24.0.615.g37f5bfbdea


  reply	other threads:[~2019-11-28 12:03 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 ` [PATCH] ci: detect installed gcc in Travis CI Doan Tran Cong Danh
2019-11-27 16:48   ` SZEDER Gábor
2019-11-28 12:03     ` Danh Doan [this message]
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

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

  git send-email \
    --in-reply-to=20191128120330.GA9067@danh.dev \
    --to=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=szeder.dev@gmail.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.