opentelemetry-cpp icon indicating copy to clipboard operation
opentelemetry-cpp copied to clipboard

[CI] Upgrade to a newer version of clang-format

Open marcalff opened this issue 11 months ago • 8 comments

To Discuss:

  • which version of clang-format to use
  • fix docker images accordingly (including cpp-build-tools)

marcalff avatar Mar 06 '24 17:03 marcalff

SIG meeting 03.11.2024: default clang-format from Ubuntu 24.04 will be used.

esigo avatar Mar 11 '24 20:03 esigo

Per the github runner images:

https://github.com/actions/runner-images/blob/ubuntu22/20240414.1/images/ubuntu/Ubuntu2204-Readme.md

Available versions in Ubuntu ~24.04~ 22.04 are: Clang-format: 13.0.1, 14.0.0, 15.0.7

I suggest to use Clang-format 15, as it will be available longer than 13 and 14 on this platform, saving another upgrade.

marcalff avatar Apr 22 '24 14:04 marcalff

A quick look into the ubuntu24.04 docker image (of dev-brach) shows below versions

root@3d32d77d0cd2:/# cat /etc/os-release  | grep VERSION
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
root@3d32d77d0cd2:/# apt-cache search clang-format
clang-format - Tool to format C/C++/Obj-C code
clang-format-14 - Tool to format C/C++/Obj-C code
clang-format-15 - Tool to format C/C++/Obj-C code
clang-format-16 - Tool to format C/C++/Obj-C code
clang-format-17 - Tool to format C/C++/Obj-C code
clang-format-18 - Tool to format C/C++/Obj-C code
libcode-tidyall-plugin-clangformat-perl - module to run clang-format using Code::TidyAll
$

I don't know if the runner images would have different versions of clang supported from that of docker images. But going with the pattern of supporting last 3 stable releases of clang, it could eventually be 16, 17 and 18.

lalitb avatar Apr 22 '24 16:04 lalitb

A quick look into the ubuntu24.04 docker image (of dev-brach) shows below versions

root@3d32d77d0cd2:/# cat /etc/os-release  | grep VERSION
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
root@3d32d77d0cd2:/# apt-cache search clang-format
clang-format - Tool to format C/C++/Obj-C code
clang-format-14 - Tool to format C/C++/Obj-C code
clang-format-15 - Tool to format C/C++/Obj-C code
clang-format-16 - Tool to format C/C++/Obj-C code
clang-format-17 - Tool to format C/C++/Obj-C code
clang-format-18 - Tool to format C/C++/Obj-C code
libcode-tidyall-plugin-clangformat-perl - module to run clang-format using Code::TidyAll
$

I don't know if the runner images would have different versions of clang supported from that of docker images. But going with the pattern of supporting last 3 stable releases of clang, it could eventually be 16, 17 and 18.

I made a typo in my previous comment, now fixed: the latest ubuntu available as a runner image in github is 22.04, not 24.04.

So, the most up to date version we can use now is clang-format 15.

Of course, by the time the runner upgrades to 24.04, we can upgrade clang-format as well if we want to.

marcalff avatar Apr 22 '24 18:04 marcalff

Of course, by the time the runner upgrades to 24.04, we can upgrade clang-format as well if we want to.

ubuntu 24.04 is planned to be released on 25th April. I think we can wait for that. https://www.omgubuntu.co.uk/2023/10/ubuntu-24-04-release-date-set-for-april-25-2024

lalitb avatar Apr 22 '24 18:04 lalitb

Related:

  • https://github.com/actions/runner-images/issues/9691

We sure can wait for April 25, 2024, but will the runner be available in github then ? Most likely not.

marcalff avatar Apr 22 '24 18:04 marcalff

Probably we can wait till 25th April to see if clang-format-15 is available in 24.04. If it is available, our decision would be easy to go with the upgrade immediately within 22.04 itself. 22.04 was added as runner on Aug 9th, so it could be the similar timeline for 24.04.

lalitb avatar Apr 22 '24 18:04 lalitb

Reopen: the docker image is updated, but we still need to run clang-format-18 on opentelemetry-cpp.

marcalff avatar May 27 '24 10:05 marcalff