Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 751481 - net-im/telegram-desktop-2.4.4 with LibreSSL - error: ‘SSL_SESSION’ does not name a type; did you mean ‘SSL2_VERSION’
Summary: net-im/telegram-desktop-2.4.4 with LibreSSL - error: ‘SSL_SESSION’ does not n...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: libressl-support
  Show dependency tree
 
Reported: 2020-10-27 17:05 UTC by Pavel Volkov
Modified: 2020-11-01 22:28 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,540.89 KB, text/plain)
2020-10-27 17:05 UTC, Pavel Volkov
Details
telegram-desktop-2.4.5 ebuild, but with webrtc USE flag added back (telegram-desktop-2.4.5.ebuild,5.40 KB, text/plain)
2020-10-31 20:12 UTC, Joe Kappus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Volkov 2020-10-27 17:05:08 UTC
This is the error during recent telegram-desktop's emerge.
I use libressl 3.2.1.

In file included from /var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc:20:
/usr/include/openssl/dtls1.h:110:2: error: ‘SSL_SESSION’ does not name a type; did you mean ‘SSL2_VERSION’?
  110 |  SSL_SESSION *session;
      |  ^~~~~~~~~~~
      |  SSL2_VERSION
/usr/include/openssl/dtls1.h:173:2: error: ‘SSL3_BUFFER’ does not name a type
  173 |  SSL3_BUFFER    rbuf;
      |  ^~~~~~~~~~~
/usr/include/openssl/dtls1.h:174:2: error: ‘SSL3_RECORD’ does not name a type
  174 |  SSL3_RECORD    rrec;
      |  ^~~~~~~~~~~
/var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc: In member function ‘virtual rtc::SSLProtocolVersion rtc::OpenSSLStreamAdapter::GetSslVersion() const’:
/var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc:395:31: error: ‘DTLS1_2_VERSION’ was not declared in this scope; did you mean ‘TLS1_2_VERSION’?
  395 |     } else if (ssl_version == DTLS1_2_VERSION) {
      |                               ^~~~~~~~~~~~~~~
      |                               TLS1_2_VERSION
/var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc: In member function ‘SSL_CTX* rtc::OpenSSLStreamAdapter::SetupSSLContext()’:
/var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc:988:47: error: ‘DTLS1_2_VERSION’ was not declared in this scope; did you mean ‘TLS1_2_VERSION’?
  988 |             ctx, ssl_mode_ == SSL_MODE_DTLS ? DTLS1_2_VERSION : TLS1_2_VERSION);
      |                                               ^~~~~~~~~~~~~~~
      |                                               TLS1_2_VERSION
/var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc:994:43: error: ‘DTLS1_2_VERSION’ was not declared in this scope; did you mean ‘TLS1_2_VERSION’?
  994 |         ctx, ssl_mode_ == SSL_MODE_DTLS ? DTLS1_2_VERSION : TLS1_2_VERSION);
      |                                           ^~~~~~~~~~~~~~~
      |                                           TLS1_2_VERSION


Reproducible: Always
Comment 1 Pavel Volkov 2020-10-27 17:05:50 UTC
Created attachment 668831 [details]
build.log
Comment 2 Joe Kappus 2020-10-31 20:12:54 UTC
Created attachment 669494 [details]
telegram-desktop-2.4.5 ebuild, but with webrtc USE flag added back

Did the impossible (according to maintainer). Added back the useflag for WebRTC, as it's not compatible with libressl and way easier to remove than patching the crap out of webRTC. With it disabled you lose voice/video support, but all regular IM functionality is retained. 

You will need this ebuild and this patch from VoidLinux. It's compatible with 2.4.3 through 2.4.5 in the least: https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/telegram-desktop/patches/no-webrtc-build.patch

Obviously make sure you don't have WebRTC useflag set for telegram-desktop. To the maintainer: If you merge this please look at my dependencies, I would make libressl useflag block the webrtc useflag.
Comment 3 Georgy Yakovlev archtester gentoo-dev 2020-10-31 20:53:52 UTC
well, it's not impossible, but not very maintainable in the long run I think, that's what I meant.

telegram upstream sometimes changes a LOT between releases, it would be hard to keep up.

also they basically said they would not support webrtc-less build.
https://github.com/telegramdesktop/tdesktop/issues/8483#issuecomment-702803741

and it's frustrating for user to deal with ever changing useflags. I can add this patch and add webrtc useflag back, but there's no guarantee it will be available on next version bump.

if someone manages to merge webrtc ifdef patch upstream - that will be more sustainable.
Comment 4 Larry the Git Cow gentoo-dev 2020-10-31 21:17:14 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=052e291b89bd1ccba37c8ba8cca4c4df8e5266c5

commit 052e291b89bd1ccba37c8ba8cca4c4df8e5266c5
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2020-10-31 21:06:29 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2020-10-31 21:14:36 +0000

    net-im/telegram-desktop: add webrtc flag back to 2.4.5
    
    Closes: https://bugs.gentoo.org/751481
    Thanks-to: Joe Kappus
    Package-Manager: Portage-3.0.8, Repoman-3.0.2
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 .../telegram-desktop/files/no-webrtc-build.patch   | 96 ++++++++++++++++++++++
 net-im/telegram-desktop/metadata.xml               |  1 +
 .../telegram-desktop/telegram-desktop-2.4.5.ebuild | 16 +++-
 3 files changed, 110 insertions(+), 3 deletions(-)
Comment 5 Georgy Yakovlev archtester gentoo-dev 2020-10-31 21:19:01 UTC
since tg_owt is separate package now, I did it a bit differently, but still used void patch, thanks for pointers.

2.4.5  should be usable with libressl now if USE=-webrtc
tg_owt requires openssl unconditionally.
Comment 6 Joe Kappus 2020-10-31 22:47:04 UTC
Thanks, I can poke telegram's upstream about including this patch, I just know they have been hostile toward libressl support in the past (and things like basic accessibility). 

Unlike Gentoo, Voidlinux is in the position where they build everything off libressl so I would expect them to keep the patch up to date if things change.
Comment 7 Georgy Yakovlev archtester gentoo-dev 2020-10-31 23:05:52 UTC
good point about void. if the patch continues to be available and bumped within at most a week after release I see no problem depending on it. but not longer than a week.

well at least making webrtc cmake switch to actually work is a good starting point. I no longer attempt to submit patches upstream as the focus seems to be "bundle all the things so it works on ubuntu 16 or in snap", not "package it properly".

try referencing issue I linked, maybe they'll merge it.

telegram used to just work with libressl since I started maintaining it, so I have no opinion there. but webrtc is just a disaster dependency and adding libressl support there may quite hard.
Comment 8 Georgy Yakovlev archtester gentoo-dev 2020-11-01 22:28:55 UTC
https://github.com/void-linux/void-packages/issues/20935

looks like VOID will be moving from libressl. Anyway, 2.4.5 is patched and will stay for some time in the tree.