kvrocks
kvrocks copied to clipboard
use clang-16 && gcc-13 to build
Search before asking
- [X] I had searched in the issues and found no similar issues.
Motivation
This issue has a request to use clang-16
and gcc-13
to build docker images or cmakelists.txt
in local developing environment and use clang-tidy-16
and clang-format-16
to correct code formattings.
Solution
No response
Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
@infdahai Does the Ubuntu 20.04 have clang-16 in its repository?
No. clang-10
is the default version in ubuntu 20.04
.
I see the kvrocks.yaml file uses ubuntu-22.04
and this distro supports clang-15
. So I just ask this.
I have been using GCC 13 to build kvrocks for a long time and haven't encountered any issues so far.
Getting GCC 13 or Clang 16 in CI may require manual download and installation, but I don't object to adding new compiler builds in CI (currently, the default versions of GCC and Clang in both ubuntu 20 LTS and ubuntu 22 LTS are used in CI, refer to https://github.com/actions/runner-images).
for clang-16, we can refer to
https://github.com/MikePopoloski/slang/blob/385e8e3a666551416fe76fcd9f0d6f0ba845b9bc/.github/workflows/build.yml#L40-L46
or execute the shell script.
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
sudo apt-get install -y clang-tidy-16
But I havn't found a vaild example for gcc-13. What do you think @PragmaTwice or just pend for this?
for clang-16, we can refer to
https://github.com/MikePopoloski/slang/blob/385e8e3a666551416fe76fcd9f0d6f0ba845b9bc/.github/workflows/build.yml#L40-L46
or execute the shell script.
wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 16 sudo apt-get install -y clang-tidy-16
But I havn't found a vaild example for gcc-13. What do you think @PragmaTwice or just pend for this?
For gcc-13 we can add a PPA for ubuntu, refer to https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa .
BTW I am not a ubuntu user : )
I was suggested to add a blank line at the end of the code when I submitted a PR, but now there are no rules for clang-format. I learned that the rule InsertNewlineAtEOF
is supported in clang-format 16. Is it possible to update the clang-format version and add this rule?
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#insertnewlineateof