From 1e0387cf857bf2ef27e05d190fbbb2b1ceffa5e9 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 30 Jul 2024 14:59:07 +0000 Subject: [PATCH] Disable python-lit and lldb for compat builds --- build.spec.inc | 11 ++++++++++- check.spec.inc | 3 +++ files.spec.inc | 4 ++++ globals.spec.inc | 9 +++++++++ install.spec.inc | 4 ++++ packages.spec.inc | 6 ++++-- 6 files changed, 34 insertions(+), 3 deletions(-) diff --git a/build.spec.inc b/build.spec.inc index bbf1688..732837c 100644 --- a/build.spec.inc +++ b/build.spec.inc @@ -12,6 +12,11 @@ %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif +%global projects clang;clang-tools-extra;lld +%if %{with lldb} +%global projects %{projects};lldb +%endif + # Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files. export ASMFLAGS="%{build_cflags}" @@ -32,9 +37,11 @@ export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:`pwd`/llvm/%{_vpath_builddir}/%{_lib} cd llvm #region LLVM lit +%if %{with python_lit} pushd utils/lit %py3_build popd +%endif #endregion %if 0%{?rhel} == 8 @@ -47,7 +54,7 @@ popd # TODO: Override LIBOMP_INSTALL_LIBDIR, because otherwise the libraries # are installed to /usr/lib64/$TRIPLE and clang can't find them. %cmake -G Ninja \ - -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb" \ + -DLLVM_ENABLE_PROJECTS="%{projects}" \ \ \ -DCLANG_DEFAULT_PIE_ON_LINUX=OFF \ @@ -196,6 +203,7 @@ popd \ \ \ +%if %{with lldb} -DLLDB_DISABLE_CURSES:BOOL=OFF \ -DLLDB_DISABLE_LIBEDIT:BOOL=OFF \ -DLLDB_DISABLE_PYTHON:BOOL=OFF \ @@ -203,6 +211,7 @@ popd -DLLDB_TEST_USER_ARGS=--skip-category=watchpoint \ %endif -DLLDB_ENFORCE_STRICT_TEST_REQUIREMENTS:BOOL=ON \ +%endif \ \ \ diff --git a/check.spec.inc b/check.spec.inc index b5e105f..b772f63 100644 --- a/check.spec.inc +++ b/check.spec.inc @@ -70,6 +70,7 @@ function test_list_to_regex() #endregion #region Test LLVM lit +# It's fine to always run this, even if we're not shipping python-lit. reset_test_opts %cmake_build --target check-lit #endregion @@ -249,6 +250,7 @@ export LIT_FILTER_OUT=$(test_list_to_regex test_list_filter_out) %cmake_build --target check-openmp #endregion +%if %{with lldb} # Don't run LLDB tests on s390x because more than 150 tests are failing there %ifnarch s390x ## TODO(kkleine): Come back and re-enable testing for LLDB @@ -267,6 +269,7 @@ export LIT_FILTER_OUT=$(test_list_to_regex test_list_filter_out) ## %%cmake_build --target check-lldb-shell ## #endregion %endif +%endif #region Test LLD diff --git a/files.spec.inc b/files.spec.inc index ac56147..76158dc 100644 --- a/files.spec.inc +++ b/files.spec.inc @@ -1,10 +1,12 @@ #region LLVM lit files +%if %{with python_lit} %files -n python3-lit %license llvm/utils/lit/LICENSE.TXT %doc llvm/utils/lit/README.rst %{python3_sitelib}/lit/ %{python3_sitelib}/lit-*-info/ %{_bindir}/lit +%endif #endregion #region LLVM files @@ -632,6 +634,7 @@ #endregion #region LLDB files +%if %{with lldb} %files -n %{pkg_name_lldb} %license lldb/LICENSE.TXT %{install_bindir}/lldb* @@ -646,4 +649,5 @@ %files -n python3-lldb %{python3_sitearch}/lldb +%endif #endregion diff --git a/globals.spec.inc b/globals.spec.inc index 8e7d78d..cf96b1a 100644 --- a/globals.spec.inc +++ b/globals.spec.inc @@ -8,6 +8,15 @@ %bcond_with compat_build %bcond_without check +# Compat builds do not include python-lit and lldb +%if %{with compat_build} +%bcond_with python_lit +%bcond_with lldb +%else +%bcond_without python_lit +%bcond_without lldb +%endif + # Disable LTO on x86 and riscv in order to reduce memory consumption. %ifarch %ix86 riscv64 %bcond_with lto_build diff --git a/install.spec.inc b/install.spec.inc index 1b0261b..5e0848c 100644 --- a/install.spec.inc +++ b/install.spec.inc @@ -2,12 +2,14 @@ pushd llvm +%if %{with python_lit} pushd utils/lit %py3_install # Strip out #!/usr/bin/env python sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python3_sitelib}/lit/*.py popd +%endif %cmake_install @@ -286,6 +288,7 @@ fi #endregion #region LLDB installation +%if %{with lldb} %multilib_fix_c_header --file %{install_includedir}/lldb/Host/Config.h # remove static libraries @@ -298,4 +301,5 @@ ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so # remove bundled six.py rm -f %{buildroot}%{python3_sitearch}/six.* +%endif #endregion diff --git a/packages.spec.inc b/packages.spec.inc index d2ebcba..8abf8d7 100644 --- a/packages.spec.inc +++ b/packages.spec.inc @@ -1,4 +1,5 @@ #region LLVM lit package +%if %{with python_lit} %package -n python3-lit Summary: LLVM lit test runner for Python 3 @@ -8,6 +9,7 @@ Recommends: python3-psutil %description -n python3-lit lit is a tool used by the LLVM project for executing its test suites. +%endif #endregion #region LLVM packages @@ -322,7 +324,7 @@ This is the main package for llvm-toolset. #endregion #region LLDB packages - +%if %{with lldb} %package -n %{pkg_name_lldb} Summary: Next generation high-performance debugger License: Apache-2.0 WITH LLVM-exception OR NCSA @@ -352,5 +354,5 @@ Requires: %{pkg_name_lldb}%{?_isa} = %{version}-%{release} %description -n python3-lldb The package contains the LLDB Python module. - +%endif #endregion