Skip to content

Commit 176441b

Browse files
szedergitster
authored andcommitted
ci: build Git with GCC 9 in the 'osx-gcc' build job
Our '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] 7d4733c (ci: fix GCC install in the Travis CI GCC OSX job, 2019-10-24) [2] https://travis-ci.org/git/git/jobs/615442297#L333 Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5fa0f52 commit 176441b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ci/install-dependencies.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ osx-clang|osx-gcc)
4343
brew install caskroom/cask/perforce
4444
case "$jobname" in
4545
osx-gcc)
46-
brew link gcc@8
46+
brew install gcc@9
47+
# Just in case the image is updated to contain gcc@9
48+
# pre-installed but not linked.
49+
brew link gcc@9
4750
;;
4851
esac
4952
;;

ci/lib.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ then
126126
echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1"
127127
}
128128

129-
BREW_INSTALL_PACKAGES=gcc@8
130129
export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
131130
export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
132131
MAKEFLAGS="$MAKEFLAGS --jobs=10"
@@ -177,7 +176,7 @@ linux-clang|linux-gcc)
177176
osx-clang|osx-gcc)
178177
if [ "$jobname" = osx-gcc ]
179178
then
180-
export CC=gcc-8
179+
export CC=gcc-9
181180
fi
182181

183182
# t9810 occasionally fails on Travis CI OS X

0 commit comments

Comments
 (0)