hyprwm / hypridle

Hyprland's idle daemon
BSD 3-Clause "New" or "Revised" License
381 stars 24 forks source link

Fails to build with sdbus-cpp 2.0.0 #95

Open jbeich opened 5 hours ago

jbeich commented 5 hours ago

Regressed by https://github.com/Kistler-Group/sdbus-cpp/commit/3e20fc639ee3 and https://github.com/Kistler-Group/sdbus-cpp/commit/42f0bd07c007. Note, hyprlock >= 0.5.0 requires sdbus-cpp >= 2.0.0 which introduces a conflict when building against system package.

src/core/Hypridle.cpp:156:45: error: no member named 'processPendingRequest' in 'sdbus::IConnection'; did you mean 'processPendingEvent'?
  156 |             while (m_sDBUSState.connection->processPendingRequest()) {
      |                                             ^~~~~~~~~~~~~~~~~~~~~
      |                                             processPendingEvent
/usr/include/sdbus-c++/IConnection.h:176:22: note: 'processPendingEvent' declared here
  176 |         virtual bool processPendingEvent() = 0;
      |                      ^
src/core/Hypridle.cpp:174:63: error: no member named 'processPendingRequest' in 'sdbus::IConnection'; did you mean 'processPendingEvent'?
  174 |             while (m_sDBUSState.screenSaverServiceConnection->processPendingRequest()) {
      |                                                               ^~~~~~~~~~~~~~~~~~~~~
      |                                                               processPendingEvent
/usr/include/sdbus-c++/IConnection.h:176:22: note: 'processPendingEvent' declared here
  176 |         virtual bool processPendingEvent() = 0;
      |                      ^
src/core/Hypridle.cpp:501:32: error: no matching function for call to 'createProxy'
  501 |     auto              proxy  = sdbus::createProxy("org.freedesktop.login1", "/org/freedesktop/login1");
      |                                ^~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:936:50: note: candidate function not viable: no known conversion from 'const char[23]' to 'ServiceName' (aka 'sdbus::BusName') for 1st argument
  936 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( ServiceName destination
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:861:50: note: candidate function not viable: requires 3 arguments, but 2 were provided
  861 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( sdbus::IConnection& connection
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  862 |                                                             , ServiceName destination
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~
  863 |                                                             , ObjectPath objectPath );
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:887:50: note: candidate function not viable: requires 3 arguments, but 2 were provided
  887 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( std::unique_ptr<sdbus::IConnection>&& connection
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  888 |                                                             , ServiceName destination
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~
  889 |                                                             , ObjectPath objectPath );
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:957:50: note: candidate function not viable: requires 3 arguments, but 2 were provided
  957 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( ServiceName destination
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~
  958 |                                                             , ObjectPath objectPath
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~
  959 |                                                             , dont_run_event_loop_thread_t );
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:914:50: note: candidate function not viable: requires 4 arguments, but 2 were provided
  914 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( std::unique_ptr<sdbus::IConnection>&& connection
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  915 |                                                             , ServiceName destination
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~
  916 |                                                             , ObjectPath objectPath
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~
  917 |                                                             , dont_run_event_loop_thread_t );
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:510:34: error: no matching member function for call to 'addMatch'
  510 |         m_sDBUSState.connection->addMatch("type='signal',path='" + path + "',interface='org.freedesktop.login1.Session'", handleDbusLogin, sdbus::floating_slot_t{});
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/include/sdbus-c++/IConnection.h:303:36: note: candidate function not viable: no known conversion from 'void (sdbus::Message &)' to 'message_handler' (aka 'function<void (Message)>') for 2nd argument
  303 |         [[nodiscard]] virtual Slot addMatch(const std::string& match, message_handler callback, return_slot_t) = 0;
      |                                    ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:280:22: note: candidate function not viable: requires 2 arguments, but 3 were provided
  280 |         virtual void addMatch(const std::string& match, message_handler callback) = 0;
      |                      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:511:34: error: no matching member function for call to 'addMatch'
  511 |         m_sDBUSState.connection->addMatch("type='signal',path='/org/freedesktop/login1',interface='org.freedesktop.login1.Manager'", handleDbusSleep, sdbus::floating_slot_t{});
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/include/sdbus-c++/IConnection.h:303:36: note: candidate function not viable: no known conversion from 'void (sdbus::Message &)' to 'message_handler' (aka 'function<void (Message)>') for 2nd argument
  303 |         [[nodiscard]] virtual Slot addMatch(const std::string& match, message_handler callback, return_slot_t) = 0;
      |                                    ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:280:22: note: candidate function not viable: requires 2 arguments, but 3 were provided
  280 |         virtual void addMatch(const std::string& match, message_handler callback) = 0;
      |                      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:517:34: error: no matching member function for call to 'addMatch'
  517 |         m_sDBUSState.connection->addMatch("type='signal',path='/org/freedesktop/login1',interface='org.freedesktop.DBus.Properties'", handleDbusBlockInhibitsPropertyChanged,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/include/sdbus-c++/IConnection.h:303:36: note: candidate function not viable: no known conversion from 'void (sdbus::Message &)' to 'message_handler' (aka 'function<void (Message)>') for 2nd argument
  303 |         [[nodiscard]] virtual Slot addMatch(const std::string& match, message_handler callback, return_slot_t) = 0;
      |                                    ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:280:22: note: candidate function not viable: requires 2 arguments, but 3 were provided
  280 |         virtual void addMatch(const std::string& match, message_handler callback) = 0;
      |                      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:534:57:Regressed by https://github.com/Kistler-Group/sdbus-cpp/commit/3e20fc639ee3 and https://github.com/Kistler-Group/sdbus-cpp/commit/42f0bd07c007. Note, hyprlock >= 0.5.0 [requires](https://github.com/hyprwm/hyprlock/pull/514) sdbus-cpp >= 2.0.0 which introduces a conflict when building against system package.

```c++
src/core/Hypridle.cpp:156:45: error: no member named 'processPendingRequest' in 'sdbus::IConnection'; did you mean 'processPendingEvent'?
  156 |             while (m_sDBUSState.connection->processPendingRequest()) {
      |                                             ^~~~~~~~~~~~~~~~~~~~~
      |                                             processPendingEvent
/usr/include/sdbus-c++/IConnection.h:176:22: note: 'processPendingEvent' declared here
  176 |         virtual bool processPendingEvent() = 0;
      |                      ^
src/core/Hypridle.cpp:174:63: error: no member named 'processPendingRequest' in 'sdbus::IConnection'; did you mean 'processPendingEvent'?
  174 |             while (m_sDBUSState.screenSaverServiceConnection->processPendingRequest()) {
      |                                                               ^~~~~~~~~~~~~~~~~~~~~
      |                                                               processPendingEvent
/usr/include/sdbus-c++/IConnection.h:176:22: note: 'processPendingEvent' declared here
  176 |         virtual bool processPendingEvent() = 0;
      |                      ^
src/core/Hypridle.cpp:501:32: error: no matching function for call to 'createProxy'
  501 |     auto              proxy  = sdbus::createProxy("org.freedesktop.login1", "/org/freedesktop/login1");
      |                                ^~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:936:50: note: candidate function not viable: no known conversion from 'const char[23]' to 'ServiceName' (aka 'sdbus::BusName') for 1st argument
  936 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( ServiceName destination
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:861:50: note: candidate function not viable: requires 3 arguments, but 2 were provided
  861 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( sdbus::IConnection& connection
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  862 |                                                             , ServiceName destination
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~
  863 |                                                             , ObjectPath objectPath );
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:887:50: note: candidate function not viable: requires 3 arguments, but 2 were provided
  887 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( std::unique_ptr<sdbus::IConnection>&& connection
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  888 |                                                             , ServiceName destination
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~
  889 |                                                             , ObjectPath objectPath );
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:957:50: note: candidate function not viable: requires 3 arguments, but 2 were provided
  957 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( ServiceName destination
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~
  958 |                                                             , ObjectPath objectPath
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~
  959 |                                                             , dont_run_event_loop_thread_t );
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IProxy.h:914:50: note: candidate function not viable: requires 4 arguments, but 2 were provided
  914 |     [[nodiscard]] std::unique_ptr<sdbus::IProxy> createProxy( std::unique_ptr<sdbus::IConnection>&& connection
      |                                                  ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  915 |                                                             , ServiceName destination
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~
  916 |                                                             , ObjectPath objectPath
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~
  917 |                                                             , dont_run_event_loop_thread_t );
      |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:510:34: error: no matching member function for call to 'addMatch'
  510 |         m_sDBUSState.connection->addMatch("type='signal',path='" + path + "',interface='org.freedesktop.login1.Session'", handleDbusLogin, sdbus::floating_slot_t{});
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/include/sdbus-c++/IConnection.h:303:36: note: candidate function not viable: no known conversion from 'void (sdbus::Message &)' to 'message_handler' (aka 'function<void (Message)>') for 2nd argument
  303 |         [[nodiscard]] virtual Slot addMatch(const std::string& match, message_handler callback, return_slot_t) = 0;
      |                                    ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:280:22: note: candidate function not viable: requires 2 arguments, but 3 were provided
  280 |         virtual void addMatch(const std::string& match, message_handler callback) = 0;
      |                      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:511:34: error: no matching member function for call to 'addMatch'
  511 |         m_sDBUSState.connection->addMatch("type='signal',path='/org/freedesktop/login1',interface='org.freedesktop.login1.Manager'", handleDbusSleep, sdbus::floating_slot_t{});
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/include/sdbus-c++/IConnection.h:303:36: note: candidate function not viable: no known conversion from 'void (sdbus::Message &)' to 'message_handler' (aka 'function<void (Message)>') for 2nd argument
  303 |         [[nodiscard]] virtual Slot addMatch(const std::string& match, message_handler callback, return_slot_t) = 0;
      |                                    ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:280:22: note: candidate function not viable: requires 2 arguments, but 3 were provided
  280 |         virtual void addMatch(const std::string& match, message_handler callback) = 0;
      |                      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:517:34: error: no matching member function for call to 'addMatch'
  517 |         m_sDBUSState.connection->addMatch("type='signal',path='/org/freedesktop/login1',interface='org.freedesktop.DBus.Properties'", handleDbusBlockInhibitsPropertyChanged,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/include/sdbus-c++/IConnection.h:303:36: note: candidate function not viable: no known conversion from 'void (sdbus::Message &)' to 'message_handler' (aka 'function<void (Message)>') for 2nd argument
  303 |         [[nodiscard]] virtual Slot addMatch(const std::string& match, message_handler callback, return_slot_t) = 0;
      |                                    ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:280:22: note: candidate function not viable: requires 2 arguments, but 3 were provided
  280 |         virtual void addMatch(const std::string& match, message_handler callback) = 0;
      |                      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/Hypridle.cpp:534:57: error: no matching function for call to 'createSessionBusConnection'
  534 |             m_sDBUSState.screenSaverServiceConnection = sdbus::createSessionBusConnection("org.freedesktop.ScreenSaver");
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:491:55: note: candidate function not viable: no known conversion from 'const char[28]' to 'const ServiceName' (aka 'const sdbus::BusName') for 1st argument
  491 |     [[nodiscard]] std::unique_ptr<sdbus::IConnection> createSessionBusConnection(const ServiceName& name);
      |                                                       ^                          ~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:481:55: note: candidate function not viable: requires 0 arguments, but 1 was provided
  481 |     [[nodiscard]] std::unique_ptr<sdbus::IConnection> createSessionBusConnection();
      |                                                       ^
src/core/Hypridle.cpp:538:96: error: no viable conversion from 'const std::string' (aka 'const basic_string<char>') to 'ObjectPath'
  538 |                     auto obj = sdbus::createObject(*m_sDBUSState.screenSaverServiceConnection, path);
      |                                                                                                ^~~~
/usr/include/sdbus-c++/Types.h:176:11: note: candidate constructor (the implicit copy constructor) not viable: cannot bind base class object of type 'const std::string' (aka 'const basic_string<char>') to derived class reference 'const ObjectPath &' for 1st argument
  176 |     class ObjectPath : public std::string
      |           ^~~~~~~~~~
/usr/include/sdbus-c++/Types.h:176:11: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const std::string' (aka 'const basic_string<char>') to 'ObjectPath &&' for 1st argument
  176 |     class ObjectPath : public std::string
      |           ^~~~~~~~~~
/usr/include/sdbus-c++/Types.h:180:18: note: explicit constructor is not a candidate
  180 |         explicit ObjectPath(std::string value)
      |                  ^
/usr/include/sdbus-c++/Types.h:183:18: note: explicit constructor is not a candidate
  183 |         explicit ObjectPath(const char* value)
      |                  ^
/usr/include/c++/v1/string:1108:55: note: candidate function
 1108 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT {
      |                                                       ^
/usr/include/sdbus-c++/IObject.h:477:107: note: passing argument to parameter 'objectPath' here
  477 |     [[nodiscard]] std::unique_ptr<sdbus::IObject> createObject(sdbus::IConnection& connection, ObjectPath objectPath);
      |                                                                                                           ^
src/core/Hypridle.cpp:547:56: error: no matching member function for call to 'addMatch'
  547 |             m_sDBUSState.screenSaverServiceConnection->addMatch("type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged'",
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/usr/include/sdbus-c++/IConnection.h:303:36: note: candidate function not viable: no known conversion from 'void (sdbus::Message &)' to 'message_handler' (aka 'function<void (Message)>') for 2nd argument
  303 |         [[nodiscard]] virtual Slot addMatch(const std::string& match, message_handler callback, return_slot_t) = 0;
      |                                    ^                                  ~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sdbus-c++/IConnection.h:280:22: note: candidate function not viable: requires 2 arguments, but 3 were provided
  280 |         virtual void addMatch(const std::string& match, message_handler callback) = 0;
      |                      ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: no matching function for call to 'createSessionBusConnection' 534 | m_sDBUSState.screenSaverServiceConnection = sdbus::createSessionBusConnection("org.freedesktop.ScreenSaver"); | ^~~~~~~~~ /usr/include/sdbus-c++/IConnection.h:491:55: note: candidate function not viable: no known conversion from 'const char[28]' to 'const ServiceName' (aka 'const sdbus::BusName') for 1st argument 491 | [[nodiscard]] std::unique_ptr createSessionBusConnection(const ServiceName& name); | ^ ~~~~~~~ /usr/include/sdbus-c++/IConnection.h:481:55: note: candidate function not viable: requires 0 arguments, but 1 was provided 481 | [[nodiscard]] std::unique_ptr createSessionBusConnection(); | ^ src/core/Hypridle.cpp:538:96: error: no viable conversion from 'const std::string' (aka 'const basic_string') to 'ObjectPath' 538 | auto obj = sdbus::createObject(m_sDBUSState.screenSaverServiceConnection, path); | ^~~~ /usr/include/sdbus-c++/Types.h:176:11: note: candidate constructor (the implicit copy constructor) not viable: cannot bind base class object of type 'const std::string' (aka 'const basic_string') to derived class reference 'const ObjectPath &' for 1st argument 176 | class ObjectPath : public std::string | ^~~~~~ /usr/include/sdbus-c++/Types.h:176:11: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const std::string' (aka 'const basic_string') to 'ObjectPath &&' for 1st argument 176 | class ObjectPath : public std::string | ^~~~~~ /usr/include/sdbus-c++/Types.h:180:18: note: explicit constructor is not a candidate 180 | explicit ObjectPath(std::string value) | ^ /usr/include/sdbus-c++/Types.h:183:18: note: explicit constructor is not a candidate 183 | explicit ObjectPath(const char value) | ^ /usr/include/c++/v1/string:1108:55: note: candidate function 1108 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 operator __self_view() const _NOEXCEPT { | ^ /usr/include/sdbus-c++/IObject.h:477:107: note: passing argument to parameter 'objectPath' here 477 | [[nodiscard]] std::unique_ptr createObject(sdbus::IConnection& connection, ObjectPath objectPath); | ^ src/core/Hypridle.cpp:547:56: error: no matching member function for call to 'addMatch' 547 | m_sDBUSState.screenSaverServiceConnection->addMatch("type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged'", | ~~~~~~~~~^~ /usr/include/sdbus-c++/IConnection.h:303:36: note: candidate function not viable: no known conversion from 'void (sdbus::Message &)' to 'message_handler' (aka 'function<void (Message)>') for 2nd argument 303 | [[nodiscard]] virtual Slot addMatch(const std::string& match, message_handler callback, return_slot_t) = 0; | ^ ~~~~~~~~ /usr/include/sdbus-c++/IConnection.h:280:22: note: candidate function not viable: requires 2 arguments, but 3 were provided 280 | virtual void addMatch(const std::string& match, message_handler callback) = 0; | ^ ~~~~~~~~~~

vaxerski commented 4 hours ago

see https://github.com/hyprwm/hypridle/pull/96

vaxerski commented 4 hours ago

both this and xdph need to be tested (generally I'd assume the MRs to work though, xdph seems to work, hypridle I dont use on my desktop)

and then they can be merged and releases made as well.