GH-47167: [C++][Dev] Update clang-format dependency#47168
GH-47167: [C++][Dev] Update clang-format dependency#47168zanmato1984 merged 5 commits intoapache:mainfrom
Conversation
|
|
|
The Python failures are unrelated, I just merged the fix on main, if you rebase they will go away. |
|
Without it, that sends back |
|
Supporting old pre-commit (system pre-commit) is for new contributors on Ubuntu 22.04. If we have enough documentation (or something) for new contributors, we can require more newer pre-commit (and identify). |
|
|
|
apache/arrow has many language implementations. We can't assume that all new contributors are familiar with Python, conda and/or pip. For example, this thread #46686 (comment) considered about new R contributors. |
|
A possible direction to help both could be to leverage pixi. I'm using it locally and in many other projects (C++/Rust/Python): it combines conda dependencies and run commands in managed environments. Once installed (which is fairly easy IMHO), a one command I'm not claiming it could handle all Arrow development cases, but it certainly make for a great on-boarding. |
|
I don't have a strong opinion how to care about new contributors. I don't object the Pixi (or pip) approach if we have the official document how to prepare pre-commit with Pixi or something. It may be better that we start a discussion thread on |
|
I think it becomes more reasonable now to move forward this PR, since:
I've made a commit in this PR with an update to the clang-format version change from v20 to a less aggressive v18, and related code formatting. @kou @pitrou @AntoinePrv what do you think? Thanks. [1] arrow/.github/workflows/cpp.yml Line 84 in 7fe39d4 [2] Line 60 in 7fe39d4 [3] arrow/cpp/src/arrow/compute/kernels/hash_aggregate.cc Lines 283 to 285 in 3fb84ff [4] llvm/llvm-project#56283 [5] https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html#clang-format |
That's fine with me on the principle. The lint CI job is failing, though. |
|
How about requiring (recommending?) Ubuntu 24.04 or later (not 22.04) for development in our documentation? |
Is this because we want to have a system that has defaulted precommit/clang-format that matches the latest requirement? Another question is, other than clarifying in the document, what else need to be changed to let the CI pass? Thanks. |
It's for only pre-commit. We don't need to care about clang-format version. pre-commit installs clang-format automatically. (I'm OK with what is documented. We require Ubuntu 24.04, we require pip/conda/..., or something.)
diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index b763cfbbbc..59171ddcaa 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -41,8 +41,8 @@ jobs:
lint:
name: Lint C++, Python, R, Docker, RAT
- # Use Ubuntu 22.04 to ensure working pre-commit on Ubuntu 22.04.
- runs-on: ubuntu-22.04
+ # Use Ubuntu 24.04 to ensure working pre-commit on Ubuntu 24.04.
+ runs-on: ubuntu-24.04
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 15
steps: |
Oh, I mean even on older Ubuntu we can still have a recent-enough pre-commit, right? Why does this have anything to do with the version of Ubuntu? (Is it because on Ubuntu 24.04, the defaulted pre-commit is recent-enough, so people don't have to install one?)
Thanks a lot! Let me try this. |
Yes, if a user installs pre-commit by themselves. (A user can't install pre-commit by
Yes. We can use |
|
Thank you @kou for clarifying! I agree that requiring Ubuntu 24.04 might be easiest in terms of documentation. I personally also think this might not be a big deal for developers, since I personal haven't been using precommit at all until very recently I started to work on this PR. In other words, those developers who don't use precommit may not feel it at all. |
|
Hi @kou @pitrou , shall we move on with this one? We can later add documentation wrt the required Ubuntu version for developers. Thanks. cc @AntoinePrv |
zanmato1984
left a comment
There was a problem hiding this comment.
I'm giving my +1 now. But obviously I'll need at least one other approval.
kou
left a comment
There was a problem hiding this comment.
+1
- Could you open an issue if we want to defer documentation?
- Is 18.1.8 OK? It seems that the latest available version is 21.1.8: https://github.com/pre-commit/mirrors-clang-format/tags
pitrou
left a comment
There was a problem hiding this comment.
+1, the formatting changes are for the better IMHO
|
Thank you @kou .
Yes, #48850 filed.
I used v18 to match the version used in the rest of our CI, see #47168 (comment) . |
|
Thanks for picking up the work @zanmato1984
The biggest blocker for was with pre-commit (recent clang-format hooks did not support earlier versions), apart from that I don't see why not go to the most recent (for me that is better because I constrain the |
|
Thank you all. Let me merge this. |
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit a1ec5a9. There weren't enough matching historic benchmark results to make a call on whether there were regressions. The full Conbench report has more details. |
…t/Ubuntu This commit adds a new 'Development Tool Requirements' section to the C++ development documentation that clearly specifies: - clang-format version 14.0.6 or later - pre-commit version 2.17.0 or later - Ubuntu 22.04 LTS or later These requirements reflect the toolchain updates made in apacheGH-47168. Fixes apache#48850
…t/Ubuntu This commit adds a new 'Development Tool Requirements' section to the C++ development documentation that clearly specifies: - clang-format version 14.0.6 or later - pre-commit version 2.17.0 or later - Ubuntu 22.04 LTS or later These requirements reflect the toolchain updates made in apacheGH-47168. Fixes apache#48850
Rationale for this change
Update clang-format to better match modern IDEs.
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?
No