diff options
author | Esteve Varela Colominas <esteve.varela@gmail.com> | 2021-07-17 12:39:22 +0200 |
---|---|---|
committer | Georgy Yakovlev <gyakovlev@gentoo.org> | 2021-07-17 13:04:44 -0700 |
commit | d091935d85df82d49cf2473e21881b7a2e628deb (patch) | |
tree | a991394857bce70d2305f04ac90609606904a5fb /net-im | |
parent | package.mask: mask several perl-core/* for removal (diff) | |
download | gentoo-d091935d85df82d49cf2473e21881b7a2e628deb.tar.gz gentoo-d091935d85df82d49cf2473e21881b7a2e628deb.tar.bz2 gentoo-d091935d85df82d49cf2473e21881b7a2e628deb.zip |
net-im/telegram-desktop: Drop jemalloc patch
Upstream clarified; The glibc allocator causes telegram to use excessive
amounts of memory, and never free it. That's a bug.
See-also: https://github.com/telegramdesktop/tdesktop/issues/16084
See-also: https://github.com/desktop-app/cmake_helpers/pull/91#issuecomment-881788003
Closes: https://github.com/gentoo/gentoo/pull/21688
Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'net-im')
-rw-r--r-- | net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch | 100 | ||||
-rw-r--r-- | net-im/telegram-desktop/telegram-desktop-2.8.10.ebuild | 10 |
2 files changed, 3 insertions, 107 deletions
diff --git a/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch b/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch deleted file mode 100644 index dff2455d4e3d..000000000000 --- a/net-im/telegram-desktop/files/tdesktop-2.8.9-disable-jemalloc-separately.patch +++ /dev/null @@ -1,100 +0,0 @@ -Allow controlling the use of jemalloc - -Jemalloc is often controlled through USE=jemalloc in Gentoo. Removing or -replacing it is trivial, and I'm not aware of any particular advantages that -come with using this allocator, especially for an IM client. Benchmarks -regarding this allocator provide a huge variety of results depending on the -workload and system, so it's hard to establish when this allocator provides any -tangible advantage. - -Considering things like Hardened Gentoo, the user might prefer to use a more -exploit-resistant allocator, like GrapheneOS/hardened_malloc, and I've heard -Musl is hardening their allocator as well. - -I trust the user can better judge if they need this in their particular setup. - -If a telegram dev is reading this, feel free to drop me a message (metadata.xml -contains the maintainer's address), if you believe it should be forced due to -usability concerns, or if you can provide me with some context I might be -missing. Jemalloc is currently enabled by default. - ---- tdesktop-2.8.9-full.orig/Telegram/SourceFiles/platform/linux/specific_linux.cpp -+++ tdesktop-2.8.9-full/Telegram/SourceFiles/platform/linux/specific_linux.cpp -@@ -48,7 +48,10 @@ - #include <gio/gio.h> - #include <glibmm.h> - #include <giomm.h> -+ -+#ifndef DESKTOP_APP_DISABLE_JEMALLOC - #include <jemalloc/jemalloc.h> -+#endif // !DESKTOP_APP_DISABLE_JEMALLOC - - #include <sys/stat.h> - #include <sys/types.h> -@@ -727,8 +730,10 @@ - namespace Platform { - - void start() { -+#ifndef DESKTOP_APP_DISABLE_JEMALLOC - auto backgroundThread = true; - mallctl("background_thread", nullptr, nullptr, &backgroundThread, sizeof(bool)); -+#endif // !DESKTOP_APP_DISABLE_JEMALLOC - - LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName())); - ---- tdesktop-2.8.9-full.orig/cmake/external/CMakeLists.txt -+++ tdesktop-2.8.9-full/cmake/external/CMakeLists.txt -@@ -37,7 +37,7 @@ - add_checked_subdirectory(hunspell) - endif() - add_checked_subdirectory(iconv) --if (LINUX) -+if (LINUX AND NOT DESKTOP_APP_DISABLE_JEMALLOC) - add_checked_subdirectory(jemalloc) - endif() - add_checked_subdirectory(jpeg) ---- tdesktop-2.8.9-full.orig/cmake/options.cmake -+++ tdesktop-2.8.9-full/cmake/options.cmake -@@ -56,6 +56,13 @@ - ) - endif() - -+if (DESKTOP_APP_DISABLE_JEMALLOC) -+ target_compile_definitions(common_options -+ INTERFACE -+ DESKTOP_APP_DISABLE_JEMALLOC -+ ) -+endif() -+ - if (DESKTOP_APP_USE_PACKAGED) - target_compile_definitions(common_options - INTERFACE ---- tdesktop-2.8.9-full.orig/cmake/options_linux.cmake -+++ tdesktop-2.8.9-full/cmake/options_linux.cmake -@@ -58,10 +58,12 @@ - endif() - endif() - --target_link_libraries(common_options --INTERFACE -- desktop-app::external_jemalloc --) -+if (NOT DESKTOP_APP_DISABLE_JEMALLOC) -+ target_link_libraries(common_options -+ INTERFACE -+ desktop-app::external_jemalloc -+ ) -+endif() - - if (DESKTOP_APP_USE_PACKAGED) - find_library(ATOMIC_LIBRARY atomic) ---- tdesktop-2.8.9-full.orig/cmake/variables.cmake -+++ tdesktop-2.8.9-full/cmake/variables.cmake -@@ -38,6 +38,7 @@ - option(DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF) - option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." ${osx_special_target}) - option(DESKTOP_APP_DISABLE_WEBKIT "Disable WebkitGTK library (Linux only)." OFF) -+option(DESKTOP_APP_DISABLE_JEMALLOC "Disable use of the jemalloc allocator (Linux only)." OFF) - option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target}) - option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate}) - option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled Hunspell only. (For debugging purposes)" OFF) diff --git a/net-im/telegram-desktop/telegram-desktop-2.8.10.ebuild b/net-im/telegram-desktop/telegram-desktop-2.8.10.ebuild index 69bfb7c3a172..e738b91f41dd 100644 --- a/net-im/telegram-desktop/telegram-desktop-2.8.10.ebuild +++ b/net-im/telegram-desktop/telegram-desktop-2.8.10.ebuild @@ -16,7 +16,7 @@ SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${ LICENSE="BSD GPL-3-with-openssl-exception LGPL-2+" SLOT="0" KEYWORDS="~amd64 ~ppc64" -IUSE="+dbus enchant +gtk +hunspell +jemalloc +spell wayland webkit +X" +IUSE="+dbus enchant +gtk +hunspell +spell wayland webkit +X" REQUIRED_USE=" spell? ( ^^ ( enchant hunspell ) @@ -29,6 +29,7 @@ RDEPEND=" !net-im/telegram-desktop-bin app-arch/lz4:= dev-cpp/glibmm:2 + dev-libs/jemalloc:= dev-libs/xxhash >=dev-qt/qtcore-5.15:5 >=dev-qt/qtgui-5.15:5[dbus?,jpeg,png,wayland?,X(-)?] @@ -53,7 +54,6 @@ RDEPEND=" enchant? ( app-text/enchant:= ) gtk? ( x11-libs/gtk+:3[X?,wayland?] ) hunspell? ( >=app-text/hunspell-1.7:= ) - jemalloc? ( dev-libs/jemalloc:= ) wayland? ( kde-frameworks/kwayland:= ) webkit? ( net-libs/webkit-gtk:= ) X? ( x11-libs/libxcb:= ) @@ -74,9 +74,6 @@ PATCHES=( # https://github.com/desktop-app/cmake_helpers/pull/91 # https://github.com/desktop-app/lib_webview/pull/2 "${FILESDIR}/tdesktop-2.8.9-disable-webkit-separately.patch" - # Not going to attempt upstreaming this after the reaction to - # "disable-webkit-separately" - "${FILESDIR}/tdesktop-2.8.9-disable-jemalloc-separately.patch" # Not a proper fix, not upstreamed "${FILESDIR}/tdesktop-2.8.9-webview-fix-glib.patch" ) @@ -110,7 +107,6 @@ src_configure() { -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=$(usex dbus OFF ON) -DDESKTOP_APP_DISABLE_GTK_INTEGRATION=$(usex gtk OFF ON) -DDESKTOP_APP_DISABLE_WEBKIT=$(usex webkit OFF ON) - -DDESKTOP_APP_DISABLE_JEMALLOC=$(usex jemalloc OFF ON) -DDESKTOP_APP_DISABLE_SPELLCHECK=$(usex spell OFF ON) # enables hunspell (recommended) -DDESKTOP_APP_USE_ENCHANT=$(usex enchant ON OFF) # enables enchant and disables hunspell ) @@ -143,5 +139,5 @@ src_configure() { pkg_postinst() { xdg_pkg_postinst - use gtk || elog "enable 'gtk' useflag if you have image copy-paste problems" + use gtk || elog "enable the 'gtk' useflag if you have image copy-paste problems" } |