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

circleci: build with C++20 modules enabled #1998

Merged
merged 4 commits into from
Dec 30, 2023

Conversation

tchaikov
Copy link
Contributor

add one more build with the combination of "clang++17", C++20, debug with C++20 modules enabled. so that we can at least test with C++20 modules build without doubling the size of the test matrix.

@tchaikov tchaikov marked this pull request as draft December 11, 2023 12:00
@tchaikov
Copy link
Contributor Author

FAILED: src/CMakeFiles/seastar-module.dir/core/alien.cc.o.ddi 
"CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND" -format=p1689 -- /usr/bin/clang++-17 -DBOOST_NO_CXX98_FUNCTION_BASE -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_COROUTINES_ENABLED -DSEASTAR_MODULE -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_SSTRING -Dseastar_module_EXPORTS -I/home/circleci/project/include -I/home/circleci/project/build/debug/gen/include -I/home/circleci/project/src -g -std=c++20 -fPIC -U_FORTIFY_SOURCE -x c++ /home/circleci/project/src/core/alien.cc -c -o src/CMakeFiles/seastar-module.dir/core/alien.cc.o -MT src/CMakeFiles/seastar-module.dir/core/alien.cc.o.ddi -MD -MF src/CMakeFiles/seastar-module.dir/core/alien.cc.o.ddi.d > src/CMakeFiles/seastar-module.dir/core/alien.cc.o.ddi
/bin/sh: 1: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND: not found

@tchaikov
Copy link
Contributor Author

CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS

should be fixed by #1999

@tchaikov tchaikov added the build build system label Dec 11, 2023
@tchaikov tchaikov force-pushed the ci-with-cxx-modules branch from f3e58db to 603ab3d Compare December 29, 2023 01:02
@tchaikov tchaikov marked this pull request as ready for review December 29, 2023 01:03
@tchaikov tchaikov force-pushed the ci-with-cxx-modules branch 4 times, most recently from 4a26418 to 98d2e18 Compare December 29, 2023 01:29
@tchaikov

This comment was marked as resolved.

@tchaikov tchaikov force-pushed the ci-with-cxx-modules branch 3 times, most recently from 4f074bb to 6354c11 Compare December 29, 2023 03:34
@tchaikov
Copy link
Contributor Author

tchaikov commented Dec 29, 2023

@avikivity hi Avi, thank you for updating the build image. with which, this change is able to build. but in order to address the build failures when building the seastar module, more fixes are needed. i am including them in this changeset. if you think we should have them in separated PR(s), i am happy to extract them out.

in 6bdef1e, Crypto++ was dropped
in favor of GnuTLS, but we failed to update seastar.cc to include
the gnutls/crypto.h.
also, <compare> is used in the implementation.
when compiling seastar C++20 module, all global headers should be
included in seastar.cc.

so, in this change, the used headers are included.

see aa1c8b3.

Signed-off-by: Kefu Chai <[email protected]>
include the header before it is "tainted" by the building environment, to
avoid the warning like:

```
FAILED: src/CMakeFiles/seastar-module.dir/core/alien.cc.o
/usr/bin/clang++-17 -DBOOST_NO_CXX98_FUNCTION_BASE -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_COROUTINES_ENABLED -DSEASTAR_MODULE -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_SSTRING -Dseastar_module_EXPORTS -I/home/circleci/project/include -I/home/circleci/project/build/debug/gen/include -I/home/circleci/project/src -g -std=c++20 -fPIC -U_FORTIFY_SOURCE -MD -MT src/CMakeFiles/seastar-module.dir/core/alien.cc.o -MF src/CMakeFiles/seastar-module.dir/core/alien.cc.o.d @src/CMakeFiles/seastar-module.dir/core/alien.cc.o.modmap -o src/CMakeFiles/seastar-module.dir/core/alien.cc.o -c /home/circleci/project/src/core/alien.cc
In module 'seastar' imported from /home/circleci/project/src/core/alien.cc:33:
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/compare:398:22: error: 'std::__detail::__common_cmp_cat' has different definitions in different modules; definition in module 'seastar.<global>' first difference is function body
  398 |       constexpr auto __common_cmp_cat()
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
  399 |       {
      |       ~
  400 |         constexpr unsigned __cats = (__cmp_cat_id<_Ts> | ...);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  401 |         // If any Ti is not a comparison category type, U is void.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  402 |         if constexpr (__cats & 1)
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~
  403 |           return;
      |           ~~~~~~~
  404 |         // Otherwise, if at least one Ti is std::partial_ordering,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  405 |         // U is std::partial_ordering.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  406 |         else if constexpr (bool(__cats & __cmp_cat_id<partial_ordering>))
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  407 |           return partial_ordering::equivalent;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  408 |         // Otherwise, if at least one Ti is std::weak_ordering,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  409 |         // U is std::weak_ordering.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  410 |         else if constexpr (bool(__cats & __cmp_cat_id<weak_ordering>))
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  411 |           return weak_ordering::equivalent;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  412 |         // Otherwise, U is std::strong_ordering.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  413 |         else
      |         ~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/compare:398:22: note: but in '' found a different body
  398 |       constexpr auto __common_cmp_cat()
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
  399 |       {
      |       ~
  400 |         constexpr unsigned __cats = (__cmp_cat_id<_Ts> | ...);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  401 |         // If any Ti is not a comparison category type, U is void.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  402 |         if constexpr (__cats & 1)
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~
  403 |           return;
      |           ~~~~~~~
  404 |         // Otherwise, if at least one Ti is std::partial_ordering,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  405 |         // U is std::partial_ordering.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  406 |         else if constexpr (bool(__cats & __cmp_cat_id<partial_ordering>))
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  407 |           return partial_ordering::equivalent;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  408 |         // Otherwise, if at least one Ti is std::weak_ordering,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  409 |         // U is std::weak_ordering.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  410 |         else if constexpr (bool(__cats & __cmp_cat_id<weak_ordering>))
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  411 |           return weak_ordering::equivalent;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  412 |         // Otherwise, U is std::strong_ordering.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  413 |         else
      |         ~~~~
1 error generated.
```

Signed-off-by: Kefu Chai <[email protected]>
in 6bdef1e, Crypto++ was dropped,
and later the updated build image removed it as well. but it still
exists in seastar.cc and src/CMakeLists.txt, let's drop them as well.

Signed-off-by: Kefu Chai <[email protected]>
add one more build with the combination of "clang++17", C++20, debug
with C++20 modules enabled. so that we can at least test with C++20
modules build without doubling the size of the test matrix.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov tchaikov force-pushed the ci-with-cxx-modules branch from 6354c11 to 6bc4db7 Compare December 29, 2023 05:51
@avikivity avikivity merged commit 5d86bac into scylladb:master Dec 30, 2023
14 checks passed
graphcareful pushed a commit to graphcareful/seastar that referenced this pull request Mar 20, 2024
add one more build with the combination of "clang++17", C++20, debug with C++20 modules enabled. so that we can at least test with C++20 modules build without doubling the size of the test matrix.

Closes scylladb#1998

* github.com:scylladb/seastar:
  circleci: build with C++20 modules enabled
  seastar.cc: replace cryptopp with gnutls when building seastar modules
  alien: include used header
  seastar.cc: include used headers in the global purview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants