-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Developer Productivity
-
5
-
2023-02-23 "Stoney Baloney", 2023-06-27 Lord of the Sprints, 2023-07-11 WiredTractor, StorEng - 2023-08-08
-
v7.0, v6.0, v5.0
MongoDB has just aligned its code with Clang-Format 12.0.1, let's do the same.
To do so we'll make the following 12.0.1 clang-format binaries available for download in the download_clang_format of s_clang_format:
- x86 Linux
- ARM Linux
- x86 macOS
- ARM macOS
Details for how to do this can be found in the comments of s_clang_format, and a recent example is present in WT-11092. I didn't notice any macOS/darwin binaries on the release page however, so we may need to build these ourselves. To do so we can use the following steps:
# Building clang-format for s_all # Similar instructions can be found at https://clang.llvm.org/get_started.html # llvm is a *big* repo. Only copy the 10.0.0 tag with no git history git clone --branch llvmorg-10.0.0 --depth 1 https://github.com/llvm/llvm-project.git # Both cmake and ninja produce warnings here. They don't seem to impact the final binary mkdir build cd build cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G Ninja ../llvm ninja clang-format cp bin/clang-format /your/path/to/wiredtiger/dist
These steps should be added to a comment in s_clang_format for future reference, and can also improve the error reporting of this script at the same time. Currently it's unclear why the script fails when it can't find the correct binaries, just reporting "./s_clang_format: unsupported architecture and OS combination 'arm64-Darwin' to run clang_format"
Finally, 12.0.1 formats a small number of files differently to 10.0.0. We should spend a small (half a day) amount of effort to determine whether new settings need to be added to .clang-format to retain our current formatting for all files.