Travis OS X gcc job is broken (again)
Hi all,
I couldn't find any threads addressing this yet (which is surprising since it's been happening for about half a week now).
It seems like gcc-8 doesn't exist anymore in our gcc OS X Travis job. As a result, that job has been failing consistently recently[1].
An old similar thread here[2]. Not sure if the failure is related.
Thanks,
Denton
[1]: https://travis-ci.org/git/git/builds/616541763
[2]: https://lore.kernel.org/git/9d80e845bf923c4543c49f9947aacb10c59ff6ce.1571789978.git.gitgitgadget@gmail.com/
PATCH 1/1 ci: detect installed gcc in Travis CI
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.
--- ci/lib.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
ci/lib.sh +14 -10
@@ -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
Signature · 1 line
2.24.0.161.g2616cd003f.dirty
Re: [PATCH] ci: detect installed gcc in Travis CI
Quoted 26 lines · Doan Tran Cong Danh
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 <[email protected]>--- ci/lib.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)ci/lib.sh +0
-4@@ -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
ci/lib.sh export DEFAULT_TEST_TARGET=prove · line 170
Quoted 10 lines
ci/lib.sh +9
-1- 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.
Quoted 24 lines
ci/lib.sh +5
-5+ 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 XSignature · 1 line
2.24.0.161.g2616cd003f.dirty
Re: [PATCH] ci: detect installed gcc in Travis CI
Quoted 38 lines · SZEDER Gábor
Quoted 26 lines · Doan Tran Cong Danh
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 <[email protected]>--- ci/lib.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)ci/lib.sh +0
-4@@ -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-8ci/lib.sh export DEFAULT_TEST_TARGET=prove · line 170
Quoted 10 lines
ci/lib.sh +9
-1- 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
Quoted 7 lines
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!
Quoted 3 lines
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 <[email protected]>
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.
--- ci/install-dependencies.sh | 2 -- ci/lib.sh | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-)
ci/install-dependencies.sh +0 -2
@@ -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 ;;
ci/lib.sh +2 -2
@@ -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
Signature · 1 line
2.24.0.615.g37f5bfbdea
Re: [PATCH] ci: detect installed gcc in Travis CI
Quoted 47 lines · Danh Doan
Quoted 38 lines · SZEDER Gábor
Quoted 26 lines · Doan Tran Cong Danh
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 <[email protected]>--- ci/lib.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)ci/lib.sh +0
-4@@ -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-8ci/lib.sh export DEFAULT_TEST_TARGET=prove · line 170
Quoted 10 lines
ci/lib.sh +9
-1- 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 + doneQuoted 7 lines
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...
Quoted 2 lines
I thought gcc-<N> executable should be linked by `brew-install' itself, no?
'brew install' does not link already installed but not linked packages, but instructs the user to run 'brew link' instead; see
PATCH 1/1 ci: build Git with GCC 9 in the 'osx-gcc' build job
In reply to Denton LiuOur 'osx-gcc' build job on Travis CI relied on GCC 8 being installed (but not linked) in the image we use [1]. Alas, since the last update of this image a few days ago this is not the case anymore, and now it contains GCC 9 (installed and linked) instead of GCC 8. The results are failed 'osx-gcc' jobs, because they can't find the 'gcc-8' command [2].
Let's move on to use GCC 9, with hopefully better error reporting and improved -Wfoo flags and what not. On Travis CI this has the benefit that we can spare a few seconds while installing dependencies, because it already comes pre-installed, at least for now. The Azure Pipelines OSX image doesn't include GCC, so we have to install it ourselves anyway, and then we might as well install the newer version.
In a vain attempt I tried to future-proof this a bit:
- Install 'gcc@9' specifically, so we'll still get what we want even after GCC 10 comes out, and the "plain" 'gcc' package starts to refer to 'gcc@10'.
- Run both 'brew install gcc@9' and 'brew link gcc@9'. If 'gcc@9' is already installed and linked, then both commands are noop and exit with success. But as we saw in the past, sometimes the image contains the expected GCC package installed but not linked, so maybe it will happen again in the future as well. In that case 'brew install' is still a noop, and instructs the user to run 'brew link' instead, so that's what we'll do. And if 'gcc@9' is not installed, then 'brew install' will install it, and the subsequent 'brew link' becomes a noop.
An additional benefit of this patch is that from now on we won't unnecessarily install GCC and its dependencies in the 'osx-clang' jobs on Azure Pipelines.
[1] 7d4733c501 (ci: fix GCC install in the Travis CI GCC OSX job,
2019-10-24)
[2] https://travis-ci.org/git/git/jobs/615442297#L333
---
Quoted 6 lines · Denton Liu
It seems like gcc-8 doesn't exist anymore in our gcc OS X Travis job. As a result, that job has been failing consistently recently[1].
An old similar thread here[2]. Not sure if the failure is related.
It's funny how merely two days after we talked about how/when Travis CI images are updated, we got yet another update, which broke our builds again... Oh, well.
ci/install-dependencies.sh | 6 ++++-- ci/lib.sh | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-)
ci/install-dependencies.sh +4 -2
@@ -48,8 +48,10 @@ osx-clang|osx-gcc) brew install caskroom/cask/perforce case "$jobname" in osx-gcc) - brew link gcc || - brew link gcc@8 + brew install gcc@9 + # Just in case the image is updated to contain gcc@9 + # pre-installed but not linked. + brew link gcc@9 ;; esac ;;
ci/lib.sh +1 -2
@@ -131,7 +131,6 @@ then echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1" } - BREW_INSTALL_PACKAGES=gcc@8 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"
@@ -182,7 +181,7 @@ linux-clang|linux-gcc) osx-clang|osx-gcc) if [ "$jobname" = osx-gcc ] then - export CC=gcc-8 + export CC=gcc-9 fi # t9810 occasionally fails on Travis CI OS X
Signature · 1 line
2.24.0.643.gac013444ca