Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crimson: fix build with GCC-10 #33233

Merged
merged 2 commits into from Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/crimson/CMakeLists.txt
@@ -1,6 +1,13 @@
add_library(crimson::cflags INTERFACE IMPORTED)
set(crimson_cflag_definitions "WITH_SEASTAR=1")
# disable concepts to address https://github.com/boostorg/asio/issues/312
if((CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) OR
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for those who are interested in a minimal reproducer, see https://www.godbolt.org/z/6igCM2

(CMAKE_CXX_COMPILER_ID STREQUAL Clang))
list(APPEND crimson_cflag_definitions
"BOOST_ASIO_DISABLE_CONCEPTS")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, we don't plan to use ASIO, so I'm not afraid about disabling concepts there (and forgetting to re-enable when the bug gets fixed).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's Graylog.h which pulls boost::asio headers in. i tried to avoid using the all-in-one convenient header of boost/asio.hpp , but no luck:

In file included from /opt/ceph/include/boost/asio/basic_socket.hpp:19,
                 from /opt/ceph/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /opt/ceph/include/boost/asio/ip/udp.hpp:19,
                 from ../src/common/Graylog.h:7,
                 from ../src/common/ceph_context.cc:36:
/opt/ceph/include/boost/asio/async_result.hpp:70:20: error: a variable concept cannot be constrained
   70 | BOOST_ASIO_CONCEPT completion_handler_for =
      |                    ^~~~~~~~~~~~~~~~~~~~~~
/opt/ceph/include/boost/asio/async_result.hpp:492:20: error: a variable concept cannot be constrained
  492 | BOOST_ASIO_CONCEPT completion_token_for = requires(T&& t)
      |                    ^~~~~~~~~~~~~~~~~~~~

endif()
set_target_properties(crimson::cflags PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "WITH_SEASTAR=1"
INTERFACE_COMPILE_DEFINITIONS "${crimson_cflag_definitions}"
INTERFACE_LINK_LIBRARIES Seastar::seastar)

set(crimson_common_srcs
Expand Down
7 changes: 3 additions & 4 deletions src/crimson/common/config_proxy.h
Expand Up @@ -67,10 +67,9 @@ class ConfigProxy : public seastar::peering_sharded_service<ConfigProxy>

ObserverMgr<ConfigObserver>::rev_obs_map rev_obs;
proxy.obs_mgr.for_each_change(proxy.values->changed, proxy,
[&rev_obs](md_config_obs_t *obs,
const std::string &key) {
rev_obs[obs].insert(key);
}, nullptr);
[&rev_obs](ConfigObserver *obs, const std::string& key) {
rev_obs[obs].insert(key);
}, nullptr);
for (auto& obs_keys : rev_obs) {
obs_keys.first->handle_conf_change(proxy, obs_keys.second);
}
Expand Down