Compilation fails if opendht is already installed from Arch repos
Compiling ring-project (branch release/202001) while OpenDHT being already installed on Parabola GNU/Linux-libre (and probably also Arch and Arch-based distros) leads to this error:
make[4]: Leaving directory '/home/felline/Code/Compilation/ring-project/daemon/src/jamidht/eth/libdevcrypto'
make[4]: Entering directory '/home/felline/Code/Compilation/ring-project/daemon/src/jamidht'
CXX libringacc_la-jamiaccount.lo
CXX libringacc_la-server_account_manager.lo
CXX libringacc_la-namedirectory.lo
server_account_manager.cpp:23:10: fatal error: opendht/http.h: No such file or directory
23 | #include <opendht/http.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [Makefile:671: libringacc_la-server_account_manager.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
namedirectory.cpp:34:10: fatal error: opendht/http.h: No such file or directory
34 | #include <opendht/http.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [Makefile:678: libringacc_la-namedirectory.lo] Error 1
jamiaccount.cpp: In member function 'void jami::JamiAccount::doRegister_()':
jamiaccount.cpp:1673:16: error: 'struct dht::DhtRunner::Config' has no member named 'push_token'
1673 | config.push_token = deviceKey_;
| ^~~~~~~~~~
jamiaccount.cpp:1680:28: error: 'struct dht::DhtRunner::Config' has no member named 'push_token'
1680 | if (not config.push_token.empty()) {
| ^~~~~~~~~~
jamiaccount.cpp:1708:57: error: no match for 'operator=' (operand types are 'std::unique_ptr<dht::Logger>' and 'std::shared_ptr<dht::Logger>')
1708 | (dht_log_level > 2) ? log_debug : silent);
| ^
In file included from /usr/include/c++/9.3.0/memory:80,
from /home/felline/Code/Compilation/ring-project/daemon/src/security/tls_session.h:32,
from jamiaccount.h:29,
from jamiaccount.cpp:29:
/usr/include/c++/9.3.0/bits/unique_ptr.h:305:7: note: candidate: 'std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Tp, _Dp>&&) [with _Tp = dht::Logger; _Dp = std::default_delete<dht::Logger>]'
305 | operator=(unique_ptr&& __u) noexcept
| ^~~~~~~~
/usr/include/c++/9.3.0/bits/unique_ptr.h:305:30: note: no known conversion for argument 1 from 'std::shared_ptr<dht::Logger>' to 'std::unique_ptr<dht::Logger>&&'
305 | operator=(unique_ptr&& __u) noexcept
| ~~~~~~~~~~~~~^~~
/usr/include/c++/9.3.0/bits/unique_ptr.h:325:2: note: candidate: 'template<class _Up, class _Ep> typename std::enable_if<std::__and_<std::__and_<std::is_convertible<typename std::unique_ptr<_Up, _Ep>::pointer, typename std::__uniq_ptr_impl<_Tp, _Dp>::pointer>, std::__not_<std::is_array<_Up> > >, std::is_assignable<_T2&, _U2&&> >::value, std::unique_ptr<_Tp, _Dp>&>::type std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Up = _Up; _Ep = _Ep; _Tp = dht::Logger; _Dp = std::default_delete<dht::Logger>]'
325 | operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
| ^~~~~~~~
/usr/include/c++/9.3.0/bits/unique_ptr.h:325:2: note: template argument deduction/substitution failed:
jamiaccount.cpp:1708:57: note: 'std::shared_ptr<dht::Logger>' is not derived from 'std::unique_ptr<_Tp, _Dp>'
1708 | (dht_log_level > 2) ? log_debug : silent);
| ^
In file included from /usr/include/c++/9.3.0/memory:80,
from /home/felline/Code/Compilation/ring-project/daemon/src/security/tls_session.h:32,
from jamiaccount.h:29,
from jamiaccount.cpp:29:
/usr/include/c++/9.3.0/bits/unique_ptr.h:334:7: note: candidate: 'std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::nullptr_t) [with _Tp = dht::Logger; _Dp = std::default_delete<dht::Logger>; std::nullptr_t = std::nullptr_t]'
334 | operator=(nullptr_t) noexcept
| ^~~~~~~~
/usr/include/c++/9.3.0/bits/unique_ptr.h:334:17: note: no known conversion for argument 1 from 'std::shared_ptr<dht::Logger>' to 'std::nullptr_t'
334 | operator=(nullptr_t) noexcept
| ^~~~~~~~~
make[4]: *** [Makefile:622: libringacc_la-jamiaccount.lo] Error 1
make[4]: Leaving directory '/home/felline/Code/Compilation/ring-project/daemon/src/jamidht'
make[3]: *** [Makefile:721: all-recursive] Error 1
make[3]: Leaving directory '/home/felline/Code/Compilation/ring-project/daemon/src/jamidht'
make[2]: *** [Makefile:1027: all-recursive] Error 1
make[2]: Leaving directory '/home/felline/Code/Compilation/ring-project/daemon/src'
make[1]: *** [Makefile:528: all-recursive] Error 1
make[1]: Leaving directory '/home/felline/Code/Compilation/ring-project/daemon'
make: *** [Makefile:459: all] Error 2
Traceback (most recent call last):
File "./make-ring.py", line 528, in <module>
main()
File "./make-ring.py", line 515, in main
run_install(parsed_args)
File "./make-ring.py", line 322, in run_install
return subprocess.run(["./scripts/install.sh"] + install_args, env=environ, check=True)
File "/usr/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['./scripts/install.sh', '-p', '16', '-c', 'client-gnome']' returned non-zero exit status 2.
Uninstalling community/opendht 1:1.10.1-4
and running again make-ring.py
solves the problem.
This should either be explained in the documentation, or automatically managed by make-ring.py --dependencies
.