telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.23k stars 5.21k forks source link

Unable to compile from sources - Gentoo #27695

Closed Cerberios closed 7 months ago

Cerberios commented 7 months ago

Steps to reproduce

Unable to compile gcc version 13.2.1 20240330 (Gentoo Hardened 13.2.1_p20240330 p14) sys-libs/glibc 2.38-r11

Expected behaviour

Unable to compile

Actual behaviour

Unable to compile

Operating system

Gentoo

Version of Telegram Desktop

4.16.1

Installation source

Other (unofficial) source

Crash ID

No response

Logs

/var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp: In member function ‘void Platform::Notifications::{anonymous}::NotificationData::setImage(QImage)’:
/var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:504:46: error: ‘new_with_free_func’ is not a member of ‘gi::repository::GLib::Bytes’
  504 |                                 GLib::Bytes::new_with_free_func(
      |                                              ^~~~~~~~~~~~~~~~~~
/var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:529:32: error: ‘new_from_data’ is not a member of ‘gi::repository::GLib::Variant’
  529 |                 GLib::Variant::new_from_data(
      |                                ^~~~~~~~~~~~~
/var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:522:64: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘gi::CollectionParameter<gi::detail::Span<-1>, _GVariant*, gi::transfer_none_t>’ {aka ‘gi::detail::CollectionHolder<gi::detail::Span<-1>, _GVariant*, gi::transfer_none_t>’}
  522 |         _hints.insert_value(_imageKey, GLib::Variant::new_tuple({
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~^~
  523 |                 GLib::Variant::new_int32(image.width()),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  524 |                 GLib::Variant::new_int32(image.height()),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  525 |                 GLib::Variant::new_int32(image.bytesPerLine()),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  526 |                 GLib::Variant::new_boolean(image.hasAlphaChannel()),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  527 |                 GLib::Variant::new_int32(8),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  528 |                 GLib::Variant::new_int32(image.hasAlphaChannel() ? 4 : 3),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  529 |                 GLib::Variant::new_from_data(
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  530 |                         GLib::VariantType::new_("ay"),
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  531 |                         reinterpret_cast<const uchar*>(image.constBits()),
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  532 |                         image.sizeInBytes(),
      |                         ~~~~~~~~~~~~~~~~~~~~
  533 |                         true,
      |                         ~~~~~
  534 |                         [image] {}),
      |                         ~~~~~~~~~~~~
  535 |         }));
      |         ~~
In file included from /var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full_build/gen/glib/glib_impl.hpp:59,
                 from /var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full_build/gen/glib/glib.hpp:122,
                 from /var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full_build/gen/gobject/gobject.hpp:11,
                 from /var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full_build/gen/gio/gio.hpp:11,
                 from /var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full_build/gen/xdgnotifications/xdgnotifications.hpp:11,
                 from /var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:31:
/var/tmp/portage/net-im/telegram-desktop-4.16.1/work/tdesktop-4.16.1-full_build/gen/glib/variant_impl.hpp:288:114: note:   initializing argument 1 of ‘static gi::repository::GLib::Variant gi::repository::GLib::base::VariantBase::new_tuple(gi::CollectionParameter<gi::detail::Span<-1>, _GVariant*, gi::transfer_none_t>)’
  288 | GLib::Variant base::VariantBase::new_tuple (gi::CollectionParameter<gi::DSpan, ::GVariant*, gi::transfer_none_t> children) noexcept
      |                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
ninja: build stopped: subcommand failed.
 * ERROR: net-im/telegram-desktop-4.16.1::leorepo failed (compile phase):
ilya-fedin commented 7 months ago

Perhaps your unofficial source does some patching that breaks the build? Build with official method and I'm sure it will build just find.

Cerberios commented 7 months ago

Ilya, I am getting sources here: https://github.com/telegramdesktop/tdesktop/releases/tag/v4.16.1 But use Gentoo portage as base OS without Docker - because I do not need it Please, inform me what additional information needed? Thanks!

ilya-fedin commented 7 months ago

@Cerberios as far as I know the sources from distros are usually not the same as projects provide, they patch it. Thus, I can't really help you if you won't try the official build way.

Cerberios commented 7 months ago

Open your eyes and look into code please! there error and your must fix it asap!

ilya-fedin commented 7 months ago

@Cerberios i don't see any error in the code, maybe you can be more concrete if you know what the issue is? If you don't know, what makes you think the error is not a result of a distro's patch?

Jamim commented 6 months ago

Hello @Cerberios,

Open your eyes and look into code please! there error and your must fix it asap!

Don't be so sure.

Hello @ilya-fedin,

@Cerberios as far as I know the sources from distros are usually not the same as projects provide, they patch it.

You are right. This particular issue is caused by cppgir version mismatch.

I've addressed it in this PR:

@Cerberios, you can install Telegram Desktop 4.16.4 from my overlay, if you want to.

eselect repository add mim git https://github.com/Jamim/gentoo-overlay.git
emaint sync -r mim

See also:

Best regards!

ilya-fedin commented 6 months ago
* [Look for system-wide cppgir before fallback to the bundled copy desktop-app/cmake_helpers#305](https://github.com/desktop-app/cmake_helpers/pull/305)

Note: this PR has things that have to be changed (it breaks the usage of bundled cppgir, for instance) but the person has blocked the possibility to review:

If you see a PR from this person and want it to be merged, the best course of action is to take it over by creating own PR as PRs from that person couldn't be merged due to review impossibility.