From 2e6bf0dea6b7b47a9f0ce32e866f5409df9a0293 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Fri, 20 Jan 2023 12:07:40 -0800 Subject: [PATCH] Support using llvm-15 if GH images provide it (#2543) A migration by GH that drops LLVM 14 is breaking builds. It seems to still be getting canaried, so this is showing as flaky behavior. I think it's https://github.com/actions/runner-images/pull/6871 The set of runs at https://github.com/carbon-language/carbon-lang/actions/runs/3970825811/jobs/6807006626 show the fix behavior. --- .github/workflows/tests.yaml | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1c3e144f5e7d..0df25b3a691d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -59,25 +59,40 @@ jobs: # Match the min version listed in docs/project/contribution_tools.md python-version: '3.9' - # Use LLVM 14 following: + # Use LLVM following: # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md + # Both 14 and 15 are candidates because GitHub is testing new images. - name: Setup LLVM and Clang (macOS) if: matrix.os == 'macos-12' run: | - echo "$(brew --prefix llvm@14)/bin" >> $GITHUB_PATH - echo '*** ls "$(brew --prefix llvm@14)"' - ls "$(brew --prefix llvm@14)" - echo '*** ls "$(brew --prefix llvm@14)/bin"' - ls "$(brew --prefix llvm@14)/bin" + LLVM_PATH="$(brew --prefix llvm@15)" + if [[ ! -e "${LLVM_PATH}" ]]; then + LLVM_PATH="$(brew --prefix llvm@14)" + fi + echo "Using ${LLVM_PATH}" + echo "${LLVM_PATH}/bin" >> $GITHUB_PATH + echo '*** ls "${LLVM_PATH}"' + ls "${LLVM_PATH}" + echo '*** ls "${LLVM_PATH}/bin"' + ls "${LLVM_PATH}/bin" - # Use LLVM 14 following: + # Use LLVM following: # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md + # Both 14 and 15 are candidates for forwards compatibility, although 15 + # isn't provided. - name: Setup LLVM and Clang (Linux) if: matrix.os == 'ubuntu-22.04' run: | - echo "/usr/lib/llvm-14/bin" >> $GITHUB_PATH - echo '*** ls /usr/lib/llvm-14/bin' - ls /usr/lib/llvm-14/bin + LLVM_PATH="/usr/lib/llvm-15" + if [[ ! -e "${LLVM_PATH}" ]]; then + LLVM_PATH="/usr/lib/llvm-14" + fi + echo "Using ${LLVM_PATH}" + echo "${LLVM_PATH}/bin" >> $GITHUB_PATH + echo '*** ls "${LLVM_PATH}"' + ls "${LLVM_PATH}" + echo '*** ls "${LLVM_PATH}/bin"' + ls "${LLVM_PATH}/bin" # Print the various tool paths and versions to help in debugging. - name: Print tool debugging info