Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failed when using docker #26982

Closed
c0re100 opened this issue Oct 29, 2023 · 15 comments
Closed

build failed when using docker #26982

c0re100 opened this issue Oct 29, 2023 · 15 comments

Comments

@c0re100
Copy link
Contributor

c0re100 commented Oct 29, 2023

Steps to reproduce

  1. Follow docker instructions

Expected behaviour

It should build without issue.

Actual behaviour

After docker run --rm -it........
I got error result

[22/1521] Generating D-Bus C code for XdpInhibit (Telegram)
FAILED: Telegram/gen/dbus/Telegram_XdpInhibit_dbus.timestamp Telegram/gen/dbus/Telegram_XdpInhibit_dbus.c Telegram/gen/dbus/Telegram_XdpInhibit_dbus.h /usr/src/tdesktop/out/Telegram/gen/dbus/Telegram_XdpInhibit_dbus.timestamp /usr/src/tdesktop/out/Telegram/gen/dbus/Telegram_XdpInhibit_dbus.c /usr/src/tdesktop/out/Telegram/gen/dbus/Telegram_XdpInhibit_dbus.h 
cd /usr/src/tdesktop/out/Telegram && /usr/local/bin/gdbus-codegen --interface-prefix org.freedesktop.portal. --generate-c-code /usr/src/tdesktop/out/Telegram/gen/dbus/Telegram_XdpInhibit_dbus --c-namespace XdpInhibit --c-generate-object-manager /usr/src/tdesktop/Telegram/SourceFiles/platform/linux/org.freedesktop.portal.Inhibit.xml && echo 1> /usr/src/tdesktop/out/Telegram/gen/dbus/Telegram_XdpInhibit_dbus.timestamp
Traceback (most recent call last):
  File "/usr/local/bin/gdbus-codegen", line 53, in <module>
    from codegen import codegen_main
ImportError: cannot import name 'codegen_main' from 'codegen' (unknown location)

Operating system

Arch Linux

Version of Telegram Desktop

4.11

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

@c0re100 c0re100 added the bug label Oct 29, 2023
@c0re100 c0re100 changed the title build failed on docker build failed when using docker Oct 29, 2023
@ilya-fedin
Copy link
Contributor

ilya-fedin commented Oct 29, 2023

Looks like codegen installation is broken in glib, /usr/local/share/glib-2.0/codegen is almost empty. Looking at glib's commit history, https://gitlab.gnome.org/GNOME/glib/-/commit/4ce58df8540f25f823418a1d45ddb07ada52ec22 is probably at fault. Either someone should report this to them or we have to wait until they notice on their own and fix that...

@ilya-fedin
Copy link
Contributor

@Aokromes closing this is a bad idea as people are likely to arrive here as the Docker images resulting from the Dockerfile are broken currently.

@Aokromes Aokromes reopened this Oct 29, 2023
@rafitamolin
Copy link

Looks like codegen installation is broken in glib, /usr/local/share/glib-2.0/codegen is almost empty. Looking at glib's commit history, https://gitlab.gnome.org/GNOME/glib/-/commit/4ce58df8540f25f823418a1d45ddb07ada52ec22 is probably at fault. Either someone should report this to them or we have to wait until they notice on their own and fix that...

reported here: https://gitlab.gnome.org/GNOME/glib/-/issues/3161

@EugenySychev
Copy link

Is there any workaround for build it?

@x09
Copy link

x09 commented Nov 1, 2023

I need solution too.

@EugenySychev
Copy link

I need solution too.
You can try to add cp -f /usr/share/glib-2.0/codegen/* /usr/local/share/glib-2.0/codegen/ into the build.sh before running build steps.

@x09
Copy link

x09 commented Nov 1, 2023

I need solution too.
You can try to add cp -f /usr/share/glib-2.0/codegen/* /usr/local/share/glib-2.0/codegen/ into the build.sh before running build steps.

tdesktop $ find -name build.sh
./Telegram/ThirdParty/QR/typescript-javascript/build.sh
./Telegram/build/build.sh
./Telegram/build/docker/centos_env/build.sh
./Telegram/build/docker/build.sh

could you specify?

@EugenySychev
Copy link

could you specify?
Telegram/build/docker/centos_env/build.sh
который при билде докера дергается.

@x09
Copy link

x09 commented Nov 1, 2023

could you specify?
Telegram/build/docker/centos_env/build.sh
который при билде докера дергается.

cat ./Telegram/build/docker/centos_env/build.sh

#!/bin/bash
set -e

cd Telegram
./configure.sh "$@"

if [ -n "$DEBUG" ]; then
	cmake --build ../out --config Debug --parallel
else
	cmake --build ../out --config Release --parallel
fi

Я не понимаю откуда и куда, а главное зачем что-то копировать.
cp -f /usr/share/glib-2.0/codegen/* /usr/local/share/glib-2.0/codegen/ - смысл этого?

@EugenySychev
Copy link

could you specify?
Telegram/build/docker/centos_env/build.sh
который при билде докера дергается.

cat ./Telegram/build/docker/centos_env/build.sh

#!/bin/bash
set -e

cd Telegram
./configure.sh "$@"

if [ -n "$DEBUG" ]; then
	cmake --build ../out --config Debug --parallel
else
	cmake --build ../out --config Release --parallel
fi

Я не понимаю откуда и куда, а главное зачем что-то копировать. cp -f /usr/share/glib-2.0/codegen/* /usr/local/share/glib-2.0/codegen/ - смысл этого?

Ну как "зачем" - сейчас при вызове codegen не может найти эти модули, потому как их установку убили в глибе, а вот эта команда она их копирует (по сути устанавливает). Я ставил перед cd Telegram. Собралось после этого.

@c0re100
Copy link
Contributor Author

c0re100 commented Nov 1, 2023

Basically, It works.
But in my first try, it was failed because std::string has no member 'value_or'.
That's weird lol
So I've removed cp in second time, and everything fines.

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Nov 1, 2023

The codegen of the older glib generates a different code so the resulting API is different.

@ilya-fedin
Copy link
Contributor

ilya-fedin commented Nov 1, 2023

If copying works, -DDESKTOP_APP_GDBUSCODEGEN=/usr/bin/gdbus-codegen should work just as well

@xxxdens
Copy link

xxxdens commented Nov 3, 2023

If copying works, -DDESKTOP_APP_GDBUSCODEGEN=/usr/bin/gdbus-codegen should work just as well

where should this line be used? Thanks!

@EugenySychev
Copy link

If copying works, -DDESKTOP_APP_GDBUSCODEGEN=/usr/bin/gdbus-codegen should work just as well

where should this line be used? Thanks!

When you run the build by 'docker run blablabla' you should add this at the end.

@Aokromes Aokromes closed this as completed Nov 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants