Kovri doesn't build with Boost 1.67
btolfa opened this issue · 4 comments
btolfa commented
By submitting this issue, I confirm the following:
- I have read and understood the contributor guide in kovri-docs.
- I have checked that the issue I am reporting can be replicated or that the feature I am suggesting is not present.
- I have checked opened or recently closed pull requests for existing solutions/implementations to my issue/suggestion.
Compilers throw the following errors:
MSVC
kovri\src\client\address_book\impl.cc(92): error C2440: '<function-style-cast>': cannot convert from 'kovri::client::AddressBookDefaults::SubscriberTimeout' to 'boost::posix_time::minutes'
kovri\src\client\address_book\impl.cc(94): note: No constructor could take the source type, or constructor overload resolution was ambiguous
clang
kovri\src\client\address_book\impl.cc(92): error: no matching conversion for functional-style cast from 'kovri::client::AddressBookDefaults' to 'boost::posix_time::minutes'
gcc
kovri\src\client\address_book\impl.cc(92): error: no matching function for call to 'boost::posix_time::minutes::minutes(kovri::client::AddressBookDefaults::SubscriberTimeout)'
btolfa commented
According to #842 (comment)
In the boost 1.67 the definition of boost::poxis_time::minutes
and similar classes changed from
class BOOST_SYMBOL_VISIBLE minutes : public time_duration
{
public:
explicit minutes(long m) :
time_duration(0,static_cast<min_type>(m),0)
{}
};
to
class BOOST_SYMBOL_VISIBLE minutes : public time_duration
{
public:
template <typename T>
explicit minutes(T const& m,
typename boost::enable_if<boost::is_integral<T>, void>::type* = 0) :
time_duration(0, numeric_cast<min_type>(m),0)
{}
};
These changes were done because
//
// Note about var_type, which is used to define the variable that
// stores hours, minutes, and seconds values:
//
// In Boost 1.65.1 and earlier var_type was boost::int32_t which suffers
// the year 2038 problem. Binary serialization of posix_time uses
// 32-bit values, and uses serialization version 0.
//
// In Boost 1.66.0 the var_type changed to std::time_t, however
// binary serialization was not properly versioned, so on platforms
// where std::time_t is 32-bits, it remains compatible, however on
// platforms where std::time_t is 64-bits, binary serialization ingest
// will be incompatible with previous versions. Furthermore, binary
// serialized output from 1.66.0 will not be compatible with future
// versions. Yes, it's a mess. Static assertions were not present
// in the serialization code to protect against this possibility.
//
// In Boost 1.67.0 the var_type was changed to boost::int64_t,
// ensuring the output size is 64 bits, and the serialization version
// was bumped. Static assertions were added as well, protecting
// future changes in this area.
The enum value causes SFINAE failure because
static_assert(<boost::is_integral<Enum>::value == false);
coneiric commented
btolfa commented
@coneiric The failure of buildbot/kovri-all-ubuntu-amd64 isn't caused by these changes or boost.
Assembler messages:
Fatal error: can't create CMakeFiles/kovri-util.dir/cpuid.cc.o: No such file or directory
src/util/CMakeFiles/kovri-util.dir/build.make:254: recipe for target 'src/util/CMakeFiles/kovri-util.dir/cpuid.cc.o' failed
Something is wrong with that buildbot.
Other builds which use boost 1.58 are green - buildbot/kovri-all-ubuntu-i686