diff --git a/.travis.yml b/.travis.yml index e5f5ae8d7..c2f94faef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: cpp +dist: trusty matrix: fast_finish: true @@ -16,8 +17,7 @@ matrix: - os: osx osx_image: xcode7.3 env: variant=test_barebones tools=1 examples=1 toolset=darwin python=1 - - dist: trusty - env: arch=arm toolset=gcc-arm + - env: arch=arm toolset=gcc-arm notifications: email: false @@ -145,7 +145,7 @@ script: # libtorrent is the name of the test suite target - cd test - 'if [ "$tests" == "1" ]; then - travis_retry bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant libtorrent test_natpmp enum_if -l300 && + travis_retry bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant libtorrent test_natpmp enum_if -l300 && if [ "$coverage" == "1" ]; then codecov --root .. --gcov-exec gcov-5; fi; @@ -153,36 +153,28 @@ script: - cd ../examples - 'if [ "$examples" == "1" ]; then - bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared; + bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant link=shared; fi' - cd .. - cd tools - 'if [ "$tools" == "1" ]; then - bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared; + bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant link=shared; fi' - cd .. -# build libtorrent separately and install it in a temporary (well known) dir -# we have to do this because on linux the name of the python module is the same -# as the main library, so we cannot stage them to the same directory -# here we specify the temporary lib dir as a path to look for the main library - - 'if [ "$python" == "1" ]; then - bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared install location=./lib; - fi' - # a binary built with sanitizer does not interact well with python - cd bindings/python - 'if [[ "$python" == "1" ]]; then - bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant stage_module libtorrent-link=shared install-type=LIB dll-path=../../lib && - LD_LIBRARY_PATH=../../lib DYLD_LIBRARY_PATH=../../lib python test.py; + bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset variant=$variant stage_module stage_dependencies libtorrent-link=shared boost-link=shared && + LD_LIBRARY_PATH=./dependencies DYLD_LIBRARY_PATH=./dependencies python test.py; fi' - cd ../..; # simulation - cd simulation - 'if [[ "$sim" == "1" ]]; then - bjam -j2 crypto=built-in warnings-as-errors=on debug-iterators=on picker-debugging=on invariant-checks=full $toolset deprecated-functions=off; + bjam -j2 crypto=built-in warnings-as-errors=on debug-iterators=on picker-debugging=on asserts=on invariant-checks=full $toolset deprecated-functions=off; fi' - cd .. diff --git a/appveyor.yml b/appveyor.yml index 5cda0d054..76bc1d7e1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,7 +28,7 @@ environment: crypto: openssl install: -- if defined sim ( git submodule update --init --recursive ) +- git submodule update --init --recursive - set ROOT_DIRECTORY=%CD% - cd %ROOT_DIRECTORY% - if %compiler% == msvc-14.0 if defined crypto if not exist openssl-1.0.1p-vs2015.7z ( @@ -83,7 +83,7 @@ build_script: - cd %ROOT_DIRECTORY%\bindings\python # we use 64 bit python builds - if defined python ( - b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% crypto=%crypto% libtorrent-link=shared stage_module install-dependencies=on + b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% crypto=%crypto% libtorrent-link=shared stage_module stage_dependencies ) # simulations @@ -98,7 +98,10 @@ test_script: - cd %ROOT_DIRECTORY%\bindings\python # we use 64 bit python build -- if defined python ( c:\Python35-x64\python.exe test.py ) +- if defined python ( + copy dependencies\*.* . + & c:\Python35-x64\python.exe test.py + ) # simulation tests - cd %ROOT_DIRECTORY%\simulation diff --git a/bindings/python/Jamfile b/bindings/python/Jamfile index 2760fa575..8701a21cd 100644 --- a/bindings/python/Jamfile +++ b/bindings/python/Jamfile @@ -161,8 +161,17 @@ my-python-extension libtorrent install stage_module : libtorrent : . - LIB + PYTHON_EXTENSION + ; + +install stage_dependencies + : /torrent//torrent + boost_python + : dependencies + on + SHARED_LIB ; explicit stage_module ; +explicit stage_dependencies ; diff --git a/bindings/python/src/boost_python.hpp b/bindings/python/src/boost_python.hpp index acd2fc4f5..58fc4bb07 100644 --- a/bindings/python/src/boost_python.hpp +++ b/bindings/python/src/boost_python.hpp @@ -6,11 +6,22 @@ #define BOOST_PYTHON_HPP #include -#include #include + +#include + +// in boost 1.60, placeholders moved into a namespace, just like std +#if BOOST_VERSION >= 106000 +using namespace boost::placeholders; +#endif + #include +#include + #include +#include + // something in here creates a define for this, presumably to make older // versions of msvc appear to support snprintf #ifdef snprintf diff --git a/bindings/python/src/error_code.cpp b/bindings/python/src/error_code.cpp index dbd21c212..36f34af23 100644 --- a/bindings/python/src/error_code.cpp +++ b/bindings/python/src/error_code.cpp @@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "boost_python.hpp" #include #include #include @@ -38,8 +39,9 @@ POSSIBILITY OF SUCH DAMAGE. namespace boost { // this fixe mysterious link error on msvc - boost::system::error_category const volatile* - get_pointer(boost::system::error_category const volatile* p) + template <> + inline boost::system::error_category const volatile* + get_pointer(class boost::system::error_category const volatile* p) { return p; } @@ -49,7 +51,6 @@ namespace boost #if defined TORRENT_USE_OPENSSL #include #endif -#include "boost_python.hpp" using namespace boost::python; using namespace lt; diff --git a/bindings/python/src/fingerprint.cpp b/bindings/python/src/fingerprint.cpp index 2431f6d7a..207fdcd3d 100644 --- a/bindings/python/src/fingerprint.cpp +++ b/bindings/python/src/fingerprint.cpp @@ -2,8 +2,8 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include #include "boost_python.hpp" +#include void bind_fingerprint() { diff --git a/bindings/python/src/ip_filter.cpp b/bindings/python/src/ip_filter.cpp index 83c2685f8..2f586d417 100644 --- a/bindings/python/src/ip_filter.cpp +++ b/bindings/python/src/ip_filter.cpp @@ -2,8 +2,8 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include #include "boost_python.hpp" +#include #include "gil.hpp" using namespace boost::python; diff --git a/bindings/python/src/module.cpp b/bindings/python/src/module.cpp index 6f116780a..baa572231 100644 --- a/bindings/python/src/module.cpp +++ b/bindings/python/src/module.cpp @@ -6,8 +6,8 @@ #define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY 1 #endif -#include "libtorrent/config.hpp" #include +#include "libtorrent/config.hpp" void bind_utility(); void bind_fingerprint(); diff --git a/bindings/python/src/peer_info.cpp b/bindings/python/src/peer_info.cpp index 86ff4090d..879a98bd8 100644 --- a/bindings/python/src/peer_info.cpp +++ b/bindings/python/src/peer_info.cpp @@ -2,9 +2,9 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include "boost_python.hpp" #include #include -#include "boost_python.hpp" #include using namespace boost::python; diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index 00d0e0c4c..2aa239631 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -2,6 +2,7 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include "boost_python.hpp" #include #include #include @@ -27,8 +28,9 @@ namespace boost { // this fixes mysterious link error on msvc - lt::alert const volatile* - get_pointer(lt::alert const volatile* p) + template <> + inline lt::alert const volatile* + get_pointer(class lt::alert const volatile* p) { return p; } @@ -36,7 +38,6 @@ namespace boost #include "gil.hpp" #include "bytes.hpp" -#include "boost_python.hpp" #ifdef _MSC_VER #pragma warning(push) diff --git a/bindings/python/src/sha1_hash.cpp b/bindings/python/src/sha1_hash.cpp index f81192704..081a7c5ef 100644 --- a/bindings/python/src/sha1_hash.cpp +++ b/bindings/python/src/sha1_hash.cpp @@ -2,10 +2,10 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include "boost_python.hpp" #include #include -#include "boost_python.hpp" #include "bytes.hpp" long get_hash(boost::python::object o) diff --git a/bindings/python/src/utility.cpp b/bindings/python/src/utility.cpp index 7f7dd53e4..11cc8bcee 100644 --- a/bindings/python/src/utility.cpp +++ b/bindings/python/src/utility.cpp @@ -2,9 +2,9 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include "boost_python.hpp" #include #include -#include "boost_python.hpp" #include "bytes.hpp" using namespace boost::python; diff --git a/bindings/python/src/version.cpp b/bindings/python/src/version.cpp index 42c377e3b..2e1a662de 100644 --- a/bindings/python/src/version.cpp +++ b/bindings/python/src/version.cpp @@ -2,8 +2,8 @@ // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include #include "boost_python.hpp" +#include using namespace boost::python; using lt::version; diff --git a/include/libtorrent/disk_interface.hpp b/include/libtorrent/disk_interface.hpp index 46a914987..7b3b03f08 100644 --- a/include/libtorrent/disk_interface.hpp +++ b/include/libtorrent/disk_interface.hpp @@ -59,12 +59,13 @@ namespace libtorrent { struct counters; struct settings_pack; struct storage_params; + struct storage_error; class file_storage; struct storage_holder; struct file_open_mode_tag; - using file_open_mode_t = flags::bitfield_flag; + using file_open_mode_t = flags::bitfield_flag; namespace file_open_mode { diff --git a/include/libtorrent/invariant_check.hpp b/include/libtorrent/invariant_check.hpp index 2960fbff8..6d3e43de6 100644 --- a/include/libtorrent/invariant_check.hpp +++ b/include/libtorrent/invariant_check.hpp @@ -7,7 +7,7 @@ #include "libtorrent/config.hpp" #include "libtorrent/assert.hpp" -#include "libtorrent/config.hpp" +#include #if TORRENT_USE_INVARIANT_CHECKS