telegramdesktop / tdesktop

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

./tdesktop/Telegram/build/prepare/linux.sh fails at linking libproxy #27208

Closed enedil closed 10 months ago

enedil commented 10 months ago

Steps to reproduce

I try to build Telegram Desktop on Linux. In order to do so, I try to run ./tdesktop/Telegram/build/prepare/linux.sh as in the instructions. However, building libproxy fails:

[59/59] Linking CXX executable utils/proxy
FAILED: utils/proxy 
: && /usr/bin/c++ -g -O3 -flto=auto -ffat-lto-objects -pipe -fPIC -fno-omit-frame-pointer -fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -rdynamic utils/CMakeFiles/proxy.dir/proxy.c.o -o utils/proxy  libproxy/libproxy.a  -lm  -lpthread  -ldl && :
/tmp/ccxhgzCH.ltrans0.ltrans.o: In function `gnome_config_extension::gnome_config_extension()':
/usr/include/c++/8/bits/fs_path.h:185: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/tmp/ccxhgzCH.ltrans0.ltrans.o: In function `gnome_config_extension::gnome_config_extension()':
/usr/include/c++/8/bits/fs_dir.h:441: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::recursive_directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)'
/usr/include/c++/8/bits/fs_dir.h:456: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/tmp/ccxhgzCH.ltrans0.ltrans.o: In function `gnome_config_extension::gnome_config_extension()':
/usr/include/c++/8/bits/shared_ptr_base.h:614: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/tmp/ccxhgzCH.ltrans0.ltrans.o: In function `gnome_config_extension::gnome_config_extension()':
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:213: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:213: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:213: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:213: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::operator*() const'
/tmp/ccxhgzCH.ltrans0.ltrans.o: In function `gnome_config_extension::gnome_config_extension()':
/usr/include/c++/8/bits/fs_path.h:185: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/include/c++/8/bits/fs_path.h:546: undefined reference to `std::filesystem::__cxx11::path::compare(std::filesystem::__cxx11::path const&) const'
/tmp/ccxhgzCH.ltrans0.ltrans.o: In function `gnome_config_extension::gnome_config_extension()':
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:213: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::operator++()'
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:215: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:215: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:215: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/tmp/ccxhgzCH.ltrans0.ltrans.o: In function `gnome_config_extension::gnome_config_extension() [clone .cold.10]':
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:213: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:213: undefined reference to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()'
/tmp/ccxhgzCH.ltrans0.ltrans.o:/usr/src/Libraries/libproxy/libproxy/modules/config_gnome3.cpp:213: more undefined references to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' follow
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Error: building at STEP "RUN git clone -b 0.4.17 --depth=1 https://github.com/libproxy/libproxy.git     && cd libproxy  && git apply ../patches/libproxy.patch  && cmake -GNinja -B build .         -DCMAKE_BUILD_TYPE=None         -DWITH_DBUS=OFF         -DWITH_NM=OFF       -DWITH_NMold=OFF    && cmake --build build --parallel   && DESTDIR="/usr/src/Libraries/libproxy-cache" cmake --install build    && cd ..    && rm -rf libproxy": while running runtime: exit status 1

I managed to fix it by hand with this patch, but I presume that this is something to be fixed in patches repository:

--- a/Telegram/build/docker/centos_env/Dockerfile
+++ b/Telegram/build/docker/centos_env/Dockerfile
@@ -110,6 +110,7 @@ FROM patches AS libproxy
 RUN git clone -b 0.4.17 --depth=1 {{ GIT }}/libproxy/libproxy.git \
        && cd libproxy \
        && git apply ../patches/libproxy.patch \
+    && echo 'target_link_libraries(libproxy stdc++fs)' >> libproxy/CMakeLists.txt \
        && cmake -GNinja -B build . \
                -DCMAKE_BUILD_TYPE=None \
                -DWITH_DBUS=OFF \

Expected behaviour

./tdesktop/Telegram/build/prepare/linux.sh builds all containers and exits with success

Actual behaviour

./tdesktop/Telegram/build/prepare/linux.sh fails at compiling libproxy

Operating system

Fedora 38

Version of Telegram Desktop

Worked from tag v4.12.0.

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

ilya-fedin commented 10 months ago

It seem to run just fine as is on the CI. I believe the problem is on your end.

enedil commented 10 months ago

@ilya-fedin it doesn't run in CI. For instance: https://github.com/telegramdesktop/tdesktop/actions/runs/7123753363/job/19396903805 It just pulls built builder container.

Checking docker version
Clean up resources from previous jobs
Create local container network
  /usr/bin/docker network create --label 10b6bf github_network_44c52c98bc1c4f7e84e42b2fc656d223
  3ec84014d1b0b45fa2a36529ac1c088425aa741ab19ca3e58508921304c30658
Starting job container
  /usr/bin/docker --config /home/runner/work/_temp/.docker_5eddcb74-7985-4fda-a575-ce88c4e59a5a login ghcr.io -u ilya-fedin --password-stdin
  /usr/bin/docker --config /home/runner/work/_temp/.docker_5eddcb74-7985-4fda-a575-ce88c4e59a5a pull ghcr.io/telegramdesktop/tdesktop/centos_env
enedil commented 10 months ago

Thankfully I can just use the linked container directly without rebuilding it.

ilya-fedin commented 10 months ago

You can fork the tdesktop repo and force run the action if you don't trust the last upstream run https://github.com/telegramdesktop/tdesktop/actions/workflows/docker.yml

enedil commented 10 months ago

Ok, I'm sorry for wasting time.

ilya-fedin commented 10 months ago

There were previous reports from the Fedora users that the Dockerfile doesn't work for them, apparently Fedora provides some broken/patched docker. The docker from the Docker's official website may be a rescue.