git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] ci: detect installed gcc in Travis CI

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Nov 27, 2019, 16:48 UTC
Message-ID
<20191127164820.GF23183@szeder.dev>
In-Reply-To
<20191127161555.26131-1-congdanhqx@gmail.com>
On Wed, Nov 27, 2019 at 11:15:55PM +0700, Doan Tran Cong Danh wrote:
Show 36 quoted lines
> 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...

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.

Show 24 quoted lines
> +	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
> 
Previous: Doan Tran Cong DanhNext: Danh Doan
Message 3 of 6 in “Travis OS X gcc job is broken (again)”
  1. Denton LiuNov 26, 2019
  2. ci: detect installed gcc in Travis CIDoan Tran Cong Danh, Nov 27, 2019
  3. SZEDER GáborNov 27, 2019
  4. Danh DoanNov 28, 2019
  5. SZEDER GáborNov 28, 2019
  6. ci: build Git with GCC 9 in the 'osx-gcc' build jobSZEDER Gábor, Nov 27, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.