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

Fix broken test on builds relying on poco 1.12.x #126

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

acmiyaguchi
Copy link

I run into build failures on arch when building libfranka via the ros-noetic-libfranka aur package. I get the following build failure.

/home/anthony/robotics/libfranka/test/mock_server.cpp:227:16:   required from here
/home/anthony/robotics/libfranka/test/mock_server.cpp:127:29: error: no matching function for call to ‘Poco::Net::DatagramSocket::DatagramSocket(<brace-enclosed initializer list>)’
  127 |   Poco::Net::DatagramSocket udp_socket({kHostname, 0});
      |                             ^~~~~~~~~~
/usr/include/Poco/Net/DatagramSocket.h:283:9: note: candidate: ‘Poco::Net::DatagramSocket::DatagramSocket(Poco::Net::SocketImpl*)’
  283 |         DatagramSocket(SocketImpl* pImpl);
      |         ^~~~~~~~~~~~~~
/usr/include/Poco/Net/DatagramSocket.h:283:36: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘Poco::Net::SocketImpl*’
  283 |         DatagramSocket(SocketImpl* pImpl);
      |                        ~~~~~~~~~~~~^~~~~
/usr/include/Poco/Net/DatagramSocket.h:66:9: note: candidate: ‘Poco::Net::DatagramSocket::DatagramSocket(const Poco::Net::DatagramSocket&)’
   66 |         DatagramSocket(const DatagramSocket& socket);
      |         ^~~~~~~~~~~~~~
/usr/include/Poco/Net/DatagramSocket.h:66:46: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const Poco::Net::DatagramSocket&’
   66 |         DatagramSocket(const DatagramSocket& socket);
      |                        ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/Poco/Net/DatagramSocket.h:60:9: note: candidate: ‘Poco::Net::DatagramSocket::DatagramSocket(const Poco::Net::Socket&)’
   60 |         DatagramSocket(const Socket& socket);
      |         ^~~~~~~~~~~~~~
/usr/include/Poco/Net/DatagramSocket.h:60:38: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const Poco::Net::Socket&’
   60 |         DatagramSocket(const Socket& socket);
      |                        ~~~~~~~~~~~~~~^~~~~~
/usr/include/Poco/Net/DatagramSocket.h:51:9: note: candidate: ‘Poco::Net::DatagramSocket::DatagramSocket(const Poco::Net::SocketAddress&, bool, bool, bool)’
   51 |         DatagramSocket(const SocketAddress& address, bool reuseAddress, bool reusePort = false, bool ipV6Only = false);
      |         ^~~~~~~~~~~~~~
/usr/include/Poco/Net/DatagramSocket.h:51:9: note:   candidate expects 4 arguments, 1 provided
/usr/include/Poco/Net/DatagramSocket.h:45:18: note: candidate: ‘Poco::Net::DatagramSocket::DatagramSocket(Poco::Net::SocketAddress::Family)’
   45 |         explicit DatagramSocket(SocketAddress::Family family);
      |                  ^~~~~~~~~~~~~~
/usr/include/Poco/Net/DatagramSocket.h:45:55: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘Poco::Net::SocketAddress::Family’ {aka ‘Poco::Net::AddressFamily::Family’}
   45 |         explicit DatagramSocket(SocketAddress::Family family);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/Poco/Net/DatagramSocket.h:35:9: note: candidate: ‘Poco::Net::DatagramSocket::DatagramSocket()’
   35 |         DatagramSocket();
      |         ^~~~~~~~~~~~~~
/usr/include/Poco/Net/DatagramSocket.h:35:9: note:   candidate expects 0 arguments, 1 provided

This is because poco changed the DatagramSocket constructor (presumably in pocoproject/poco#3283, but I can't be sure because of intermittent github issues). The commit that made the breaking change is included in poco 1.12.x: pocoproject/poco@7852153

In particular, the following change was made:

-	DatagramSocket(const SocketAddress& address, bool reuseAddress = false);
- 	DatagramSocket(const SocketAddress& address, bool reuseAddress, bool reusePort);
+	DatagramSocket(const SocketAddress& address, bool reuseAddress, bool reusePort = false, bool ipV6Only = false);

This PR resolves the issue by creating an empty socket and binding on it manually, which builds correctly on poco 1.12.1,

@marcbone marcbone changed the base branch from master to develop September 12, 2022 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant