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

Conversation

tchaikov
Copy link
Contributor

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

GCC-10 and Clang choke when compiling a concept constrained with
its template parameter, which is in turn another concept. as a
workaround of the bug of boost::asio, we should disable concepts
support in it. but it's nice to enable it when the compiler is
able to use concepts to do some compile time checkings even the
concepts are not compliant to C++20.

Signed-off-by: Kefu Chai <kchai@redhat.com>
`md_config_obs_t` is defined as
```
using md_config_obs_t = ceph::md_config_obs_impl<ConfigProxy>;
```
in `common/config_obs.h`. it takes advantage of a fact that
somebody exposes the correct version of `ConfigProxy` to the global
namespace. this is intended to fulfill the needs of other components
which expects `md_config_obs_t`. otherwise we need to specify
`ceph::md_config_obs_impl<ceph::ConfigProxy>` or
`ceph::md_config_obs_impl<crimson::common::ConfigProxy>` depending on
if we are programming crimson or not.

but in this case, we are actually defining
`crimson::common::ConfigProxy`, so it'd be better to define
`md_config_obs_t` explicitly instead relying on "somebody" which exposes
`ConfigProxy`. and `ConfigObserver` is defined using the current
`ConfigProxy`, so it's more correct and more readable than using
`md_config_obs_t` defined in `common/config_obs.h`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
@@ -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

if((CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) OR
(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)
      |                    ^~~~~~~~~~~~~~~~~~~~

@tchaikov
Copy link
Contributor Author

08:54:54 - DEBUG    - cbt      - Nodes : incerta08.front.sepia.ceph.com
08:54:55 - DEBUG    - cbt      - Nodes : incerta08.front.sepia.ceph.com
08:54:55 - DEBUG    - cbt      - Nodes : incerta08.front.sepia.ceph.com
08:54:55 - INFO     - cbt      - prefill/incerta08.front.sepia.ceph.com/0: bandwidth: (or (greater) (near 0.05)):: 12.7248/11.6416  => accepted
08:54:55 - INFO     - cbt      - prefill/incerta08.front.sepia.ceph.com/0: iops_avg: (or (greater) (near 0.05)):: 3257.0/2980.0  => accepted
08:54:55 - INFO     - cbt      - prefill/incerta08.front.sepia.ceph.com/0: iops_stddev: (or (less) (near 0.50)):: 141.811/103.645  => accepted
08:54:55 - INFO     - cbt      - prefill/incerta08.front.sepia.ceph.com/0: latency_avg: (or (less) (near 0.05)):: 0.00488458/0.0053503  => accepted
08:54:55 - INFO     - cbt      - prefill/incerta08.front.sepia.ceph.com/1: bandwidth: (or (greater) (near 0.05)):: 12.8532/11.68  => accepted
08:54:55 - INFO     - cbt      - prefill/incerta08.front.sepia.ceph.com/1: iops_avg: (or (greater) (near 0.05)):: 3290.0/2990.0  => accepted
08:54:55 - WARNING  - cbt      - prefill/incerta08.front.sepia.ceph.com/1: iops_stddev: (or (less) (near 0.50)):: 149.362/84.5931  => rejected
08:54:55 - INFO     - cbt      - prefill/incerta08.front.sepia.ceph.com/1: latency_avg: (or (less) (near 0.05)):: 0.004837/0.0052959  => accepted
08:54:55 - INFO     - cbt      - rand/incerta08.front.sepia.ceph.com/0: bandwidth: (or (greater) (near 0.05)):: 51.6698/52.2721  => accepted
08:54:55 - INFO     - cbt      - rand/incerta08.front.sepia.ceph.com/0: iops_avg: (or (greater) (near 0.05)):: 13227.0/13381.0  => accepted
08:54:55 - WARNING  - cbt      - rand/incerta08.front.sepia.ceph.com/0: iops_stddev: (or (less) (near 0.50)):: 1257.46/301.938  => rejected
08:54:55 - INFO     - cbt      - rand/incerta08.front.sepia.ceph.com/0: latency_avg: (or (less) (near 0.05)):: 0.00120223/0.00118742  => accepted
08:54:55 - INFO     - cbt      - rand/incerta08.front.sepia.ceph.com/1: bandwidth: (or (greater) (near 0.05)):: 51.5456/52.3964  => accepted
08:54:55 - INFO     - cbt      - rand/incerta08.front.sepia.ceph.com/1: iops_avg: (or (greater) (near 0.05)):: 13195.0/13413.0  => accepted
08:54:55 - WARNING  - cbt      - rand/incerta08.front.sepia.ceph.com/1: iops_stddev: (or (less) (near 0.50)):: 1287.33/353.148  => rejected
08:54:55 - INFO     - cbt      - rand/incerta08.front.sepia.ceph.com/1: latency_avg: (or (less) (near 0.05)):: 0.00120515/0.00118609  => accepted
08:54:55 - WARNING  - cbt      - 3 tests failed out of 16

@tchaikov tchaikov merged commit b3783bf into ceph:master Feb 12, 2020
@tchaikov tchaikov deleted the wip-crimson-misc branch February 12, 2020 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
2 participants