Add python-lit, remove patch, change obsoletes version

This commit is contained in:
Nikita Popov 2024-08-02 07:32:13 +00:00 committed by nikic
parent 7528637fbe
commit 6bae4bb194
5 changed files with 18 additions and 116 deletions

View file

@ -1,101 +0,0 @@
From 74f3d3579ef636a20d7832b39bf1355c0f734848 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov@redhat.com>
Date: Fri, 19 Jul 2024 14:52:49 +0200
Subject: [PATCH] Add back support for Python 3.6
---
.../clang-tidy/tool/run-clang-tidy.py | 21 ++++++++++++++++---
llvm/CMakeLists.txt | 2 +-
llvm/utils/update_test_body.py | 6 ++++--
3 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
index 48401ba5ea42..c6552db36587 100755
--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -36,7 +36,6 @@ http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
import argparse
import asyncio
-from dataclasses import dataclass
import glob
import json
import multiprocessing
@@ -223,7 +222,6 @@ async def run_with_semaphore(
return await f(*args, **kwargs)
-@dataclass
class ClangTidyResult:
filename: str
invocation: List[str]
@@ -232,6 +230,22 @@ class ClangTidyResult:
stderr: str
elapsed: float
+ def __init(
+ self,
+ filename: str,
+ invocation: List[str],
+ returncode: int,
+ stdout: str,
+ stderr: str,
+ elapsed: float,
+ ):
+ self.filename = filename
+ self.invocation = invocation
+ self.returncode = returncode
+ self.stdout = stdout
+ self.stderr = stderr
+ self.elapsed = elapsed
+
async def run_tidy(
args: argparse.Namespace,
@@ -623,4 +637,5 @@ async def main() -> None:
if __name__ == "__main__":
- asyncio.run(main())
+ loop = asyncio.new_event_loop()
+ loop.run_until_complete(main())
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 12618966c4ad..9c4df0082a9a 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -932,7 +932,7 @@ set(LLVM_PROFDATA_FILE "" CACHE FILEPATH
if(LLVM_INCLUDE_TESTS)
# All LLVM Python files should be compatible down to this minimum version.
- set(LLVM_MINIMUM_PYTHON_VERSION 3.8)
+ set(LLVM_MINIMUM_PYTHON_VERSION 3.6)
else()
# FIXME: it is unknown if this is the actual minimum bound
set(LLVM_MINIMUM_PYTHON_VERSION 3.0)
diff --git a/llvm/utils/update_test_body.py b/llvm/utils/update_test_body.py
index 661b0270d783..152d0c5f8476 100755
--- a/llvm/utils/update_test_body.py
+++ b/llvm/utils/update_test_body.py
@@ -57,7 +57,8 @@ def process(args, path):
input="\n".join(
prolog[:-1] if prolog[-1].startswith(".endif") else prolog
).encode(),
- capture_output=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
check=True,
)
except subprocess.CalledProcessError as ex:
@@ -71,7 +72,8 @@ def process(args, path):
sub = subprocess.run(
["sh", "-eu", "gen"],
- capture_output=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
# Don't encode the directory information to the Clang output.
# Remove unneeded details (.ident) as well.
env=dict(
--
2.45.2

View file

@ -1,6 +1,6 @@
#region LLVM lit files
%if %{with python_lit}
%files -n python3-lit
%files -n python%{python3_pkgversion}-lit
%license llvm/utils/lit/LICENSE.TXT
%doc llvm/utils/lit/README.rst
%{python3_sitelib}/lit/

View file

@ -73,8 +73,6 @@ Patch3002: 0001-Always-build-shared-libs-for-LLD.patch
#region RHEL patches
# All RHEL
Patch9001: 0001-Remove-myst_parser-dependency-for-RHEL.patch
# RHEL 8 only
Patch9002: 0001-Add-back-support-for-Python-3.6.patch
#endregion
%if 0%{?rhel} == 8
@ -91,9 +89,11 @@ BuildRequires: zlib-devel
BuildRequires: libffi-devel
BuildRequires: ncurses-devel
# This intentionally does not use python3_pkgversion. RHEL 8 does not have
# python3.11-sphinx, and we are only using it as a binary anyway.
# python3.12-sphinx, and we are only using it as a binary anyway.
BuildRequires: python3-sphinx
%if 0%{?rhel} != 8
# RHEL 8 does not have these packages for python3.12. However, they are only
# needed for LLDB tests.
BuildRequires: python%{python3_pkgversion}-psutil
BuildRequires: python%{python3_pkgversion}-pexpect
%endif

View file

@ -1,13 +1,19 @@
#region LLVM lit package
%if %{with python_lit}
%package -n python3-lit
%package -n python%{python3_pkgversion}-lit
Summary: LLVM lit test runner for Python 3
BuildArch: noarch
Requires: python3-setuptools
Recommends: python3-psutil
Requires: python%{python3_pkgversion}-setuptools
%if 0%{?rhel} == 8
# Became python3.12-clang in LLVM 20
Obsoletes: python3-lit < 19.9
%else
# This optional dependency is not available for python3.12 on RHEL 8.
Recommends: python%{python3_pkgversion}-psutil
%endif
%description -n python3-lit
%description -n python%{python3_pkgversion}-lit
lit is a tool used by the LLVM project for executing its test suites.
%endif
#endregion
@ -206,8 +212,8 @@ Summary: Python3 bindings for clang
Requires: %{pkg_name_clang}-devel%{?_isa} = %{version}-%{release}
Requires: python%{python3_pkgversion}
%if 0%{?rhel} == 8
# Became python3.12-clang in LLVM 19
Obsoletes: python3-clang < 18.9
# Became python3.12-clang in LLVM 20
Obsoletes: python3-clang < 19.9
%endif
%description -n python%{python3_pkgversion}-clang
%{summary}.
@ -339,8 +345,8 @@ Requires: python%{python3_pkgversion}-six
Requires: %{pkg_name_lldb}%{?_isa} = %{version}-%{release}
%if 0%{?rhel} == 8
# Became python3.12-lldb in LLVM 19
Obsoletes: python3-lldb < 18.9
# Became python3.12-lldb in LLVM 20
Obsoletes: python3-lldb < 19.9
%endif
%description -n python%{python3_pkgversion}-lldb

View file

@ -16,9 +16,6 @@
%if %{defined rhel}
%patch -p1 -P9001
%if %rhel == 8
%patch -p1 -P9002
%endif
%endif
#region LLVM preparation