Fedora Account System
Red Hat Associate
Red Hat Customer
Created attachment 1391605 [details] compile errors Description of problem: I have FTBFS mongodb error in Fedora Rawhide (now combined with unresolvable dependencies error). Based on koschei information [1] I think this problem is caused by gcc 8 update. Error is in bundled asio library. I can see similar error messages: src/third_party/asio-master/asio/include/asio/basic_socket_streambuf.hpp:463:15: error: ambiguous overload for 'operator!=' (operand types are 'asio::error_code' {aka 'std::error_code'} and 'asio::error::basic_errors') if (ec_ != asio::error::would_block ~~~~^~~~~~~ /usr/include/c++/8/system_error:319:3: note: candidate: 'bool std::operator!=(const std::error_code&, const std::error_code&)' operator!=(const error_code& __lhs, const error_code& __rhs) noexcept ^~~~~~~~ /usr/include/c++/8/system_error:323:3: note: candidate: 'bool std::operator!=(const std::error_code&, const std::error_condition&)' operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept ^~~~~~~~ /usr/include/c++/8/system_error:327:3: note: candidate: 'bool std::operator!=(const std::error_condition&, const std::error_code&)' operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept ^~~~~~~~ /usr/include/c++/8/system_error:331:3: note: candidate: 'bool std::operator!=(const std::error_condition&, const std::error_condition&)' operator!=(const error_condition& __lhs, ^~~~~~~~ But code below is defined and is_error_condition_enum isn't defined! namespace std { template<> struct is_error_code_enum<asio::error::basic_errors> { static const bool value = true; }; } Used asio code can be browsed in [2]. IMHO related code is in asio/include/asio/error_code.hpp and asio/include/asio/error.hpp (ASIO_HAS_STD_SYSTEM_ERROR is defined). I was trying to separate a reproducer, but I wasn't successful. What's wrong? What changed in gcc8? Version-Release number of selected component (if applicable): gcc-c++-8.0.1-0.9.fc28.x86_64 libstdc++-8.0.1-0.9.fc28.x86_64 How reproducible: Always in Fedora Rawhide when building mongodb package. Steps to Reproduce: 1. 'fedpkg prep' for mongodb package (master branch in rawhide OS) 2. dnf builddep for mongodb 3. in unpacked source run 'scons-3 build/fedora/mongo/executor/network_interface_asio_operation.o $(cat build-options)' Actual results: In attached log. Expected results: No 'error: ambiguous overload for 'operator!='' Additional info: [1] https://apps.fedoraproject.org/koschei/package/mongodb?collection=f28 check from 2018-01-30 11:44:02 [2] https://github.com/mongodb/mongo/tree/v3.6/src/third_party/asio-master
Any idea how to workaround this?
Reduced: #include <system_error> namespace asio { namespace error { struct basic_errors { }; std::error_code make_error_code(basic_errors); } } namespace std { template<> struct is_error_code_enum<asio::error::basic_errors> : true_type { }; } template<typename> struct Y { }; template<typename T> struct X : Y<T> { void f() { std::error_code ec; asio::error::basic_errors err; ec == err; } }; This is the same GCC bug as Bug 1542254 and I don't know a workaround.
This has now been fixed upstream, so should get fixed next time GCC is updated in rawhide.
Jonathan, thanks for solving this problem. It is fixed in gcc-8.0.1-0.13.fc28.