libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

Libtorrent v2.0.5 Boost 1.78 build error

Open pythagoras9 opened this issue 4 years ago • 6 comments

Error is the same as https://github.com/arvidn/libtorrent/issues/6419

allocating_handler.hpp(180): error C2338: Handler buffer not large enough, please increase it

I am trying to add libtorrent2 to vcpkg. Here is the PR link https://github.com/microsoft/vcpkg/pull/22697 You can also find the logs in the azure pipeline run of the PR https://dev.azure.com/vcpkg/public/_build/results?buildId=66214&view=artifacts&pathAsName=false&type=publishedArtifacts

libtorrent version (or branch): tag v2.0.5

platform/architecture: windows/x64

compiler and compiler version: MSVC 14.30.30705

I'm using Boost 1.78

Here is the build log (Release build)

[105/165] C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1430~1.307\bin\Hostx64\x64\cl.exe /TP -DBOOST_ALL_NO_LIB -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_HAS_STD_CHRONO -DBOOST_ASIO_NO_DEPRECATED -DBOOST_EXCEPTION_DISABLE -DOPENSSL_NO_SSL2 -DTORRENT_BUILDING_LIBRARY -DTORRENT_NO_DEPRECATE -DTORRENT_SSL_PEERS -DTORRENT_USE_LIBCRYPTO -DTORRENT_USE_OPENSSL -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_FILE_OFFSET_BITS=64 -D_SCL_SECURE_NO_DEPRECATE -D_WIN32_WINNT=0x0600 -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\include -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\deps\try_signal -ID:\tttttt\vcpkg_installed\x64-windows-static-md\include /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /MD /O2 /Oi /Gy /DNDEBUG /Z7 -MD /Zc:__cplusplus /W4 /wd4251 /wd4268 /wd4275 /wd4373 /wd4503 /Zc:wchar_t /Zc:forScope /MP /bigobj /EHsc /showIncludes /FoCMakeFiles\torrent-rasterbar.dir\src\add_torrent_params.cpp.obj /Fdtorrent-rasterbar.pdb /FS -c D:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\src\add_torrent_params.cpp cl : Command line warning D9025 : overriding '/W3' with '/W4' [106/165] C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1430~1.307\bin\Hostx64\x64\cl.exe /TP -DBOOST_ALL_NO_LIB -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_HAS_STD_CHRONO -DBOOST_ASIO_NO_DEPRECATED -DBOOST_EXCEPTION_DISABLE -DOPENSSL_NO_SSL2 -DTORRENT_BUILDING_LIBRARY -DTORRENT_NO_DEPRECATE -DTORRENT_SSL_PEERS -DTORRENT_USE_LIBCRYPTO -DTORRENT_USE_OPENSSL -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_FILE_OFFSET_BITS=64 -D_SCL_SECURE_NO_DEPRECATE -D_WIN32_WINNT=0x0600 -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\include -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\deps\try_signal -ID:\tttttt\vcpkg_installed\x64-windows-static-md\include /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /MD /O2 /Oi /Gy /DNDEBUG /Z7 -MD /Zc:__cplusplus /W4 /wd4251 /wd4268 /wd4275 /wd4373 /wd4503 /Zc:wchar_t /Zc:forScope /MP /bigobj /EHsc /showIncludes /FoCMakeFiles\torrent-rasterbar.dir\deps\try_signal\signal_error_code.cpp.obj /Fdtorrent-rasterbar.pdb /FS -c D:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\deps\try_signal\signal_error_code.cpp cl : Command line warning D9025 : overriding '/W3' with '/W4' [107/165] C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1430~1.307\bin\Hostx64\x64\cl.exe /TP -DBOOST_ALL_NO_LIB -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_HAS_STD_CHRONO -DBOOST_ASIO_NO_DEPRECATED -DBOOST_EXCEPTION_DISABLE -DOPENSSL_NO_SSL2 -DTORRENT_BUILDING_LIBRARY -DTORRENT_NO_DEPRECATE -DTORRENT_SSL_PEERS -DTORRENT_USE_LIBCRYPTO -DTORRENT_USE_OPENSSL -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_FILE_OFFSET_BITS=64 -D_SCL_SECURE_NO_DEPRECATE -D_WIN32_WINNT=0x0600 -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\include -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\deps\try_signal -ID:\tttttt\vcpkg_installed\x64-windows-static-md\include /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /MD /O2 /Oi /Gy /DNDEBUG /Z7 -MD /Zc:__cplusplus /W4 /wd4251 /wd4268 /wd4275 /wd4373 /wd4503 /Zc:wchar_t /Zc:forScope /MP /bigobj /EHsc /showIncludes /FoCMakeFiles\torrent-rasterbar.dir\src\storage_utils.cpp.obj /Fdtorrent-rasterbar.pdb /FS -c D:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\src\storage_utils.cpp cl : Command line warning D9025 : overriding '/W3' with '/W4' [108/165] C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1430~1.307\bin\Hostx64\x64\cl.exe /TP -DBOOST_ALL_NO_LIB -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_HAS_STD_CHRONO -DBOOST_ASIO_NO_DEPRECATED -DBOOST_EXCEPTION_DISABLE -DOPENSSL_NO_SSL2 -DTORRENT_BUILDING_LIBRARY -DTORRENT_NO_DEPRECATE -DTORRENT_SSL_PEERS -DTORRENT_USE_LIBCRYPTO -DTORRENT_USE_OPENSSL -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_FILE_OFFSET_BITS=64 -D_SCL_SECURE_NO_DEPRECATE -D_WIN32_WINNT=0x0600 -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\include -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\deps\try_signal -ID:\tttttt\vcpkg_installed\x64-windows-static-md\include /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /MD /O2 /Oi /Gy /DNDEBUG /Z7 -MD /Zc:__cplusplus /W4 /wd4251 /wd4268 /wd4275 /wd4373 /wd4503 /Zc:wchar_t /Zc:forScope /MP /bigobj /EHsc /showIncludes /FoCMakeFiles\torrent-rasterbar.dir\src\session_impl.cpp.obj /Fdtorrent-rasterbar.pdb /FS -c D:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\src\session_impl.cpp FAILED: CMakeFiles/torrent-rasterbar.dir/src/session_impl.cpp.obj C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1430~1.307\bin\Hostx64\x64\cl.exe /TP -DBOOST_ALL_NO_LIB -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_HAS_STD_CHRONO -DBOOST_ASIO_NO_DEPRECATED -DBOOST_EXCEPTION_DISABLE -DOPENSSL_NO_SSL2 -DTORRENT_BUILDING_LIBRARY -DTORRENT_NO_DEPRECATE -DTORRENT_SSL_PEERS -DTORRENT_USE_LIBCRYPTO -DTORRENT_USE_OPENSSL -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_FILE_OFFSET_BITS=64 -D_SCL_SECURE_NO_DEPRECATE -D_WIN32_WINNT=0x0600 -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\include -ID:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\deps\try_signal -ID:\tttttt\vcpkg_installed\x64-windows-static-md\include /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /MD /O2 /Oi /Gy /DNDEBUG /Z7 -MD /Zc:__cplusplus /W4 /wd4251 /wd4268 /wd4275 /wd4373 /wd4503 /Zc:wchar_t /Zc:forScope /MP /bigobj /EHsc /showIncludes /FoCMakeFiles\torrent-rasterbar.dir\src\session_impl.cpp.obj /Fdtorrent-rasterbar.pdb /FS -c D:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\src\session_impl.cpp cl : Command line warning D9025 : overriding '/W3' with '/W4' D:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\include\libtorrent/aux_/allocating_handler.hpp(180): **error C2338: Handler buffer not large enough, please increase it** D:\vcpkg\buildtrees\libtorrent\src\b9d3245f97-d829d86e1d.clean\include\libtorrent/aux_/allocating_handler.hpp(203): note: see reference to class template instantiation 'libtorrent::aux::assert_message<libtorrent::aux::required_size<168>,libtorrent::aux::available_size<160>,libtorrent::aux::tick_handler>' being compiled D:\tttttt\vcpkg_installed\x64-windows-static-md\include\boost/asio/detail/wait_handler.hpp(36): note: see reference to class template instantiation 'libtorrent::aux::handler_allocator<int,160,libtorrent::aux::tick_handler>::rebind<boost::asio::detail::wait_handler<Handler,IoExecutor>>' being compiled with [ Handler=libtorrent::aux::allocating_handler<libtorrent::aux::session_impl::on_tick::<lambda_4469acb33a8313f390619c3cbb98b228>,160,libtorrent::aux::tick_handler>, IoExecutor=boost::asio::any_io_executor ] D:\tttttt\vcpkg_installed\x64-windows-static-md\include\boost/asio/detail/wait_handler.hpp(36): note: see reference to alias template instantiation 'std::_Normal_allocator_traits<_Alloc>::rebind_alloc<boost::asio::detail::wait_handler<Handler,IoExecutor>>' being compiled with [ _Alloc=hook_allocator_type, Handler=libtorrent::aux::allocating_handler<libtorrent::aux::session_impl::on_tick::<lambda_4469acb33a8313f390619c3cbb98b228>,160,libtorrent::aux::tick_handler>, IoExecutor=boost::asio::any_io_executor ] D:\tttttt\vcpkg_installed\x64-windows-static-md\include\boost/asio/detail/wait_handler.hpp(36): note: while compiling class template member function 'boost::asio::detail::wait_handler<Handler,IoExecutor> *boost::asio::detail::wait_handler<Handler,IoExecutor>::ptr::allocate(Handler &)' with [ Handler=libtorrent::aux::allocating_handler<libtorrent::aux::session_impl::on_tick::<lambda_4469acb33a8313f390619c3cbb98b228>,160,libtorrent::aux::tick_handler>, IoExecutor=boost::asio::any_io_executor ]

pythagoras9 avatar Jan 22 '22 07:01 pythagoras9

Okay, seems the latest commit in the RC_2_0 branch works without issues. Would appreciate if someone could verify the port

pythagoras9 avatar Jan 22 '22 09:01 pythagoras9

yeah, this was fixed in RC_2_0, I just haven't cut a new release yet

arvidn avatar Jan 22 '22 13:01 arvidn

We're trying to update Homebrew's version of Boost at Homebrew/homebrew-core#91224, but we're currently blocked on a build failure for libtorrent-rasterbar.

I'm looking into backporting patches to fix the build failure, and I found https://github.com/arvidn/libtorrent/commit/71d608fceca7e61c9d124f9ea83f71b06eda3b17, which applies cleanly to 2.0.5. Is there anything else I would need to backport, or should that be enough to fix issues with Boost 1.78?

carlocab avatar Feb 18 '22 08:02 carlocab

That's definitely the main one, to address this issue. I can't recall if there has been other issues also.

arvidn avatar Feb 18 '22 11:02 arvidn

@carlocab carlocab also works for me, Nice!

gesangtome avatar Mar 25 '22 12:03 gesangtome

it should be closed as so as it was fixed and the same issue #6634 was already closed

Kolcha avatar May 17 '22 14:05 Kolcha

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 06:09 stale[bot]