From e9463cc03de3aeeaead02cdb190c07b3b235d045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 27 Sep 2023 21:06:51 +0200 Subject: [PATCH] cmake-3.27.6, include new upstream patch Fixes rhbz#2239015, rhbz#2240311 --- 0001-Linting-Fix-empty-evaluated-genex.patch | 70 ++++++++++++++++++++ cmake.spec | 10 ++- sources | 2 +- 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 0001-Linting-Fix-empty-evaluated-genex.patch diff --git a/0001-Linting-Fix-empty-evaluated-genex.patch b/0001-Linting-Fix-empty-evaluated-genex.patch new file mode 100644 index 0000000..7d0eb28 --- /dev/null +++ b/0001-Linting-Fix-empty-evaluated-genex.patch @@ -0,0 +1,70 @@ +From 80df7b174506eb5c7d9db3e65e2ffb59b9e8f16d Mon Sep 17 00:00:00 2001 +From: Orkun Tokdemir +Date: Mon, 25 Sep 2023 14:50:59 +0200 +Subject: [PATCH] Linting: Fix empty evaluated genex +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Update logic added by commit 099934e313 (Add generator expression +support to static code analysis hooks, 2023-03-24, v3.27.0-rc1~261^2), +and preserved by commit 993dde925f (TargetGenerator: Factor out +generation of code check rules, 2023-05-12, v3.27.0-rc1~84^2~2), to +handle a generator expression that evaluates to the empty string. + +If `_CPPCHECK`, `_CPPLINT`, `_CLANG_TIDY`, or +`_INCLUDE_WHAT_YOU_USE` are empty after evaluating generator +expressions, do not run their lints. + +Fixes: #25265 +Signed-off-by: Björn Esser +--- + Source/cmCommonTargetGenerator.cxx | 5 +---- + Tests/RunCMake/MultiLint/RunCMakeTest.cmake | 1 + + Tests/RunCMake/MultiLint/genex.cmake | 6 ++++++ + 3 files changed, 8 insertions(+), 4 deletions(-) + create mode 100644 Tests/RunCMake/MultiLint/genex.cmake + +diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx +index 1924235dda..c781137669 100644 +--- a/Source/cmCommonTargetGenerator.cxx ++++ b/Source/cmCommonTargetGenerator.cxx +@@ -335,10 +335,7 @@ std::string cmCommonTargetGenerator::GenerateCodeCheckRules( + auto evaluatedProp = cmGeneratorExpression::Evaluate( + *value, this->GeneratorTarget->GetLocalGenerator(), config, + this->GeneratorTarget, nullptr, this->GeneratorTarget, lang); +- if (!evaluatedProp.empty()) { +- return evaluatedProp; +- } +- return *value; ++ return evaluatedProp; + }; + std::string const tidy_prop = cmStrCat(lang, "_CLANG_TIDY"); + tidy = evaluateProp(tidy_prop); +diff --git a/Tests/RunCMake/MultiLint/RunCMakeTest.cmake b/Tests/RunCMake/MultiLint/RunCMakeTest.cmake +index 9b7a6a9971..f2df29019b 100644 +--- a/Tests/RunCMake/MultiLint/RunCMakeTest.cmake ++++ b/Tests/RunCMake/MultiLint/RunCMakeTest.cmake +@@ -24,6 +24,7 @@ run_multilint(CXX) + if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") + run_multilint(C-launch) + run_multilint(CXX-launch) ++ run_multilint(genex) + endif() + + function(run_skip_linting test_name) +diff --git a/Tests/RunCMake/MultiLint/genex.cmake b/Tests/RunCMake/MultiLint/genex.cmake +new file mode 100644 +index 0000000000..17f9248b00 +--- /dev/null ++++ b/Tests/RunCMake/MultiLint/genex.cmake +@@ -0,0 +1,6 @@ ++enable_language(CXX) ++set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "$,${PSEUDO_IWYU},>") ++set(CMAKE_CXX_CLANG_TIDY "$,${PSEUDO_TIDY} --error,>") ++set(CMAKE_CXX_CPPLINT "$,${PSEUDO_CPPLINT} --error,>") ++set(CMAKE_CXX_CPPCHECK "$,${PSEUDO_CPPCHECK} -bad,>") ++add_executable(main main.cxx) +-- +2.41.0 + diff --git a/cmake.spec b/cmake.spec index 681a243..6563be9 100644 --- a/cmake.spec +++ b/cmake.spec @@ -69,7 +69,7 @@ %global major_version 3 %global minor_version 27 -%global patch_version 5 +%global patch_version 6 # For handling bump release by rpmdev-bumpspec and mass rebuild %global baserelease 1 @@ -123,6 +123,9 @@ Patch100: %{name}-findruby.patch Patch1: %{name}-rename.patch %endif +# https://gitlab.kitware.com/cmake/cmake/-/issues/25265 +Patch10001: 0001-Linting-Fix-empty-evaluated-genex.patch + BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc-c++ @@ -549,6 +552,11 @@ popd %changelog +* Wed Sep 27 2023 Björn Esser - 3.27.6-1 +- cmake-3.27.6 + Fixes rhbz#2239015, rhbz#2240311 +- Include new upstream patch + * Fri Sep 15 2023 Björn Esser - 3.27.5-1 - cmake-3.27.5 Fixes rhbz#2239015 diff --git a/sources b/sources index 9e32a9c..ee8c9ce 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cmake-3.27.5.tar.gz) = db8f2929b956043a42e2cf73708f9435d427cff8f5d334d4631b67da8446c388c52960929d6e428496ca135758af315aad4adc8dc19268099dafc7a2e5a61d42 +SHA512 (cmake-3.27.6.tar.gz) = 268b5bd84800c37ce0e311cadf13c275a538d612844cc8687107549fe6341a6c3115560e3b9162836843016213d225f62db130bc251bf8aff50c69b9bd58e638