Created attachment 560170 [details, diff] cmake-utils.patch In the eclass there is a patching of the upstream CMakeLists.txt commenting out set() line redefining a few cmake variables used by the eclass itself. The sed line used for patching are too aggressive catching more cases than needed. For instance, in the opencascade package, there is a variable CMAKE_INSTALL_PREFIX_PREV which is commented out by the sed lines. I am attaching a simple patch proposal to restrict cases to be patched. In addition the patch also adds a better description to the commented out lines
sorry, I put the wrong title (now fixed), the bug must be then properly reassigned
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/kde.git/commit/?id=3603015258476c34dde7d805abc9b5474fd6e4dd commit 3603015258476c34dde7d805abc9b5474fd6e4dd Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2019-02-24 13:32:58 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2019-03-01 13:29:08 +0000 cmake-utils.eclass: Fix _cmake_modify-cmakelists, add QA output Bug: https://bugs.gentoo.org/674768 Reported-by: Fabio Rossi <rossi.f@inwind.it> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> eclass/cmake-utils.eclass | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b7998b644e6f4469a7cb4c64776013a74363866 commit 6b7998b644e6f4469a7cb4c64776013a74363866 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2019-02-24 13:32:58 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2019-05-18 19:32:25 +0000 cmake-utils.eclass: Fix _cmake_modify-cmakelists, add einfo output Closes: https://bugs.gentoo.org/674768 Reported-by: Fabio Rossi <rossi.f@inwind.it> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> eclass/cmake-utils.eclass | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
The change in 6b7998b644e6f4469a7cb4c64776013a74363866 breaks the dev-util/cmake test suite, because it patches out calls to "set(CMAKE_BUILD_TYPE Debug)" in two tests, causing them to fail: Tests/CMakeOnly/SelectLibraryConfigurations Tests/OutDir
(In reply to Samuel Holland from comment #4) > The change in 6b7998b644e6f4469a7cb4c64776013a74363866 breaks the > dev-util/cmake test suite, because it patches out calls to > "set(CMAKE_BUILD_TYPE Debug)" in two tests, causing them to fail: No, 6b7998b644e6f4469a7cb4c64776013a74363866 does not change behaviour in that regard. It only makes the changes already being applied in cmake-utils.eclass more visible using einfo and a better comment.
Actually, it is doing less modifications, which was the intent of the commit. Here's the only effective difference, not sure about possible implications: Before 6b7998b6: > --- a/Tests/OutDir/CMakeLists.txt > +++ b/Tests/OutDir/CMakeLists.txt > @@ -7,9 +7,9 @@ if(_isMultiConfig) > string(TOUPPER "${config}" CONFIG) > list(APPEND configs "${CONFIG}") > endforeach() > - set(CMAKE_BUILD_TYPE) > +#IGNORE set(CMAKE_BUILD_TYPE) > elseif(NOT CMAKE_BUILD_TYPE) > - set(CMAKE_BUILD_TYPE Debug) > +#IGNORE set(CMAKE_BUILD_TYPE Debug) > endif() > > if(CMAKE_BUILD_TYPE) after: > --- a/Tests/OutDir/CMakeLists.txt > +++ b/Tests/OutDir/CMakeLists.txt > @@ -9,7 +9,7 @@ if(_isMultiConfig) > endforeach() > set(CMAKE_BUILD_TYPE) > elseif(NOT CMAKE_BUILD_TYPE) > - set(CMAKE_BUILD_TYPE Debug) > +#_cmake_modify_IGNORE set(CMAKE_BUILD_TYPE Debug) > endif() > > if(CMAKE_BUILD_TYPE)
(In reply to Andreas Sturmlechner from comment #5) > (In reply to Samuel Holland from comment #4) > > The change in 6b7998b644e6f4469a7cb4c64776013a74363866 breaks the > > dev-util/cmake test suite, because it patches out calls to > > "set(CMAKE_BUILD_TYPE Debug)" in two tests, causing them to fail: > > No, 6b7998b644e6f4469a7cb4c64776013a74363866 does not change behaviour in > that regard. It only makes the changes already being applied in > cmake-utils.eclass more visible using einfo and a better comment. Okay. Sorry, I didn't fully bisect the change. What I know is that cmake used to pass it's test suite and doesn't anymore due to the commented-out lines. I applied this patch to the eclass (there's probably a better check to make) and the test suite passes again: --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -468,7 +468,9 @@ _cmake_cleanup_cmake() { fi # Remove dangerous things. - _cmake_modify-cmakelists + if [[ ${PN} != "cmake" ]] ; then + _cmake_modify-cmakelists + fi } # @FUNCTION: cmake-utils_src_prepare
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/kde.git/commit/?id=e805777440326a241ed04343a995ed0cecddd682 commit e805777440326a241ed04343a995ed0cecddd682 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2019-05-19 16:15:29 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2019-05-19 16:48:05 +0000 cmake-utils.eclass: _cmake_modify-cmakelists: Fix CMAKE_BUILD_TYPE sed Commit 6b7998b narrowed matching CMAKE_BUILD_TYPE too successfully and led to a string like `set(CMAKE_BUILD_TYPE)` being left over. Bug: https://bugs.gentoo.org/674768 Closes: https://bugs.gentoo.org/686266 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> eclass/cmake-utils.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b5582636d219284037ee65bc427194d7e969c4b commit 3b5582636d219284037ee65bc427194d7e969c4b Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2019-05-19 16:15:29 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2019-07-04 19:36:08 +0000 cmake-utils.eclass: _cmake_modify-cmakelists: Fix CMAKE_BUILD_TYPE sed Commit 6b7998b narrowed matching CMAKE_BUILD_TYPE too successfully and led to a string like `set(CMAKE_BUILD_TYPE)` being left over. Bug: https://bugs.gentoo.org/674768 Closes: https://bugs.gentoo.org/686266 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> eclass/cmake-utils.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)