Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 881697 - net-im/telegram-desktop: verify dev-libs/libdispatch dependency?
Summary: net-im/telegram-desktop: verify dev-libs/libdispatch dependency?
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Low enhancement (vote)
Assignee: Esteve Varela Colominas
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-17 21:00 UTC by Rafael Umbelino
Modified: 2023-09-05 08:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Umbelino 2022-11-17 21:00:39 UTC
I removed Clang/LLVM entirely from a Gentoo system (masked the packages and set the USE flags to remove their support) and realized I can't update Telegram after that.

Telegram-desktop requires libdispatch, which has no configurable USE flags, to be built.
Libdispatch requires clang to be built.
Therefore I can't build Telegram-desktop without Clang.

This would be an understandable situation if not for the fact that libdispatch is a runtime dependency for Telegram-desktop. It's my understanding (as far as I could search) that runtime dependencies aren't packed into the binary package.

I installed telegram-desktop-bin, started it and ran cat /proc/*/maps |grep -i libdispatch and there's no libdispatch library loaded, so that furthers my idea that the binary package either does not come with libdispatch or it's not in use someway.

As comparison, running equery f --tree firefox-bin |grep -i lib lists several library files that come with it. Doing the same with telegram-desktop-bin doesn't show anything.

Can we have a way to separate telegram-desktop from the need of libdispatch, or separate libdispatch from clang?

I'm not a programmer so I can't provide further assessment, I'm just not sure where else to ask this.

Reproducible: Always

Steps to Reproduce:
1. set USE="-clang -llvm"
2. mask clang and llvm for good measure
3. try to install telegram-desktop
Actual Results:  
Can't build telegram because it can't build libdispatch:
(dependency required by "dev-libs/libdispatch-5.7.1::gentoo" [ebuild])
(dependency required by "libdispatch" [argument])

Expected Results:  
Build telegram-desktop without needing clang
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-17 21:08:25 UTC
No, libdispatch is split out from Apple's stuff and it uses Blocks.

Simply having a system without Clang and LLVM and wanting to achieve that isn't really a bug in itself if there's no evidence for believing it's possible.

Your question is actually "does telegram-desktop really need libdispatch?", I think, and I'll let the telegram maintainer answer that.

But it could easily be that libdispatch is statically linked or something.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-17 21:11:24 UTC
See https://github.com/telegramdesktop/tdesktop/issues/17437 & https://github.com/telegramdesktop/tdesktop/commit/d89597bf64859eaf1bdad57a86c40b810a4923c1.

It looks like it _might_ be possible to disable it with a hack but then your Telegram becomes slower.
Comment 3 Esteve Varela Colominas 2022-11-18 06:17:22 UTC
Telegram-desktop is possible to build without clang. As you say, libdispatch is a runtime dependency, and only needs llvm/clang to build. It sounds like you're using a combination of --deep and --with-bdeps=y, causing portage to try to satisfy the entire dependency tree including build dependencies (a sane choice). Not having clang/llvm installed while --with-bdeps=y is enabled (default) means your system has broken deoendencies. You cannot do what you want unless you disable that or put the compiler in package.provided, but I'm not going to recommend either due to the significant consequences of both of these approaches. It might be possible to make a binpkg repo with *just* libdispatch and enable --usepkg to satisfy this, but it's finnicky.

telegram-desktop-bin uses a static version of many libraries. libdispatch is one of them, so of course you won't see it in the resulting binary.

Even if it's possible to build the upstream code without libdispatch, I'm not sure I'm comfortable supporting this in gentoo. The flag looks to be quite hidden, untested, and smells like something that'd quickly go wrong, but I'll look at it some time.
Comment 4 Rafael Umbelino 2022-11-25 15:20:29 UTC
Thank you all for your in depth responses!

Like I said in my report, I'm not a programmer so I couldn't understand how hard/unfeasible it is/was to build Telegram without libdispatch (and therefore without clang).

I'm using telegram-desktop-bin for the moment and am trying to avoid Clang/LLVM in other places as well (slow notebook).

Would it be good to somehow add the clang USE flag to Telegram to make it obvious it's a necessity of Telegram to have Clang to build libdispatch and use it?

As mentioned by Esteve I was (and have always) indeed using --deep when updating system.

emerge -avuDN world
Comment 5 Esteve Varela Colominas 2022-11-25 16:32:33 UTC
> Would it be good to somehow add the clang USE flag to Telegram to make it obvious it's a necessity of Telegram to have Clang to build libdispatch and use it?

No, because clang isn't necessary during telegram's build process, and portage will happily build it without first installing clang if it finds it doesn't need it (e.g. when libdispatch is already installed and "emerge telegram-desktop" is ran without --deep, or with --with-bdeps=n, or with binpkgs, you get the idea).

I'll evaluate the suitability of making a use flag for libdispatch, like the one we have for jemalloc.