hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
273 stars 47 forks source link

Error build on Debian 12 #263

Closed Xdavius closed 4 days ago

Xdavius commented 4 days ago

Hi dev, All checks passed successfuly. However I still can't build.

/tmp/pacstall/xdg-desktop-portal-hyprland-git~1.3.3/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp: In member function ‘void CPortalManager::init()’:
/tmp/pacstall/xdg-desktop-portal-hyprland-git~1.3.3/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp:204:58: error: no matching function for call to ‘createSessionBusConnection(const char [45])’
  204 |         m_pConnection = sdbus::createSessionBusConnection("org.freedesktop.impl.portal.desktop.hyprland");
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/sdbus-c++/sdbus-c++.h:27,
                 from /tmp/pacstall/xdg-desktop-portal-hyprland-git~1.3.3/xdg-desktop-portal-hyprland/src/core/PortalManager.hpp:4,
                 from /tmp/pacstall/xdg-desktop-portal-hyprland-git~1.3.3/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp:1:
/usr/include/sdbus-c++/IConnection.h:481:55: note: candidate: ‘std::unique_ptr<sdbus::IConnection> sdbus::createSessionBusConnection()’
  481 |     [[nodiscard]] std::unique_ptr<sdbus::IConnection> createSessionBusConnection();
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:481:55: note:   candidate expects 0 arguments, 1 provided
/usr/include/sdbus-c++/IConnection.h:491:55: note: candidate: ‘std::unique_ptr<sdbus::IConnection> sdbus::createSessionBusConnection(const ServiceName&)’
  491 |     [[nodiscard]] std::unique_ptr<sdbus::IConnection> createSessionBusConnection(const ServiceName& name);
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:491:101: note:   no known conversion for argument 1 from ‘const char [45]’ to ‘const sdbus::ServiceName&’ {aka ‘const sdbus::BusName&’}
  491 |     [[nodiscard]] std::unique_ptr<sdbus::IConnection> createSessionBusConnection(const ServiceName& name);
      |                                                                                  ~~~~~~~~~~~~~~~~~~~^~~~
/tmp/pacstall/xdg-desktop-portal-hyprland-git~1.3.3/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp: In member function ‘void CPortalManager::startEventLoop()’:
/tmp/pacstall/xdg-desktop-portal-hyprland-git~1.3.3/xdg-desktop-portal-hyprland/src/core/PortalManager.cpp:370:35: error: ‘class sdbus::IConnection’ has no member named ‘processPendingRequest’; did you mean ‘processPendingEvent’?
  370 |             while (m_pConnection->processPendingRequest()) {
      |                                   ^~~~~~~~~~~~~~~~~~~~~
      |                                   processPendingEvent
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-address-of-temporary’ may have been intended to silence earlier diagnostics
gmake[2]: *** [CMakeFiles/xdg-desktop-portal-hyprland.dir/build.make:121 : CMakeFiles/xdg-desktop-portal-hyprland.dir/src/core/PortalManager.cpp.o] Erreur 1
gmake[1]: *** [CMakeFiles/Makefile2:110 : CMakeFiles/xdg-desktop-portal-hyprland.dir/all] Erreur 2
gmake: *** [Makefile:136 : all] Erreur 2
        [!] ERROR: Could not build xdg-desktop-portal-hyprland-git properly

Build function

build() {
  cd "${gives}"
  export CC=/opt/gcc-latest/bin/gcc
  export CXX=/opt/gcc-latest/bin/g++
  export LD_LIBRARY_PATH=/opt/gcc-latest/lib64:/opt/gcc-latest/lib:$LD_LIBRARY_PATH
  cmake \
    -DCMAKE_C_COMPILER=/opt/gcc-latest/bin/gcc \
    -DCMAKE_CXX_COMPILER=/opt/gcc-latest/bin/g++ \
    -DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++" \
    -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -S . -B build
  cmake --build build --config Release --target all
}

Configure

-- The C compiler identification is GNU 15.0.0
-- The CXX compiler identification is GNU 15.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/gcc-latest/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/gcc-latest/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring XDPH in Release with CMake
-- Checking deps...
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Checking for modules 'wayland-client;wayland-protocols;libpipewire-0.3>=1.1.82;libspa-0.2;libdrm;gbm;hyprlang>=0.2.0;hyprutils;hyprwayland-scanner>=0.4.2'
--   Found wayland-client, version 1.23.0
--   Found wayland-protocols, version 1.37
--   Found libpipewire-0.3, version 1.2.3
--   Found libspa-0.2, version 0.2
--   Found libdrm, version 2.4.122
--   Found gbm, version 24.2.3
--   Found hyprlang, version 0.5.2
--   Found hyprutils, version 0.2.2
--   Found hyprwayland-scanner, version 0.4.2
-- Checking for module 'sdbus-c++'
--   Found sdbus-c++, version 2.0.0
-- Checking for module 'hyprland-protocols'
--   Found hyprland-protocols, version 0.3.0
-- Found wayland-protocols at //usr/share/wayland-protocols
-- Found wayland-scanner at //usr/share/wayland
-- Configuring done (0.7s)
-- Generating done (0.0s)

Maybe I miss something.

Regards.

Xdavius commented 4 days ago

Also, sdbus-cpp included as submodule fail to build.

the version 2.0 build succefully.

vaxerski commented 4 days ago

That's the problem, we use 1.3.0. I'll update to 2.0 some day, but for now, you gotta use the submodule.

If it doesn't build, that's something wrong on your end. Maybe missing deps?

Xdavius commented 4 days ago

That's the problem, we use 1.3.0. I'll update to 2.0 some day, but for now, you gotta use the submodule.

If it doesn't build, that's something wrong on your end. Maybe missing deps?

Hi

I don't have any error speaking about dependencies.

Just the same kind of errors with std. The new libstdc++ is well linked because all wayland packages build successful.

I can test building 1.3.0 from scratch.

Previously, I had the same error on 1.4.0/1.6.0 from scratch.

Sources are available on debian Sid for 1.6.0 Maybe they have some useful patches. I will look tomorrow

I'm thinking that GCC latest could be too new.

I keep contact here to send you news.

Regards.

Xdavius commented 3 days ago

@vaxerski Hi

Today I have build successfully sdbus-cpp and xdg-desktop-portal-hyprland.

There is an issue with sdbus-cpp < 2.0 with GCC 15 (seems also the same with GCC 14.2)

So submodule doesn't compile.

However, xdg-desktop-portal-hyprland needs GCC =>14

Submodules build, but portal will not (missing format.h)

So need usage of both GCC 12 and GCC 14+

As the latest version is 2.0, I also have to use 1.6, and have everything working.

I don't know how it works on Arch, if everything build fine with GCC 14.

Well, I did it. Everything is good.

Best regards.