git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>,
	Carlo Arenas <carenas@gmail.com>,
	Phillip Wood <phillip.wood@talktalk.net>
Subject: Re: [PATCH v2] CI: select CC based on CC_PACKAGE (again)
Date: Thu, 21 Apr 2022 12:08:27 -0700	[thread overview]
Message-ID: <xmqqzgkegspg.fsf@gitster.g> (raw)
In-Reply-To: <patch-v2-1.1-92acf9420a9-20220421T174733Z-avarab@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Thu, 21 Apr 2022 19:48:28 +0200")

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Fix a regression in 707d2f2fe86 (CI: use "$runs_on_pool", not
> "$jobname" to select packages & config, 2021-11-23).
>
> In that commit I changed CC=gcc from CC=gcc-9, but on OSX the "gcc" in
> $PATH points to clang, we need to use gcc-9 instead. Likewise for the
> linux-gcc job CC=gcc-8 was changed to the implicit CC=gcc, which would
> select GCC 9.4.0 instead of GCC 8.4.0.

Thanks for diagnosing how things were broken.

> On Thu, Apr 21 2022, Phillip Wood wrote:
>
>> CC is set in .github/workflows/main.yaml for the ubuntu and macos jobs
>> so I think they will not fallback to using CC_PACKAGE and therefore
>> not pick up the correct compiler.
> ...
> diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
> index c35200defb9..f12819a00d7 100644
> --- a/.github/workflows/main.yml
> +++ b/.github/workflows/main.yml
> @@ -236,7 +236,6 @@ jobs:
>            - jobname: linux-TEST-vars
>              cc: gcc
>              os: ubuntu
> -            cc_package: gcc-8
>              pool: ubuntu-latest
>            - jobname: osx-clang
>              cc: clang
> diff --git a/ci/lib.sh b/ci/lib.sh
> index cbc2f8f1caa..86e37da9bc5 100755
> --- a/ci/lib.sh
> +++ b/ci/lib.sh
> @@ -122,7 +122,7 @@ then
>  	test macos != "$CI_OS_NAME" || CI_OS_NAME=osx
>  	CI_REPO_SLUG="$GITHUB_REPOSITORY"
>  	CI_JOB_ID="$GITHUB_RUN_ID"
> -	CC="${CC:-gcc}"
> +	CC="${CC_PACKAGE:-${CC:-gcc}}"
>  	DONT_SKIP_TAGS=t
>  
>  	cache_dir="$HOME/none"

OK, so we favor CC_PACKAGE (from the matrix.vector.cc_package) if
set, and then cc (again, from the matrix.vector.cc) if set, and then
finally use "gcc" as a fallback.  In the osx-gcc job, cc_package is
set to gcc-9 while in the osx-clang, cc is gcc that confusingly calls
for clang.  That sounds like it would do the right thing for two
macs.

For other jobs with different settings for cc and cc_package, does
this have any effect?  I do not think I saw any mention in the
proposed log message.

		vector.cc	vector.cc_package	old	new
linux-clang	clang		-			clang	clang
linux-sha256	clang		-			clang	clang
linux-gcc	gcc		gcc-8			gcc	gcc-8
osx-clang	clang		-			clang	clang
osx-gcc		gcc		gcc-9			clang	gcc-9
linux-gcc-default gcc		-			gcc	gcc

So, linux-gcc job used to use whichever "gcc" the platform gave us,
but now it explicitly asks for gcc-8, which may or may not be
different from what linux-gcc-default uses, and there is no other
difference by this change.  We may get a better test coverage (if
the default gcc is not gcc-8) or no improvement (if the default is
gcc-8), so it is a strict improvement worth recording as an intended
side effect in the proposed log message to help future developers.

Other than that, looks good to me.


  parent reply	other threads:[~2022-04-21 19:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 13:03 [PATCH] CI: select CC based on CC_PACKAGE (again) Ævar Arnfjörð Bjarmason
2022-04-21 16:26 ` Phillip Wood
2022-04-21 17:48 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2022-04-21 19:05   ` Carlo Arenas
2022-04-21 19:11     ` Junio C Hamano
2022-04-21 19:22       ` Carlo Arenas
2022-04-21 19:47         ` Junio C Hamano
2022-04-21 19:08   ` Junio C Hamano [this message]
2022-04-21 19:13     ` Ævar Arnfjörð Bjarmason
2022-04-21 19:51       ` Junio C Hamano
2022-04-21 19:52         ` Ævar Arnfjörð Bjarmason
2022-04-21 19:55         ` Junio C Hamano
2022-04-22  9:20   ` [PATCH v3] " Ævar Arnfjörð Bjarmason
2022-04-22  9:25     ` Phillip Wood
2022-04-22 11:43       ` Ævar Arnfjörð Bjarmason
2022-04-22 18:27     ` Junio C Hamano
2022-04-22 22:40     ` Junio C Hamano
2022-04-22 22:46       ` Ævar Arnfjörð Bjarmason

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=xmqqzgkegspg.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@talktalk.net \
    --cc=sunshine@sunshineco.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).