Open tkapias opened 2 years ago
did some1 solved this issue?
i added a backshla infront of " \"
I tried building torrenttools and ran into the same issues as OP (currently it doesn't build anywhere, not on Debian, not on anything), but I tried fixing issue number 4 in file_matcher.hpp
This part errors out because fmt deprecated the _format function several versions ago.
I did some digging and tried to fix it having absolutely 0 experience in c++, and ended up with this
So,
std::string pattern = ".*.{}$"_format(extension);
becomes
std::string pattern = fmt::format(".*.{}$", extension);
Only now, I'm running into a new issue, with:
In file included from /usr/include/fmt/format.h:49,
from /home/tr4il/torrenttools/src/info.cpp:3:
/usr/include/fmt/core.h: In instantiation of ‘constexpr decltype (ctx.begin()) fmt::v10::detail::parse_format_specs(ParseContext&) [with T = dottorrent::announce_url; ParseContext = compile_parse_context<char>; decltype (ctx.begin()) = const char*]’:
/usr/include/fmt/core.h:2639:51: required from here
/home/tr4il/torrenttools/src/info.cpp:289:28: in ‘constexpr’ expansion of ‘fmt::v10::basic_format_string<char, long unsigned int, const dottorrent::announce_url&>(tracker_tier_entry)’
/usr/include/fmt/core.h:2740:40: in ‘constexpr’ expansion of ‘fmt::v10::detail::parse_format_string<true, char, format_string_checker<char, long unsigned int, dottorrent::announce_url> >(((fmt::v10::basic_format_string<char, long unsigned int, const dottorrent::announce_url&>*)this)->fmt::v10::basic_format_string<char, long unsigned int, const dottorrent::announce_url&>::str_, fmt::v10::detail::format_string_checker<char, long unsigned int, dottorrent::announce_url>(fmt::v10::basic_string_view<char>((* & s))))’
/usr/include/fmt/core.h:2489:44: in ‘constexpr’ expansion of ‘fmt::v10::detail::parse_replacement_field<char, format_string_checker<char, long unsigned int, dottorrent::announce_url>&>((p + -1), end, (* & handler))’
/usr/include/fmt/core.h:2457:33: in ‘constexpr’ expansion of ‘(& handler)->fmt::v10::detail::format_string_checker<char, long unsigned int, dottorrent::announce_url>::on_replacement_field((& handler)->fmt::v10::detail::format_string_checker<char, long unsigned int, dottorrent::announce_url>::on_arg_id(), begin)’
/usr/include/fmt/core.h:2632:20: in ‘constexpr’ expansion of ‘((fmt::v10::detail::format_string_checker<char, long unsigned int, dottorrent::announce_url>*)this)->fmt::v10::detail::format_string_checker<char, long unsigned int, dottorrent::announce_url>::on_format_specs(id, begin, begin)’
/usr/include/fmt/core.h:2548:45: error: ‘fmt::v10::detail::type_is_unformattable_for<dottorrent::announce_url, char> _’ has incomplete type
2548 | type_is_unformattable_for<T, char_type> _;
| ^
/usr/include/fmt/core.h: In instantiation of ‘constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&)[with bool PACKED = true; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; T = const dottorrent::announce_url; typename std::enable_if<PACKED, int>::type <anonymous> = 0]’:
/usr/include/fmt/core.h:1808:51: required from ‘constexpr fmt::v10::format_arg_store<Context, Args>::format_arg_store(T& ...) [with T = {long unsigned int, const dottorrent::announce_url}; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; Args = {long unsigned int, dottorrent::announce_url}]’
/usr/include/fmt/core.h:1826:18: required from ‘constexpr fmt::v10::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<T>::type>::type ...> fmt::v10::make_format_args(T& ...) [with Context = basic_format_context<appender, char>; T = {long unsigned int, const dottorrent::announce_url}]’
/usr/include/fmt/core.h:2788:44: required from ‘std::string fmt::v10::format(format_string<T ...>, T&& ...) [with T = {long unsigned int, const dottorrent::announce_url&}; std::string = std::__cxx11::basic_string<char>; format_string<T ...> = basic_format_string<char, long unsigned int, const dottorrent::announce_url&>]’
/home/tr4il/torrenttools/src/info.cpp:289:28: required from here
/usr/include/fmt/core.h:1576:63: error: ‘fmt::v10::detail::type_is_unformattable_for<const dottorrent::announce_url, char> _’ has incomplete type
1576 | type_is_unformattable_for<T, typename Context::char_type> _;
| ^
/usr/include/fmt/core.h:1580:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
1580 | formattable,
| ^~~~~~~~~~~
/usr/include/fmt/core.h:1580:7: note: ‘formattable’ evaluates to false
make[3]: *** [CMakeFiles/torrenttools.dir/build.make:216: CMakeFiles/torrenttools.dir/src/info.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:1092: CMakeFiles/torrenttools.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1099: CMakeFiles/torrenttools.dir/rule] Error 2
make: *** [Makefile:564: torrenttools] Error 2
Which, as far as I can find, is another fmt related error. But I can't figure this one out.
Apologies for the double post, but I did some more digging into this now seemingly dead project and there is also a develop branch. Using vcpkg, that builds just fine! So, for whoever is still interested, here's the steps, tested on Debian Bookworm and Ubuntu 22.04.
Install deps:
sudo apt install git cmake libstdc++-12-dev g++ libssl-dev autoconf automake libtool nasm libtbb-dev pkg-config autoconf libtool ninja-build
Clone vcpkg repo:
git clone https://github.com/Microsoft/vcpkg.git
Remember to insert the path to this folder later on
Run bootstrap script:
./vcpkg/bootstrap-vcpkg.sh
Clone torrenttools repo and checkout develop branch
git clone https://github.com/fbdtemme/torrenttools
cd torrenttools
git checkout develop
Prepare the build, don't forget the vcpkg path:
cmake -S . -B cmake-build-debug --preset linux-isal -DCMAKE_TOOLCHAIN_FILE=[VCPKG-PATH]/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -DTORRENTTOOLS_BUILD_TESTS=OFF
Build it.
cmake --build cmake-build-debug
Congratulations, your build should be in cmake-build-debug/Debug!
./torrenttools --version
torrenttools v0.7.0
Cryptographic backends: isa-l_crypto : 2.24.0 openssl : OpenSSL 3.0.11 19 Sep 2023
The current build fail at many steps.
I assume that Bencode recently changed it's master branch to main. But the torrentools makefile still search for a master tag in external/bencode.cmake:
GIT_TAG master
Then is fails because upstream errors with bencode compilation. I opened an issue about this upstream : Bencode: Build errors with deps and instructions
Then it fails because it does not find nlohmann/json.
Some compilation errors with a pattern in lines 50 & 65 of include/file_matcher.hpp :