Skip to content

Conversation

@llvmbot
Copy link
Member

@llvmbot llvmbot commented Jan 13, 2025

Backport a759176

Requested by: @boomanaiden154

This patch fixes the LLVM project tests workflow on Linux. Two changes
were needed. Firstly, some commands need to be performed with sudo now
that the container executes as a non-root user. Second, we needed to
change from `ubuntu-latest` to `ubuntu-22.04` as `ubuntu-latest` not
defaults to `ubuntu-24.04` which causes `setup-python` to install a
python executable linked against a newer version of glibc that is not
found on ubuntu 22.04, which causes failures when CMake cannot execute
the python interpreter that it finds.

(cherry picked from commit a759176)
@llvmbot llvmbot added this to the LLVM 19.X Release milestone Jan 13, 2025
@llvmbot
Copy link
Member Author

llvmbot commented Jan 13, 2025

@tstellar What do you think about merging this PR to the release branch?

@llvmbot
Copy link
Member Author

llvmbot commented Jan 13, 2025

@llvm/pr-subscribers-github-workflow

Author: None (llvmbot)

Changes

Backport a759176

Requested by: @boomanaiden154


Full diff: https://github.com/llvm/llvm-project/pull/122814.diff

2 Files Affected:

  • (modified) .github/workflows/libclang-python-tests.yml (+1-1)
  • (modified) .github/workflows/llvm-project-tests.yml (+8-2)
diff --git a/.github/workflows/libclang-python-tests.yml b/.github/workflows/libclang-python-tests.yml
index 43ded0af3ac21c..33d6c2174dca47 100644
--- a/.github/workflows/libclang-python-tests.yml
+++ b/.github/workflows/libclang-python-tests.yml
@@ -43,5 +43,5 @@ jobs:
       projects: clang
       # There is an issue running on "windows-2019".
       # See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
-      os_list: '["ubuntu-latest"]'
+      os_list: '["ubuntu-22.04"]'
       python_version: ${{ matrix.python-version }}
diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml
index 17a54be16badc1..fa11f6b9b45696 100644
--- a/.github/workflows/llvm-project-tests.yml
+++ b/.github/workflows/llvm-project-tests.yml
@@ -39,7 +39,12 @@ on:
         type: string
         # Use windows-2019 due to:
         # https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
-        default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
+        # Use ubuntu-22.04 rather than ubuntu-latest to match the ubuntu
+        # version in the CI container. Without this, setup-python tries
+        # to install a python version linked against a newer version of glibc.
+        # TODO(boomanaiden154): Bump the Ubuntu version once the version in the
+        # container is bumped.
+        default: '["ubuntu-22.04", "windows-2019", "macOS-13"]'
 
       python_version:
         required: false
@@ -113,7 +118,8 @@ jobs:
         run: |
           if [ "${{ runner.os }}" == "Linux" ]; then
             builddir="/mnt/build/"
-            mkdir -p $builddir
+            sudo mkdir -p $builddir
+            sudo chown gha $builddir
             extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
           else
             builddir="$(pwd)"/build

@tru tru merged commit 510be23 into llvm:release/19.x Jan 14, 2025
28 of 29 checks passed
@github-actions
Copy link

@boomanaiden154 (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants