miguelfreitas / twister-core

twister core / daemon
MIT License
1.42k stars 251 forks source link

Twister does not build with boost-1.66 #417

Open thierry-FreeBSD opened 6 years ago

thierry-FreeBSD commented 6 years ago

Trying to compile twister against boost-1.66 fails:

In file included from web_connection_base.cpp:40:
In file included from ../include/libtorrent/web_connection_base.hpp:60:
../include/libtorrent/peer_connection.hpp:803:3: error: incomplete type 'boost::asio::io_service' named in nested name specifier
                io_service::work m_work;
                ^~~~~~~~~~~~
../include/libtorrent/io_service_fwd.hpp:59:7: note: forward declaration of 'boost::asio::io_service'
class io_service;
      ^
In file included from web_connection_base.cpp:40:
In file included from ../include/libtorrent/web_connection_base.hpp:67:
In file included from ../include/libtorrent/torrent.hpp:63:
In file included from ../include/libtorrent/tracker_manager.hpp:62:
In file included from ../include/libtorrent/connection_queue.hpp:40:
In file included from ../include/libtorrent/io_service.hpp:54:
/usr/local/include/boost/asio/io_service.hpp:27:20: error: typedef redefinition with different types ('boost::asio::io_context' vs 'boost::asio::io_service')
typedef io_context io_service;
                   ^
../include/libtorrent/io_service_fwd.hpp:59:7: note: previous definition is here
class io_service;
      ^

Full log is available at http://package22.nyi.freebsd.org/data/111amd64-default-PR223922/2017-12-03_09h31m05s/logs/errors/twister-core-0.9.34_9,1.log The same failure has been reported in libtorrent, and a fix has been proposed: https://github.com/arvidn/libtorrent/commit/f42b63c7ea82 Would you accept such a fix?

miguelfreitas commented 6 years ago

Sure! May you please send a Pull Request?

thierry-FreeBSD commented 6 years ago

Actually, this patch only fixes the previous error, but now it fails with this one:

In file included from web_connection_base.cpp:40:
In file included from ../include/libtorrent/web_connection_base.hpp:67:
In file included from ../include/libtorrent/torrent.hpp:75:
In file included from ../include/libtorrent/aux_/session_impl.hpp:76:
In file included from ../include/libtorrent/socket_type.hpp:47:
In file included from ../include/libtorrent/ssl_stream.hpp:41:
In file included from /usr/local/include/boost/asio/ssl.hpp:22:
/usr/local/include/boost/asio/ssl/stream.hpp:85:39: error: no type named 'executor_type' in 'libtorrent::utp_stream'
  typedef typename lowest_layer_type::executor_type executor_type;
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
../include/libtorrent/ssl_stream.hpp:60:19: note: in instantiation of template class 'boost::asio::ssl::stream<libtorrent::utp_stream>' requested here
        typedef typename sock_type::next_layer_type next_layer_type;
                         ^
../include/libtorrent/socket_type.hpp:296:6: note: in instantiation of template class 'libtorrent::ssl_stream<libtorrent::utp_stream>' requested here
                        , sizeof(ssl_stream<utp_stream>)
                          ^
1 warning and 1 error generated.

The same error has already been reported at https://github.com/arvidn/libtorrent/issues/2585

Still looking for a complete solution.

arvidn commented 6 years ago

This may be relevant here too: https://github.com/boostorg/asio/issues/74

thierry-FreeBSD commented 6 years ago

Thanks @arvidn ! Unfortunately the version of libtorrent included in twister is different, and I don't know libtorrent enough to blindly adapt you patches... @miguelfreitas : any chance to update the embedded libtorrent? Or yet better to depend on libtorrent as an external library?

dryabov commented 6 years ago

@thierry-FreeBSD libtorrent in twister is modified too much (infinite files, etc.), and so there is no easy way to "depend on libtorrent as an external library".

jbeich commented 6 years ago

Have you tried backporting arvidn/libtorrent@d1a63cd781e7 as well?