Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 787968 - net-im/telegram-desktop-2.7.4 fails to compile with gcc-11
Summary: net-im/telegram-desktop-2.7.4 fails to compile with gcc-11
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Esteve Varela Colominas
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: gcc-11
  Show dependency tree
 
Reported: 2021-05-03 18:56 UTC by Agostino Sarubbo
Modified: 2021-05-09 09:54 UTC (History)
14 users (show)

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


Attachments
build.log.xz (build.log.xz,30.11 KB, application/x-xz)
2021-05-03 18:56 UTC, Agostino Sarubbo
Details
emerge --build (emerge --build,741.96 KB, text/plain)
2021-05-03 19:39 UTC, Marco Scardovi (scardracs)
Details
telegram log (telegram-log.txt,717.64 KB, text/plain)
2021-05-09 09:32 UTC, Marco Scardovi (scardracs)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2021-05-03 18:56:27 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-im/telegram-desktop-2.7.4 fails to compile with gcc-11.
Discovered on: amd64 (internal ref: ci)

NOTE:
This machine uses GCC-11: https://gcc.gnu.org/gcc-11/porting_to.html
Comment 1 Agostino Sarubbo gentoo-dev 2021-05-03 18:56:29 UTC
Created attachment 705807 [details]
build.log.xz

build log and emerge --info (compressed because it exceeds attachment limit, use 'xzless' to read it)
Comment 2 Agostino Sarubbo gentoo-dev 2021-05-03 18:56:31 UTC
Possible context of error(s):

/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/type_traits:2954:7: error: static assertion failed: each argument type must be a complete class or an unbounded array
Comment 3 Marco Scardovi (scardracs) 2021-05-03 19:39:08 UTC
Same problem but different error

FAILED: Telegram/CMakeFiles/td_ui.dir/SourceFiles/payments/ui/payments_panel.cpp.o
Comment 4 Marco Scardovi (scardracs) 2021-05-03 19:39:38 UTC
Created attachment 705843 [details]
emerge --build
Comment 5 Petr Šabata 2021-05-04 12:53:12 UTC
Note this isn't a regression; 2.7.1 had the same problem.
Comment 6 Perfect Gentleman 2021-05-04 12:54:31 UTC
yep, it's GCC-11.1
Comment 7 Stephan Hartmann gentoo-dev 2021-05-07 16:29:29 UTC
This happens because gcc-11 defaults to C++17. Appending -std=c++14 (or -std=gnu++14) to CXXFLAGS should solve this one.
Comment 8 Perfect Gentleman 2021-05-07 16:35:58 UTC
(In reply to Stephan Hartmann from comment #7)
> This happens because gcc-11 defaults to C++17. Appending -std=c++14 (or
> -std=gnu++14) to CXXFLAGS should solve this one.

But it's not.
Comment 9 Georgy Yakovlev gentoo-dev 2021-05-07 16:55:19 UTC
It would not be able to link with tg_owt/abseil if messing up with standard.
Everything in this stack already requires cxx17 afaik, but I don’t have time to dig it.
At least in latest abseil I’ve even removed building with older std.
And building tg with cxx17 does not solve it unfortunately, that’s the first thing I’ve tested.
Comment 10 Marco Scardovi (scardracs) 2021-05-07 17:01:03 UTC
(In reply to Georgy Yakovlev from comment #9)
> It would not be able to link with tg_owt/abseil if messing up with standard.
> Everything in this stack already requires cxx17 afaik, but I don’t have time
> to dig it.
> At least in latest abseil I’ve even removed building with older std.
> And building tg with cxx17 does not solve it unfortunately, that’s the first
> thing I’ve tested.

On top of that, older telegram doesn't work with newest tg_owt version, in fact, by default, it complains about missing of older version
Comment 11 Esteve Varela Colominas 2021-05-08 14:32:32 UTC
Sorry for taking so long. I don't plan on switching to GCC 11 on my main machine for a while yet so I put it off (also hoping someone else might come up with a solution, these things are a pain to debug). Today I've fixed it, submitted it upstream and updated the ebuild. Please give proxy-maint some time to review and merge it. In the mean time, you can grab the fixed ebuild from the linked pull request and test it for yourself.
As always, thanks for reporting the bug!
Comment 12 Esteve Varela Colominas 2021-05-08 15:13:27 UTC
(In reply to Petr Šabata from comment #5)
> Note this isn't a regression; 2.7.1 had the same problem.

I can't reproduce this. Since the fix I created applies to code that was only introduced since 2.7.2, if 2.7.1 has any issues building with GCC 11, it's for a different reason. Can you reprocude it, and create a new issue with a build.log, emerge --info and all that good stuff?
Comment 13 Perfect Gentleman 2021-05-09 02:55:15 UTC
Confirm that patch works good.
Comment 14 Larry the Git Cow gentoo-dev 2021-05-09 08:05:06 UTC
The bug has been closed via the following commit(s):

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

commit bf6fe4f653ded715ab500b5911d394547be42fb3
Author:     Esteve Varela Colominas <esteve.varela@gmail.com>
AuthorDate: 2021-05-08 14:17:28 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-05-09 08:04:43 +0000

    net-im/telegram-desktop: Fix build with GCC 11
    
    Closes: https://bugs.gentoo.org/787968
    Thanks-to: Agostino Sarubbo <ago@gentoo.org>
    Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/20729
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 .../files/tdesktop-2.7.4-webview-fix-gcc11.patch   | 25 ++++++++++++++++++++++
 .../telegram-desktop/telegram-desktop-2.7.4.ebuild |  2 ++
 2 files changed, 27 insertions(+)
Comment 15 Marco Scardovi (scardracs) 2021-05-09 09:32:56 UTC
Created attachment 706689 [details]
telegram log
Comment 16 Marco Scardovi (scardracs) 2021-05-09 09:33:12 UTC
It's not fixed here ^
Comment 17 Agostino Sarubbo gentoo-dev 2021-05-09 09:39:37 UTC
(In reply to Marco Scardovi from comment #16)
> It's not fixed here ^

It is fixed for the CI.

I don't see this line in your log:

 * Applying tdesktop-2.7.4-webview-fix-gcc11.patch ...


So I suppose that your tree has not been synced.
Comment 18 Marco Scardovi (scardracs) 2021-05-09 09:44:51 UTC
(In reply to Agostino Sarubbo from comment #17)
> (In reply to Marco Scardovi from comment #16)
> > It's not fixed here ^
> 
> It is fixed for the CI.
> 
> I don't see this line in your log:
> 
>  * Applying tdesktop-2.7.4-webview-fix-gcc11.patch ...
> 
> 
> So I suppose that your tree has not been synced.

My bad, I don't know what's happened but at 2nd attemp the patch has been applied
Comment 19 Marco Scardovi (scardracs) 2021-05-09 09:54:28 UTC
Ok, find it. On both times I have tried to install it I have launched emerge --sync too. At first attempt the patch was not present while at second it was (I use gentoo-mirror as repo for emerge)