Re: [PATCH 2/3] ci: avoid bare "gcc" for osx-gcc job

Kyle Lippincott
2024-05-10T20:32:33Z

On Thu, May 9, 2024 at 9:24 AM Jeff King <peff@peff.net> wrote:
>
> On macOS, a bare "gcc" (without a version) will invoke a wrapper for
> clang, not actual gcc. Even when gcc is installed via homebrew, that
> only provides version-specific links in /usr/local/bin (like "gcc-13"),
> and never a version-agnostic "gcc" wrapper.
>
> As far as I can tell, this has been the case for a long time, and this
> osx-gcc job has largely been doing nothing.

If it's been doing nothing (which I interpreted as "it's doing the
same thing as osx-clang"), and we've not noticed any issues with that,
do we need the job at all? Should we just rely on clang and not test
with gcc on macOS, since it's not a compiler that's provided by the
platform anymore?

> We can point it at "gcc-13",
> which will pick up the homebrew-installed version.
>
> The fix here is specific to the github workflow file, as the gitlab one
> does not have a matching job.
>
> It's a little unfortunate that we cannot just ask for the latest version
> of gcc which homebrew provides, but as far as I can tell there is no
> easy alias (you'd have to find the highest number gcc-* in
> /usr/local/bin yourself).
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> We'll eventually have to bump "gcc-13" to "gcc-14" here, and so on. I
> don't think we ever cared about gcc-13 in particular; it's just that
> older versions of the runner image had some ancient version which we
> wanted to avoid.
>
> .github/workflows/main.yml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
> index 5838986895..5f92a50271 100644
> --- a/.github/workflows/main.yml
> +++ b/.github/workflows/main.yml
> @@ -284,7 +284,7 @@ jobs:
> cc: clang
> pool: macos-13
> - jobname: osx-gcc
> - cc: gcc
> + cc: gcc-13
> cc_package: gcc-13
> pool: macos-13
> - jobname: linux-gcc-default
> --
> 2.45.0.414.g4009e73179
>
>