Skip to content

build: bump gcc version from 11->12#58384

Closed
cbodley wants to merge 6 commits intoceph:mainfrom
cbodley:wip-gcc-12
Closed

build: bump gcc version from 11->12#58384
cbodley wants to merge 6 commits intoceph:mainfrom
cbodley:wip-gcc-12

Conversation

@cbodley
Copy link
Contributor

@cbodley cbodley commented Jul 1, 2024

pushing a draft to see what breaks

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
  • jenkins test windows
  • jenkins test rook e2e

%if 0%{?enable_devtoolset11:1}
%enable_devtoolset11
%if 0%{?enable_devtoolset12:1}
%enable_devtoolset12
Copy link
Contributor

@tchaikov tchaikov Jul 1, 2024

Choose a reason for hiding this comment

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

where do we install gts-12? if we can assume gcc >=12 is available, we might want to drop this line.

Copy link
Contributor

Choose a reason for hiding this comment

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

okay. assuming we have the corresponding macro installed, we should have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think we'd expect install-deps.sh or ceph-build to install this where necessary

without ceph-build changes, i think it'll be hard to actually test this in ci

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tchaikov can you help me understand what installs gts-13 for #55886?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nevermind; setting gts_version=12 above causes us to install gcc-toolset-%{gts_version}-build which apparently makes this %enable_devtoolset12 thing available

i see that working for the rpm builds in https://shaman.ceph.com/builds/ceph/wip-gcc-12/1b854c2b0aaaebb77f92763f72bc7dff83166319/

@adamemerson
Copy link
Contributor

jenkins test make check arm64

@adamemerson
Copy link
Contributor

I'd really like to advocate strongly That we stop using Clang for make check. Clang 14 in particular rejects valid code that comparable GCC and later Clang don't, and I don't think the advantage in warnings exists against newer GCCs.

@cbodley
Copy link
Contributor Author

cbodley commented Jul 2, 2024

I don't think the advantage in warnings exists against newer GCCs

how new are we talking? does gcc 12 qualify?

I'd really like to advocate strongly That we stop using Clang for make check.

warnings aside, i think 'make check' would provide more value if it ran unit tests produced by the same toolchain that we're using for our release builds

i like the idea of having clang coverage too, as long as we keep the clang version up to date

if we had unlimited resources, i'd also take a matrix of builds for every gcc version we're trying to support

@adamemerson
Copy link
Contributor

I don't think the advantage in warnings exists against newer GCCs

how new are we talking? does gcc 12 qualify?

Just that in general I've noticed that GCC seems to pick up Clang's warnings a release or two after Clang comes out with them.

I'd really like to advocate strongly That we stop using Clang for make check.

warnings aside, i think 'make check' would provide more value if it ran unit tests produced by the same toolchain that we're using for our release builds

I'd agree with that, too.

i like the idea of having clang coverage too, as long as we keep the clang version up to date

if we had unlimited resources, i'd also take a matrix of builds for every gcc version we're trying to support

@tchaikov
Copy link
Contributor

tchaikov commented Jul 2, 2024

I'd really like to advocate strongly That we stop using Clang for make check.

the reason why we switched to Clang for running make check was that it was more picky. and was able to surface some potential issues that GCC couldn't. and its error messages were more readable sometimes.

Clang 14 in particular rejects valid code that comparable GCC and later Clang don't, and I don't think the advantage in warnings exists against newer GCCs.

probably it's time to use a newer Clang, like Clang-18?

@ronen-fr
Copy link
Contributor

ronen-fr commented Jul 4, 2024

Clang 14 in particular rejects valid code that comparable GCC and later Clang don't, and I don't think the advantage in warnings exists against newer GCCs.

probably it's time to use a newer Clang, like Clang-18?

I would really like to use C++ ranges in our code. And - if using libstd++ - 'ranges' should not be used with Clang < 16.
See for example NVIDIA/stdexec#1003.
I now have a valid PR that does not pass CI because of that bug in the old Clang used.

All in all - I really hope we keep Clang in the CI (as otherwise Ceph will 'drift' from being compilable by it). But we should upgrade it now.

@cbodley
Copy link
Contributor Author

cbodley commented Jul 4, 2024

probably it's time to use a newer Clang, like Clang-18?

for reference, this mostly just means the jenkins builders need a newer clang installed. for 'make check', src/script/lib-build.sh will use the newest version it finds (though that only checks up to 17)

these checks run on ubuntu jammy, and i see that jammy only has clang versions up to clang-15

it's probably time to start adding support for ubuntu 24.04 in the lab (jenkins builders, teuthology workers, etc). that goes up to clang-18

@cbodley
Copy link
Contributor Author

cbodley commented Jul 4, 2024

p.s. these clang builds still use libstdc++, so our gcc version matters a lot too when it comes to library features like ranges

@ronen-fr
Copy link
Contributor

ronen-fr commented Jul 5, 2024

these checks run on ubuntu jammy, and i see that jammy only has clang versions up to clang-15

there seem to be Clang 16 packages available for Jammy. Can we use the scripts that run as part of the CI process to install packages (i.e. - without having to recreate the images?)?

@tchaikov
Copy link
Contributor

tchaikov commented Jul 5, 2024

@ronen-fr we also need to find a ppa for jammy for installing newer libstdc++. probably https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test ?

cbodley added 3 commits July 26, 2024 17:21
require gcc >= 12 and rely on gcc-toolset-12 by default to provide it

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley
Copy link
Contributor Author

cbodley commented Jul 29, 2024

CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
...
/usr/bin/ld: cannot find -lstdc++: No such file or directory

this branch seems to have broken the clang 'make check' (for all pull requests, not just this one). i opened https://tracker.ceph.com/issues/67233 to track this

@cbodley
Copy link
Contributor Author

cbodley commented Jul 30, 2024

@petrutlucian94 could i ask your help getting windows tests to use gcc-12? i have the script installing g++-12 but it's not found by cmake (although gcc-12 is)

-- The CXX compiler identification is unknown
-- The C compiler identification is GNU 12.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/gcc-12
CMake Error at CMakeLists.txt:3 (project):
  The CMAKE_CXX_COMPILER:

    g++-12

  is not a full path and was not found in the PATH.

sudo apt-get update
sudo env DEBIAN_FRONTEND=noninteractive apt-get -y install \
mingw-w64 g++ cmake pkg-config \
mingw-w64 g++-12 cmake pkg-config \
Copy link
Contributor

@tchaikov tchaikov Jul 30, 2024

Choose a reason for hiding this comment

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

probably should install g++-mingw-w64 instead ? but i think we need to upgrade the jenkins work node to ubuntu/noble first for accessing g++ >= 12. as ubuntu/noble is the first stable release which provides the mingw tool chain with g++ >= 12. see https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=g%2B%2B-mingw-w64&searchon=names

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, we're building the Windows binaries using mingw-llvm:

https://github.com/ceph/ceph/blob/81a258352afcf376d4237dcd9dab6bb54d5fd6cc/win32_deps_build.sh#L43C15-L44

ceph/mingw_conf.sh

Lines 36 to 53 in 81a2583

if [[ -n $USE_MINGW_LLVM ]]; then
# This package isn't currently provided by Linux distributions, we're
# fetching it from Github.
export PATH="$MINGW_LLVM_DIR/bin:$PATH"
mingwPosix=""
mingwVersion="$(${MINGW_CPP}${mingwPosix} -dumpversion)"
mingwX64IncludeDir="$MINGW_LLVM_DIR/x86_64-w64-mingw32/include"
mingwX64BinDir="$MINGW_LLVM_DIR/x86_64-w64-mingw32/bin"
mingwX64LibDir="$MINGW_LLVM_DIR/x86_64-w64-mingw32/lib"
mingwTargetLibDir="$mingwX64BinDir"
mingwLibpthreadDir="$mingwX64BinDir"
PTW32Include="$mingwX64IncludeDir"
PTW32Lib="$mingwX64LibDir"
MINGW_CC="${MINGW_BASE}-clang${mingwPosix}"
MINGW_CXX="${MINGW_BASE}-clang++${mingwPosix}"
MINGW_FIND_ROOT_PATH="$MINGW_LLVM_DIR/x86_64-w64-mingw32"

We're using just a few tools from the mingw-w64 package, including dlltool if I remember correctly.

For what is worth, we had lots of problems with mingw-gcc, expecially around winpthreads, which is why we had to switch to mingw-llvm: 3ce1e4a

Copy link
Contributor

Choose a reason for hiding this comment

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

About the Windows CI job: it builds both Windows and Linux binaries and it seems that the Windows build actually passes:

https://jenkins.ceph.com/job/ceph-windows-pull-requests/44528/consoleFull

  WIN32 files zipped to: /home/ubuntu/ceph.zip


real	42m33.561s
user	0m0.305s
sys	0m0.476s

It's the Linux build that fails: https://github.com/ceph/ceph-build/blob/e8d18c7aef15fa0424d096ba73a6e0d701a5215a/scripts/ceph-windows/setup_ceph_vstart#L31-L41

Copy link
Contributor

Choose a reason for hiding this comment

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

Since everything is running in a VM, I think all we have to do is to switch the Ubuntu image to 24.04: https://github.com/ceph/ceph-build/blob/e8d18c7aef15fa0424d096ba73a6e0d701a5215a/scripts/ceph-windows/setup_libvirt_ubuntu_vm#L12

@cbodley cbodley mentioned this pull request Jul 31, 2024
14 tasks
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@cbodley
Copy link
Contributor Author

cbodley commented Jul 31, 2024

closing this for now so it stops breaking 'make check' on other prs

@cbodley cbodley closed this Jul 31, 2024
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