Skip to content

Commit a759176

Browse files
[Github] Fix LLVM Project Tests Workflow on Linux (#122221)
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.
1 parent 465a3ce commit a759176

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/libclang-python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jobs:
3737
projects: clang
3838
# There is an issue running on "windows-2019".
3939
# See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
40-
os_list: '["ubuntu-latest"]'
40+
os_list: '["ubuntu-22.04"]'
4141
python_version: ${{ matrix.python-version }}

.github/workflows/llvm-project-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ on:
3939
type: string
4040
# Use windows-2019 due to:
4141
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
42-
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
42+
# Use ubuntu-22.04 rather than ubuntu-latest to match the ubuntu
43+
# version in the CI container. Without this, setup-python tries
44+
# to install a python version linked against a newer version of glibc.
45+
# TODO(boomanaiden154): Bump the Ubuntu version once the version in the
46+
# container is bumped.
47+
default: '["ubuntu-22.04", "windows-2019", "macOS-13"]'
4348

4449
python_version:
4550
required: false
@@ -113,7 +118,8 @@ jobs:
113118
run: |
114119
if [ "${{ runner.os }}" == "Linux" ]; then
115120
builddir="/mnt/build/"
116-
mkdir -p $builddir
121+
sudo mkdir -p $builddir
122+
sudo chown gha $builddir
117123
extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
118124
else
119125
builddir="$(pwd)"/build

0 commit comments

Comments
 (0)