{"thread":{"id":"52338","subject":"Travis OS X gcc job is broken (again)","startedAt":"2019-11-26T01:15:41Z","lastAt":"2019-11-28T12:33:25Z","messageCount":6,"participants":["Denton Liu","Doan Tran Cong Danh","SZEDER Gábor","Danh Doan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"387036","messageId":"20191126011536.GA30006@generichostname","threadId":"52338","inReplyTo":null,"subject":"Travis OS X gcc job is broken (again)","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-11-26T01:15:36Z","receivedAt":"2019-11-26T01:15:41Z","isPatch":false,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Hi all,\n\nI couldn't find any threads addressing this yet (which is surprising\nsince it's been happening for about half a week now).\n\nIt seems like gcc-8 doesn't exist anymore in our gcc OS X Travis job. As\na result, that job has been failing consistently recently[1].\n\nAn old similar thread here[2]. Not sure if the failure is related.\n\nThanks,\n\nDenton\n\n[1]: https://travis-ci.org/git/git/builds/616541763\n[2]: https://lore.kernel.org/git/9d80e845bf923c4543c49f9947aacb10c59ff6ce.1571789978.git.gitgitgadget@gmail.com/\n"},{"id":"387171","messageId":"20191127161555.26131-1-congdanhqx@gmail.com","threadId":"52338","inReplyTo":"20191126011536.GA30006@generichostname","subject":"[PATCH] ci: detect installed gcc in Travis CI","fromName":"Doan Tran Cong Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2019-11-27T16:15:55Z","receivedAt":"2019-11-27T16:16:42Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"Travis CI has continously updated their images, including updating gcc\ninstallation.\n\nSave us some headache by checking which version of gcc is installed in\nthe image, and use said version to run the build.\n\nWhile gcc-10 hasn't been released, yet, add it to the list to save us\nsome headache in the future.\n\nSigned-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>\n---\n ci/lib.sh | 24 ++++++++++++++----------\n 1 file changed, 14 insertions(+), 10 deletions(-)\n\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex c8c2c38155..4040fc1a22 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -159,12 +159,21 @@ export DEFAULT_TEST_TARGET=prove\n export GIT_TEST_CLONE_2GB=YesPlease\n \n case \"$jobname\" in\n-linux-clang|linux-gcc)\n-\tif [ \"$jobname\" = linux-gcc ]\n-\tthen\n-\t\texport CC=gcc-8\n-\tfi\n+*-gcc)\n+\tfor gitcc in gcc-10 gcc-9 gcc-8\n+\tdo\n+\t\tif command -v $gitcc >/dev/null 2>&1\n+\t\tthen\n+\t\t\texport CC=$gitcc\n+\t\t\tbreak;\n+\t\tfi\n+\tdone\n+\tunset gitcc\n+\t;;\n+esac\n \n+case \"$jobname\" in\n+linux-clang|linux-gcc)\n \texport GIT_TEST_HTTPD=true\n \n \t# The Linux build installs the defined dependency versions below.\n@@ -180,11 +189,6 @@ linux-clang|linux-gcc)\n \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n \t;;\n osx-clang|osx-gcc)\n-\tif [ \"$jobname\" = osx-gcc ]\n-\tthen\n-\t\texport CC=gcc-8\n-\tfi\n-\n \t# t9810 occasionally fails on Travis CI OS X\n \t# t9816 occasionally fails with \"TAP out of sequence errors\" on\n \t# Travis CI OS X\n-- \n2.24.0.161.g2616cd003f.dirty\n\n"},{"id":"387174","messageId":"20191127162416.19391-1-szeder.dev@gmail.com","threadId":"52338","inReplyTo":"20191126011536.GA30006@generichostname","subject":"[PATCH] ci: build Git with GCC 9 in the 'osx-gcc' build job","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-11-27T16:24:16Z","receivedAt":"2019-11-27T16:24:23Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Our 'osx-gcc' build job on Travis CI relied on GCC 8 being installed\n(but not linked) in the image we use [1].  Alas, since the last update\nof this image a few days ago this is not the case anymore, and now it\ncontains GCC 9 (installed and linked) instead of GCC 8.  The results\nare failed 'osx-gcc' jobs, because they can't find the 'gcc-8' command\n[2].\n\nLet's move on to use GCC 9, with hopefully better error reporting and\nimproved -Wfoo flags and what not.  On Travis CI this has the benefit\nthat we can spare a few seconds while installing dependencies, because\nit already comes pre-installed, at least for now.  The Azure Pipelines\nOSX image doesn't include GCC, so we have to install it ourselves\nanyway, and then we might as well install the newer version.\n\nIn a vain attempt I tried to future-proof this a bit:\n\n  - Install 'gcc@9' specifically, so we'll still get what we want even\n    after GCC 10 comes out, and the \"plain\" 'gcc' package starts to\n    refer to 'gcc@10'.\n\n  - Run both 'brew install gcc@9' and 'brew link gcc@9'.  If 'gcc@9'\n    is already installed and linked, then both commands are noop and\n    exit with success.  But as we saw in the past, sometimes the image\n    contains the expected GCC package installed but not linked, so\n    maybe it will happen again in the future as well.  In that case\n    'brew install' is still a noop, and instructs the user to run\n    'brew link' instead, so that's what we'll do.  And if 'gcc@9' is\n    not installed, then 'brew install' will install it, and the\n    subsequent 'brew link' becomes a noop.\n\nAn additional benefit of this patch is that from now on we won't\nunnecessarily install GCC and its dependencies in the 'osx-clang' jobs\non Azure Pipelines.\n\n[1] 7d4733c501 (ci: fix GCC install in the Travis CI GCC OSX job,\n    2019-10-24)\n[2] https://travis-ci.org/git/git/jobs/615442297#L333\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n\nOn Mon, Nov 25, 2019 at 05:15:36PM -0800, Denton Liu wrote:\n> It seems like gcc-8 doesn't exist anymore in our gcc OS X Travis job. As\n> a result, that job has been failing consistently recently[1].\n> \n> An old similar thread here[2]. Not sure if the failure is related.\n\n> [2]: https://lore.kernel.org/git/9d80e845bf923c4543c49f9947aacb10c59ff6ce.1571789978.git.gitgitgadget@gmail.com/\n\nIt's funny how merely two days after we talked about how/when Travis\nCI images are updated, we got yet another update, which broke our\nbuilds again... Oh, well.\n\n\n ci/install-dependencies.sh | 6 ++++--\n ci/lib.sh                  | 3 +--\n 2 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 4e64a19112..93e3bba434 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -48,8 +48,10 @@ osx-clang|osx-gcc)\n \tbrew install caskroom/cask/perforce\n \tcase \"$jobname\" in\n \tosx-gcc)\n-\t\tbrew link gcc ||\n-\t\tbrew link gcc@8\n+\t\tbrew install gcc@9\n+\t\t# Just in case the image is updated to contain gcc@9\n+\t\t# pre-installed but not linked.\n+\t\tbrew link gcc@9\n \t\t;;\n \tesac\n \t;;\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex c8c2c38155..10b97c05ad 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -131,7 +131,6 @@ then\n \t\techo \"$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1\"\n \t}\n \n-\tBREW_INSTALL_PACKAGES=gcc@8\n \texport GIT_PROVE_OPTS=\"--timer --jobs 10 --state=failed,slow,save\"\n \texport GIT_TEST_OPTS=\"--verbose-log -x --write-junit-xml\"\n \tMAKEFLAGS=\"$MAKEFLAGS --jobs=10\"\n@@ -182,7 +181,7 @@ linux-clang|linux-gcc)\n osx-clang|osx-gcc)\n \tif [ \"$jobname\" = osx-gcc ]\n \tthen\n-\t\texport CC=gcc-8\n+\t\texport CC=gcc-9\n \tfi\n \n \t# t9810 occasionally fails on Travis CI OS X\n-- \n2.24.0.643.gac013444ca\n\n"},{"id":"387180","messageId":"20191127164820.GF23183@szeder.dev","threadId":"52338","inReplyTo":"20191127161555.26131-1-congdanhqx@gmail.com","subject":"Re: [PATCH] ci: detect installed gcc in Travis CI","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-11-27T16:48:20Z","receivedAt":"2019-11-27T16:48:26Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Wed, Nov 27, 2019 at 11:15:55PM +0700, Doan Tran Cong Danh wrote:\n> Travis CI has continously updated their images, including updating gcc\n> installation.\n> \n> Save us some headache by checking which version of gcc is installed in\n> the image, and use said version to run the build.\n> \n> While gcc-10 hasn't been released, yet, add it to the list to save us\n> some headache in the future.\n> \n> Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>\n> ---\n>  ci/lib.sh | 24 ++++++++++++++----------\n>  1 file changed, 14 insertions(+), 10 deletions(-)\n> \n> diff --git a/ci/lib.sh b/ci/lib.sh\n> index c8c2c38155..4040fc1a22 100755\n> --- a/ci/lib.sh\n> +++ b/ci/lib.sh\n> @@ -159,12 +159,21 @@ export DEFAULT_TEST_TARGET=prove\n>  export GIT_TEST_CLONE_2GB=YesPlease\n>  \n>  case \"$jobname\" in\n> -linux-clang|linux-gcc)\n> -\tif [ \"$jobname\" = linux-gcc ]\n> -\tthen\n> -\t\texport CC=gcc-8\n> -\tfi\n> +*-gcc)\n> +\tfor gitcc in gcc-10 gcc-9 gcc-8\n> +\tdo\n> +\t\tif command -v $gitcc >/dev/null 2>&1\n> +\t\tthen\n> +\t\t\texport CC=$gitcc\n> +\t\t\tbreak;\n> +\t\tfi\n> +\tdone\n\nThis assummes that some of these gcc-<N> binaries can be found in\nPATH, but that hasn't always been the case in the past: up until end\nof last week Travis CI's xcode10.1 image came with GCC 8 pre-installed\nbut not linked and without GCC 9, i.e. neither 'gcc-8' nor 'gcc-9' was\navailable in PATH.  While now that image does have GCC 9 properly\ninstalled, i.e. 'gcc-9' has been available in PATH for almost a week,\nI wouldn't want to rely on that...\n\nWith your changes if none of the listed gcc-<N> binaries were\navailable in PATH, then we would silently build with the generic 'cc',\nwhich is 'clang' on OSX, and that's definitely not what we want.\n\n> +\tunset gitcc\n> +\t;;\n> +esac\n>  \n> +case \"$jobname\" in\n> +linux-clang|linux-gcc)\n>  \texport GIT_TEST_HTTPD=true\n>  \n>  \t# The Linux build installs the defined dependency versions below.\n> @@ -180,11 +189,6 @@ linux-clang|linux-gcc)\n>  \texport PATH=\"$GIT_LFS_PATH:$P4_PATH:$PATH\"\n>  \t;;\n>  osx-clang|osx-gcc)\n> -\tif [ \"$jobname\" = osx-gcc ]\n> -\tthen\n> -\t\texport CC=gcc-8\n> -\tfi\n> -\n>  \t# t9810 occasionally fails on Travis CI OS X\n>  \t# t9816 occasionally fails with \"TAP out of sequence errors\" on\n>  \t# Travis CI OS X\n> -- \n> 2.24.0.161.g2616cd003f.dirty\n> \n"},{"id":"387276","messageId":"20191128120330.GA9067@danh.dev","threadId":"52338","inReplyTo":"20191127164820.GF23183@szeder.dev","subject":"Re: [PATCH] ci: detect installed gcc in Travis CI","fromName":"Danh Doan","fromEmail":"congdanhqx@gmail.com","sentAt":"2019-11-28T12:03:30Z","receivedAt":"2019-11-28T12:03:35Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2019-11-27 17:48:20+0100, SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> On Wed, Nov 27, 2019 at 11:15:55PM +0700, Doan Tran Cong Danh wrote:\n> > Travis CI has continously updated their images, including updating gcc\n> > installation.\n> > \n> > Save us some headache by checking which version of gcc is installed in\n> > the image, and use said version to run the build.\n> > \n> > While gcc-10 hasn't been released, yet, add it to the list to save us\n> > some headache in the future.\n> > \n> > Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>\n> > ---\n> >  ci/lib.sh | 24 ++++++++++++++----------\n> >  1 file changed, 14 insertions(+), 10 deletions(-)\n> > \n> > diff --git a/ci/lib.sh b/ci/lib.sh\n> > index c8c2c38155..4040fc1a22 100755\n> > --- a/ci/lib.sh\n> > +++ b/ci/lib.sh\n> > @@ -159,12 +159,21 @@ export DEFAULT_TEST_TARGET=prove\n> >  export GIT_TEST_CLONE_2GB=YesPlease\n> >  \n> >  case \"$jobname\" in\n> > -linux-clang|linux-gcc)\n> > -\tif [ \"$jobname\" = linux-gcc ]\n> > -\tthen\n> > -\t\texport CC=gcc-8\n> > -\tfi\n> > +*-gcc)\n> > +\tfor gitcc in gcc-10 gcc-9 gcc-8\n> > +\tdo\n> > +\t\tif command -v $gitcc >/dev/null 2>&1\n> > +\t\tthen\n> > +\t\t\texport CC=$gitcc\n> > +\t\t\tbreak;\n> > +\t\tfi\n> > +\tdone\n> \n> This assummes that some of these gcc-<N> binaries can be found in\n> PATH, but that hasn't always been the case in the past: up until end\n> of last week Travis CI's xcode10.1 image came with GCC 8 pre-installed\n> but not linked and without GCC 9, i.e. neither 'gcc-8' nor 'gcc-9' was\n> available in PATH.  While now that image does have GCC 9 properly\n> installed, i.e. 'gcc-9' has been available in PATH for almost a week,\n> I wouldn't want to rely on that...\n\nI thought gcc-<N> executable should be linked by `brew-install'\nitself, no?\n\nThis patch applied on top of the patch you replied works fine!\n\n> With your changes if none of the listed gcc-<N> binaries were\n> available in PATH, then we would silently build with the generic 'cc',\n> which is 'clang' on OSX, and that's definitely not what we want.\n\nI'm addressing this issue with a change in ci/lib.sh below.\nBy adding /bin/false as a fallback.\n\nIf we could agree that the previous patch and this patch, together,\ncould be good, I'll re-organise it and send again later.\n\nEither that, or squash this into the previous patch\n\n--------8<-------------------\nFrom: Doan Tran Cong Danh <congdanhqx@gmail.com>\nDate: Thu, 28 Nov 2019 18:24:58 +0700\nSubject: [PATCH/RFC] ci: install latest gcc from brew for macOS build on travis\n\nUntil now, we ask brew install the specific version of gcc (gcc@8),\nbut for some reason, brew decided to install the latest version instead.\n\nWith the previous change, we're assuming that gcc-<N> executable is\nexisted in $PATH, we will find that executable instead.\n\nWhile we're at it, don't ask brew to link gcc, since it should be taken\nby `brew-install' itself.\n\nSigned-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>\n---\n ci/install-dependencies.sh | 2 --\n ci/lib.sh                  | 4 ++--\n 2 files changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh\nindex 4e64a19112..a671ee1005 100755\n--- a/ci/install-dependencies.sh\n+++ b/ci/install-dependencies.sh\n@@ -48,8 +48,6 @@ osx-clang|osx-gcc)\n \tbrew install caskroom/cask/perforce\n \tcase \"$jobname\" in\n \tosx-gcc)\n-\t\tbrew link gcc ||\n-\t\tbrew link gcc@8\n \t\t;;\n \tesac\n \t;;\ndiff --git a/ci/lib.sh b/ci/lib.sh\nindex 4040fc1a22..02cdb47419 100755\n--- a/ci/lib.sh\n+++ b/ci/lib.sh\n@@ -131,7 +131,7 @@ then\n \t\techo \"$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1\"\n \t}\n \n-\tBREW_INSTALL_PACKAGES=gcc@8\n+\tBREW_INSTALL_PACKAGES=gcc\n \texport GIT_PROVE_OPTS=\"--timer --jobs 10 --state=failed,slow,save\"\n \texport GIT_TEST_OPTS=\"--verbose-log -x --write-junit-xml\"\n \tMAKEFLAGS=\"$MAKEFLAGS --jobs=10\"\n@@ -160,7 +160,7 @@ export GIT_TEST_CLONE_2GB=YesPlease\n \n case \"$jobname\" in\n *-gcc)\n-\tfor gitcc in gcc-10 gcc-9 gcc-8\n+\tfor gitcc in gcc-10 gcc-9 gcc-8 false\n \tdo\n \t\tif command -v $gitcc >/dev/null 2>&1\n \t\tthen\n-- \n2.24.0.615.g37f5bfbdea\n\n"},{"id":"387283","messageId":"20191128123316.GG23183@szeder.dev","threadId":"52338","inReplyTo":"20191128120330.GA9067@danh.dev","subject":"Re: [PATCH] ci: detect installed gcc in Travis CI","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-11-28T12:33:16Z","receivedAt":"2019-11-28T12:33:25Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Thu, Nov 28, 2019 at 07:03:30PM +0700, Danh Doan wrote:\n> On 2019-11-27 17:48:20+0100, SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > On Wed, Nov 27, 2019 at 11:15:55PM +0700, Doan Tran Cong Danh wrote:\n> > > Travis CI has continously updated their images, including updating gcc\n> > > installation.\n> > > \n> > > Save us some headache by checking which version of gcc is installed in\n> > > the image, and use said version to run the build.\n> > > \n> > > While gcc-10 hasn't been released, yet, add it to the list to save us\n> > > some headache in the future.\n> > > \n> > > Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>\n> > > ---\n> > >  ci/lib.sh | 24 ++++++++++++++----------\n> > >  1 file changed, 14 insertions(+), 10 deletions(-)\n> > > \n> > > diff --git a/ci/lib.sh b/ci/lib.sh\n> > > index c8c2c38155..4040fc1a22 100755\n> > > --- a/ci/lib.sh\n> > > +++ b/ci/lib.sh\n> > > @@ -159,12 +159,21 @@ export DEFAULT_TEST_TARGET=prove\n> > >  export GIT_TEST_CLONE_2GB=YesPlease\n> > >  \n> > >  case \"$jobname\" in\n> > > -linux-clang|linux-gcc)\n> > > -\tif [ \"$jobname\" = linux-gcc ]\n> > > -\tthen\n> > > -\t\texport CC=gcc-8\n> > > -\tfi\n> > > +*-gcc)\n> > > +\tfor gitcc in gcc-10 gcc-9 gcc-8\n> > > +\tdo\n> > > +\t\tif command -v $gitcc >/dev/null 2>&1\n> > > +\t\tthen\n> > > +\t\t\texport CC=$gitcc\n> > > +\t\t\tbreak;\n> > > +\t\tfi\n> > > +\tdone\n> > \n> > This assummes that some of these gcc-<N> binaries can be found in\n> > PATH, but that hasn't always been the case in the past: up until end\n> > of last week Travis CI's xcode10.1 image came with GCC 8 pre-installed\n> > but not linked and without GCC 9, i.e. neither 'gcc-8' nor 'gcc-9' was\n> > available in PATH.  While now that image does have GCC 9 properly\n> > installed, i.e. 'gcc-9' has been available in PATH for almost a week,\n> > I wouldn't want to rely on that...\n> \n> I thought gcc-<N> executable should be linked by `brew-install'\n> itself, no?\n\n'brew install' does not link already installed but not linked\npackages, but instructs the user to run 'brew link' instead; see\n\n  https://public-inbox.org/git/20191127162416.19391-1-szeder.dev@gmail.com/\n\n"}]}