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

[PATCH v2] CI: select CC based on CC_PACKAGE (again)

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 21, 2022, 17:48 UTC
Message-ID
<patch-v2-1.1-92acf9420a9-20220421T174733Z-avarab@gmail.com>
In-Reply-To
<patch-1.1-d89ad4d5b7c-20220421T130310Z-avarab@gmail.com>

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.

Furthermore in 25715419bf4 (CI: don't run "make test" twice in one job, 2021-11-23) when the "linux-TEST-vars" job was split off from "linux-gcc" the "cc_package: gcc-8" line was copied along with it.

That wasn't a bug per-se, as that "make test" would have run under GCC 8 before the split into two jobs, but the point of selecting different compiler for these jobs is to get better coverage, and to narrow down any issues with a given compiler to the job that runs it. Since the "linux-TEST-vars" job is already special in other ways (in running with various GIT_TEST_* variables), and we've got the "linux-gcc" job covering gcc-8 let's have it used the default system compiler instead.

Reported-by: Carlo Arenas <carenas@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
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.

Urgh, sorry. I don't know how I got that turned around, but this version works, and the (currently ongoing) CI run shows that the linux-gcc job selects gcc-8 correctly, instead of gcc:

    https://github.com/avar/git/runs/6116735686?check_suite_focus=true#step:3:22

The osx-gcc job will be likewise fixed, but it's failing in that run due to the unrelated perforce installation issue affecting all OSX jobs (fix here: https://lore.kernel.org/git/cover-0.2-00000000000-20220421T124225Z-avarab@gmail.com/).

Range-diff against v1:
1:  d89ad4d5b7c ! 1:  92acf9420a9 CI: select CC based on CC_PACKAGE (again)
    @@ ci/lib.sh: then
      	CI_REPO_SLUG="$GITHUB_REPOSITORY"
      	CI_JOB_ID="$GITHUB_RUN_ID"
     -	CC="${CC:-gcc}"
    -+	CC="${CC:-${CC_PACKAGE:-gcc}}"
    ++	CC="${CC_PACKAGE:-${CC:-gcc}}"
      	DONT_SKIP_TAGS=t
      
      	cache_dir="$HOME/none"
 .github/workflows/main.yml | 1 -
 ci/lib.sh                  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
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"
-- 
2.36.0.879.g3659959fcca
Previous: Phillip WoodNext: Carlo Arenas
Message 3 of 18 in “CI: select CC based on CC_PACKAGE (again)”
  1. CI: select CC based on CC_PACKAGE (again)Ævar Arnfjörð Bjarmason, Apr 21, 2022
  2. Phillip WoodApr 21, 2022
  3. CI: select CC based on CC_PACKAGE (again)Ævar Arnfjörð Bjarmason, Apr 21, 2022
  4. Carlo ArenasApr 21, 2022
  5. Junio C HamanoApr 21, 2022
  6. Carlo ArenasApr 21, 2022
  7. Junio C HamanoApr 21, 2022
  8. Junio C HamanoApr 21, 2022
  9. Ævar Arnfjörð BjarmasonApr 21, 2022
  10. Junio C HamanoApr 21, 2022
  11. Ævar Arnfjörð BjarmasonApr 21, 2022
  12. Junio C HamanoApr 21, 2022
  13. CI: select CC based on CC_PACKAGE (again)Ævar Arnfjörð Bjarmason, Apr 22, 2022
  14. Phillip WoodApr 22, 2022
  15. Ævar Arnfjörð BjarmasonApr 22, 2022
  16. Junio C HamanoApr 22, 2022
  17. Junio C HamanoApr 22, 2022
  18. Ævar Arnfjörð BjarmasonApr 22, 2022

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.