Skip to content

enable c++20 - #45133

Merged
tchaikov merged 19 commits into
ceph:mainfrom
cbodley:wip-cxx20-fixes
Aug 1, 2022
Merged

tchaikov merged 19 commits into
ceph:mainfrom
cbodley:wip-cxx20-fixes

Conversation

@cbodley

@cbodley cbodley commented Feb 23, 2022 •

Copy link
Copy Markdown
Contributor

enable c++20 in cmake, use ubuntu's toolchain ppa to get gcc11 on focal, and fix lots of c++20 compilation issues

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • 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 cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@cbodley

cbodley commented Feb 23, 2022 •

Copy link
Copy Markdown
Contributor Author

the rgw/dbstore commit is from #45109

edit: merged and rebased

@cbodley

cbodley commented Feb 23, 2022

Copy link
Copy Markdown
Contributor Author

ok, jenkins is finding gcc11 on focal and can build c++20

'make check' identified some compilation errors WITH_SEASTAR that i haven't worked through yet

'ceph API tests' hit an error under s3select's use of boost/msm - that issue is tracked in https://tracker.ceph.com/issues/54265

@tchaikov

Copy link
Copy Markdown
Contributor

@cbodley great work! i created cbodley#4 to address some FTBFS down the road. probably we could merge some of them, it'd be nice if we could avoid using deprecated features.

@cbodley

cbodley commented Feb 28, 2022

Copy link
Copy Markdown
Contributor Author

tyvm @tchaikov! can i ask your assistance with the centos devtoolset piece? i see that we haven't been using that for centos 8, so i tried to reenable it for gcc 10

given the rpm: BuildRequires gcc-toolset-10-gcc-c++ >= 10.2 commit, i think we just need to reenable the centos-release-scl repos in ceph-build for shaman? i proposed a change for this and the ubuntu ppa in ceph/ceph-build#1971

@cbodley cbodley mentioned this pull request Mar 1, 2022
@tchaikov

tchaikov commented Mar 1, 2022 •

Copy link
Copy Markdown
Contributor

@cbodley created cbodley#5 to tackle more of the FTBFS.

also, just commented on ceph/ceph-build#1971.

@tchaikov

tchaikov commented Mar 2, 2022

Copy link
Copy Markdown
Contributor

@cbodley now that #45198 has been merged, i will rebase this PR ASAP.

@tchaikov

This comment was marked as resolved.

adamemerson and others added 8 commits July 30, 2022 13:02
Since it's a submodule.

Signed-off-by: Adam C. Emerson <[email protected]>
gcc-toolset-11-annobin is already installed, but ceph.spec.in adds
"-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" which needs the gcc
plugin too

resolves this failure during the cmake configure step:

-- Check for working CXX compiler: /opt/rh/gcc-toolset-11/root/usr/bin/c++
-- Check for working CXX compiler: /opt/rh/gcc-toolset-11/root/usr/bin/c++ - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:59 (message):
  The C++ compiler

    "/opt/rh/gcc-toolset-11/root/usr/bin/c++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos8/DIST/centos8/MACHINE_SIZE/gigantic/release/17.0.0-11497-gfae772b8/rpm/el8/BUILD/ceph-17.0.0-11497-gfae772b8/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_09421/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_09421.dir/build.make CMakeFiles/cmTC_09421.dir/build
    gmake[1]: Entering directory '/home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos8/DIST/centos8/MACHINE_SIZE/gigantic/release/17.0.0-11497-gfae772b8/rpm/el8/BUILD/ceph-17.0.0-11497-gfae772b8/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_09421.dir/testCXXCompiler.cxx.o
    /opt/rh/gcc-toolset-11/root/usr/bin/c++   -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection  -o CMakeFiles/cmTC_09421.dir/testCXXCompiler.cxx.o -c /home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos8/DIST/centos8/MACHINE_SIZE/gigantic/release/17.0.0-11497-gfae772b8/rpm/el8/BUILD/ceph-17.0.0-11497-gfae772b8/x86_64-redhat-linux-gnu/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    cc1plus: fatal error: inaccessible plugin file plugin/annobin.so expanded from short plugin name annobin: No such file or directory
    compilation terminated.

Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
since operator==() is now considered commutative in C++20, we can
make it a member function.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov force-pushed the wip-cxx20-fixes branch 3 times, most recently from 157c06b to cbddfd2 Compare July 30, 2022 06:27
older C++ compiler like GCC-9 does not rewrite operator==() so that
`a == b` implies `b == a`, in other words:
operator==(const LHS& lhs, const RHS& rhs) is equivalent to
operator==(const RHS& rhs, const LHS& lhs). see
section 1.2 in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0515r3.pdf

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov

Copy link
Copy Markdown
Contributor

jenkins test api

@tchaikov

tchaikov commented Jul 30, 2022 •

Copy link
Copy Markdown
Contributor

the C++17 compatible bits are extracted into #47367

to silence warning if compiled with -std=c++20:

src/osd/PG.h:571:7: warning: implicit capture of ‘this’ via ‘[=]’ is
deprecated in C++20 [-Wdeprecated]
  571 |       [=](auto &history, auto &stats) {
      |       ^

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov

Copy link
Copy Markdown
Contributor

jenkins test make check

1 similar comment
@tchaikov

Copy link
Copy Markdown
Contributor

jenkins test make check

@tchaikov

Copy link
Copy Markdown
Contributor

pending on ceph/ceph-build#1971

@tchaikov

Copy link
Copy Markdown
Contributor

@djgalloway seems we are adding https://download.ceph.com/debian-pacific focal Release as an apt source in some (if not all) test nodes for running jenkins "make check". this has two issues:

  1. it breaks the test API test. as the pacific python3-ceph-argparse is not compatible with the one in main. i manually removed this package on two test nodes, and the API test on them are back to normal.
  2. the "apt-get error" in the link is a new one.

see https://jenkins.ceph.com/job/ceph-pull-requests-arm64/30513/ . where is this repo added? can we avoid doing so at least on the test nodes?

@tchaikov tchaikov mentioned this pull request Jul 31, 2022
4 of 14 tasks
@djgalloway

Copy link
Copy Markdown
Contributor

@djgalloway seems we are adding https://download.ceph.com/debian-pacific focal Release as an apt source in some (if not all) test nodes for running jenkins "make check". this has two issues:

1. it breaks the test API test. as the pacific `python3-ceph-argparse` is not compatible with the one in main. i manually removed this package on two test nodes, and the API test on them are back to normal.

2. the "apt-get error" in the link is a new one.

see https://jenkins.ceph.com/job/ceph-pull-requests-arm64/30513/ . where is this repo added? can we avoid doing so at least on the test nodes?

Yeah that shouldn't be happening. I looked at omani001's build history and it appears the repo was added between

https://jenkins.ceph.com/job/ceph-pull-requests-arm64/30282/
and
https://jenkins.ceph.com/job/ceph-pull-requests-arm64/30291/

But neither of those jobs shows that repo being added...

It's been there forever though.

root@omani001:~# stat /etc/apt/sources.list.d/ceph.list 
  File: /etc/apt/sources.list.d/ceph.list
  Size: 57        	Blocks: 8          IO Block: 4096   regular file
Device: 802h/2050d	Inode: 11796809    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-08-01 02:04:50.726724637 -0400
Modify: 2021-07-15 22:00:02.545773892 -0400
Change: 2021-07-15 22:00:02.545773892 -0400
 Birth: -

I just rmed all ceph.list files on the builders.

@djgalloway

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@tchaikov

tchaikov commented Aug 1, 2022

Copy link
Copy Markdown
Contributor
E: Failed to fetch https://chacra.ceph.com/r/libboost/master/892ab89e76b91b505ffbf083f6fb7f2a666d4132/ubuntu/focal/flavors/default/dists/focal/main/binary-arm64/Packages  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 8.43.84.139 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.

weird .. i am able to read https://chacra.ceph.com/r/libboost/master/892ab89e76b91b505ffbf083f6fb7f2a666d4132/ubuntu/ with my web browser without the security warnings, something like certification expired.

@djgalloway

Copy link
Copy Markdown
Contributor

Just needed to reinstall ca-certificates 🤷‍♂️

Comment thread install-deps.sh
Comment on lines +422 to +424
--enable rhel-server-rhscl-8-rpms \
--enable rhel-8-server-optional-rpms \
--enable rhel-8-server-devtools-rpms

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

to my knowledge, these repos do not exist:

pdonnell@vossi04 ~/ceph$ ./install-deps.sh 
Using dnf to install dependencies
Updating Subscription Management repositories.
Last metadata expiration check: 0:03:16 ago on Mon 15 Aug 2022 05:02:19 PM UTC.
Package yum-utils-4.0.21-11.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Updating Subscription Management repositories.
Error: No matching repo to modify: rhel-8-server-devtools-rpms, rhel-server-rhscl-8-rpms, rhel-8-server-optional-rpms.

For rhel-server-rhscl-8-rpms, this should definitely not exist according to

https://access.redhat.com/support/policy/updates/rhscl

Starting with Red Hat Enterprise Linux 8, the content traditionally consumed via Software Collections is now part of Application Streams. Please see the Application Streams Life Cycle documentation for that release.

However, if I remove these repos from install-deps.sh, I get this:

CMake Error at src/CMakeLists.txt:119 (message):
C++20 support requires a minimum GCC version of 11.

This is on RHEL 8.6 (vossi04.front.sepia.ceph.com). I recently converted this machine from sepia's satellite to the RH CDN, following [1] at David Galloway's suggestion. Am I missing something?

[1] https://access.redhat.com/solutions/4525751

@cbodley cbodley Aug 15, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i accidentally reintroduced those rhel packages as part of a revert commit 65b1a13. i didn't have a way to test against rhel, sorry. i've raised #47609 to remove them

according to ceph.spec.in, rhel should be installing the same gcc-toolset-11 packages that centos 8 does

However, if I remove these repos from install-deps.sh, I get this:

install-deps.sh should be giving you a message like this:

Your GCC is too old. Please run following command to add DTS to your environment:

scl enable gcc-toolset-11 bash

Or add the following line to the end of ~/.bashrc and run "source ~/.bashrc" to add it permanently:

source scl_source enable gcc-toolset-11

do those steps work under rhel?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i accidentally reintroduced those rhel packages as part of a revert commit 65b1a13. i didn't have a way to test against rhel, sorry. i've raised #47609 to remove them

according to ceph.spec.in, rhel should be installing the same gcc-toolset-11 packages that centos 8 does

However, if I remove these repos from install-deps.sh, I get this:

install-deps.sh should be giving you a message like this:

Your GCC is too old. Please run following command to add DTS to your environment:
scl enable gcc-toolset-11 bash
Or add the following line to the end of ~/.bashrc and run "source ~/.bashrc" to add it permanently:
source scl_source enable gcc-toolset-11

do those steps work under rhel?

I did not get that message. Adding scl enable gcc-toolset-11 bash did the trick though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants