From 695ed89b6ca27e00b8dcadfc2c84a6cb8162c69a Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Mon, 1 Dec 2025 09:03:12 +0100 Subject: [PATCH] ci: fix gcc version disambiguation in setup-deps Use JSON output and jq to select the newest installed gcc version when multiple versions match, avoiding conflicts between system and spack-installed compilers. --- .github/actions/setup-deps/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-deps/action.yml b/.github/actions/setup-deps/action.yml index d020a11a..ad966472 100644 --- a/.github/actions/setup-deps/action.yml +++ b/.github/actions/setup-deps/action.yml @@ -36,7 +36,8 @@ runs: run: | echo "::group::Install GCC" spack install ${{ inputs.fresh == 'true' && '--fresh' || '' }} gcc@${{ inputs.gcc }} target=x86_64_v3 - spack compiler find $(spack location -i gcc@${{ inputs.gcc }}) + gcc_hash=$(spack find --json gcc@${{ inputs.gcc }} target=x86_64_v3 | jq -r 'sort_by(.version | split(".") | map(tonumber)) | last | .hash') + spack compiler find "$(spack location -i /$gcc_hash)" echo "::endgroup::" - name: Install dependencies