From d7d67795710dbcb741e47d20e8fca0aba4c6f735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20J=C3=A4ger?= Date: Fri, 15 Nov 2019 23:22:58 +0100 Subject: [PATCH 1/2] Merge: Always initialize LibGit This is required by their documentation. This certainly gives us memleaks but avoids segfaults. --- src/libs/merge/CMakeLists.txt | 3 --- src/libs/merge/kdbmerge.c | 8 -------- tests/ctest/CMakeLists.txt | 5 ++--- .../tutorial_wrapper/CMakeLists.txt | 16 ++++++---------- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/libs/merge/CMakeLists.txt b/src/libs/merge/CMakeLists.txt index 23ee31be379..f708b6698a3 100644 --- a/src/libs/merge/CMakeLists.txt +++ b/src/libs/merge/CMakeLists.txt @@ -4,9 +4,6 @@ if (LibGit2_FOUND) set (CMERGE_INCLUDE_DIRS ${LibGit2_INCLUDE_DIRS}) set (CMERGE_LIBRARY_DIRS ${LibGit2_LIBRARIES}) add_definitions (-DLIBGITFOUND) - if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - add_definitions (-DCMERGE_ON_LINUX) - endif () endif () # This is derived from LibAddPlugin. LibAddLib has no such functionality yet. This is required so that libelektra-full.so has defined diff --git a/src/libs/merge/kdbmerge.c b/src/libs/merge/kdbmerge.c index c038084dc18..0f65483cd2b 100644 --- a/src/libs/merge/kdbmerge.c +++ b/src/libs/merge/kdbmerge.c @@ -988,21 +988,13 @@ KeySet * elektraMerge (KeySet * our, Key * ourRoot, KeySet * their, Key * theirR } #ifdef LIBGITFOUND -#ifndef CMERGE_ON_LINUX git_libgit2_init (); - ELEKTRA_LOG ("Initializing LibGit2"); -#else - ELEKTRA_LOG ("Not initializing LibGit2, but using it all the same."); -#endif ELEKTRA_LOG ("cmerge can use libgit2 to handle arrays"); if (handleArrays (ourCropped, theirCropped, baseCropped, result, informationKey, strategy) > 0) { ksDel (result); return NULL; } -#ifndef CMERGE_ON_LINUX - git_libgit2_shutdown (); -#endif #else ELEKTRA_LOG ("cmerge can NOT use libgit2 to handle arrays"); #endif diff --git a/tests/ctest/CMakeLists.txt b/tests/ctest/CMakeLists.txt index b6c7ff6ea4d..134f38fed8a 100644 --- a/tests/ctest/CMakeLists.txt +++ b/tests/ctest/CMakeLists.txt @@ -40,6 +40,5 @@ target_link_elektra (test_opts elektra-opts) target_link_elektra (test_cmerge elektra-merge) -if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux") - set_property (TEST test_cmerge PROPERTY LABELS memleak) -endif () +# LibGit leaks memory +set_property (TEST test_cmerge PROPERTY LABELS memleak) diff --git a/tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt b/tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt index e5d3083812b..954a1584287 100644 --- a/tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt +++ b/tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt @@ -34,16 +34,12 @@ if (ENABLE_ASAN AND APPLE AND DEFINED ENV{CIRRUS_CI}) else (ENABLE_ASAN AND APPLE AND DEFINED ENV{CIRRUS_CI}) add_msr_test (tutorial_storage_plugins "${CMAKE_SOURCE_DIR}/doc/tutorials/storage-plugins.md" REQUIRED_PLUGINS type yamlcpp) endif (ENABLE_ASAN AND APPLE AND DEFINED ENV{CIRRUS_CI}) -if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - add_msr_test (cmerge "${CMAKE_SOURCE_DIR}/doc/tutorials/cmerge.md" REQUIRED_PLUGINS hosts line) -else () - add_msr_test (cmerge "${CMAKE_SOURCE_DIR}/doc/tutorials/cmerge.md" - REQUIRED_PLUGINS hosts - line - PROPERTY - LABELS - memleak) -endif () +add_msr_test (cmerge "${CMAKE_SOURCE_DIR}/doc/tutorials/cmerge.md" + REQUIRED_PLUGINS hosts + line + PROPERTY + LABELS + memleak) if (ENABLE_ASAN) message (STATUS "Excluding Markdown Shell Recorder test for `validation`, as it leaks memory and fails with ASAN enabled") From b7cd476144274e6367320b18502fc8d9e8d197e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20J=C3=A4ger?= Date: Fri, 15 Nov 2019 23:27:58 +0100 Subject: [PATCH 2/2] Add release note --- doc/news/_preparation_next_release.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index 3440cfefad9..2bc5510709b 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -338,6 +338,7 @@ you up to date with the multi-language support provided by Elektra. - Improved `range` plugin error message. _(Michael Zronek)_ - Improved error codes documentation to clarify the hierarchy for developers. _(Michael Zronek)_ - Release notes now use git's union merge driver. _(Dominic Jäger)_ +- Please remove me. I'm only here for the build server. _(Dominic Jäger)_ ## Infrastructure