https://bugzilla.redhat.com/show_bug.cgi?id=2277782
Bug ID: 2277782 Summary: Package older clang-formats on newer Fedoras Product: Fedora Version: 39 OS: Linux Status: NEW Component: clang16 Keywords: RFE Severity: medium Assignee: tuliom@redhat.com Reporter: alyssa@rosenzweig.io CC: epel-packagers-sig@lists.fedoraproject.org, fedora-llvm-team@lists.fedoraproject.org, michel@michel-slm.name, tuliom@redhat.com Target Milestone: --- Classification: Fedora
Fedora packages clang-format, an automatic C/C++ code reformatting tool used by various FOSS projects, including the kernel and Mesa. Some project's CI systems enforce developer use of clang-format to produce a consistent style across the code base.
However, clang-format's output is not stable from version to version, as upstream clang-format tweaks affect the results. Projects therefore pin a single "blessed" version of clang-format that all contributors use.
Other distributions like Debian package simultaneously multiple versions of LLVM (and hence multiple version suffixed clang-formats), so contributors can install whatever the agreed upon version is without needing the whole team to use the same distro. Unfortunately, Fedora only packages a single latest clang version... and as soon as the Fedora LLVM is newer than what the project was using, boom! formatting changes randomly and the developer can no longer contribute.
Therefore, this is a request to package older clang-formats even on newer Fedoras. For my own use case, I need clang-format-16 on F39 (soon F40), since that's the version FEX-Emu pins. But F39 only has clang-format-17, which is incompatible.
Is it reasonable to include the older binaries in the newer Fedoras? If not, what is a reasonable workaround (that doesn't require switching from Fedora to another distro)?
Reproducible: Always
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
Tulio Magno Quites Machado Filho tuliom@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |tstellar@redhat.com Doc Type|--- |If docs needed, set a value
--- Comment #1 from Tulio Magno Quites Machado Filho tuliom@redhat.com ---
Therefore, this is a request to package older clang-formats even on newer Fedoras.
Notice this is already available on Fedora 40, where clang17-tools-extra provides /usr/bin/clang-format-17 and clang-tools-extra provides /usr/bin/clang-format from LLVM 18.1.
For my own use case, I need clang-format-16 on F39 (soon F40), since that's the version FEX-Emu pins. But F39 only has clang-format-17, which is incompatible.
Could you provide more information on how this version is pinned, please? e.g. are you trying to install an RPM that requires on clang-format-16?
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
--- Comment #2 from Alyssa Rosenzweig alyssa@rosenzweig.io ---
Notice this is already available on Fedora 40, where clang17-tools-extra provides /usr/bin/clang-format-17 and clang-tools-extra provides /usr/bin/clang-format from LLVM 18.1.
Great to know, thanks!
Could you provide more information on how this version is pinned, please? e.g. are you trying to install an RPM that requires on clang-format-16?
Due to the unstable nature of clang-format output, an upstream project has to pin a particular version that all its developers use. The RPM doesn't involve clang-format in any way, this is just for upstream devs.
I think projects pick the latest version they can get away with (say, packaged in a suitably old version of Debian), and then stay there as long as they can get away with. It looks like Mesa uses LLVM 15 and FEX uses LLVM 16. Bumping the version requires a flag day "reformat everything" commit which isn't too pleasant, so even if the whole team uses the latest Fedora, it would be inconvenient to have to track upstream LLVM.
Tangential observation, but clang-format output seems to be much more stable for C code (like Mesa) than C++ code (like FEX). I guess that shouldn't be too surprising.
---
In context of clang-format adoption for a third project, I saw someone suggest pulling binaries from https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.4 and skipping the package management. This works as a stopgap but having packaged 'properly' would certainly be nicer! Especially since those bins are 800 MB compressed shipping the entire LLVM toolchain (-:
---
Maybe enforcing clang-format use in CI wasn't such a great idea after all...
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
--- Comment #3 from Michel Lind michel@michel-slm.name --- (In reply to Tulio Magno Quites Machado Filho from comment #1)
Therefore, this is a request to package older clang-formats even on newer Fedoras.
Notice this is already available on Fedora 40, where clang17-tools-extra provides /usr/bin/clang-format-17 and clang-tools-extra provides /usr/bin/clang-format from LLVM 18.1.
Tulio, would you accept a PR that rework the clang16 packaging to be more like clang17 (and thus clang16-tools-extra is shipped?
I also have colleagues who need clang16 binaries that are currently unshipped
(In reply to Alyssa Rosenzweig from comment #2)
Maybe enforcing clang-format use in CI wasn't such a great idea after all...
Having dealth with this on Python projects, yeah, formatting and linting checks are ... very flaky
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
Tulio Magno Quites Machado Filho tuliom@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED
--- Comment #4 from Tulio Magno Quites Machado Filho tuliom@redhat.com --- (In reply to Michel Lind from comment #3)
Tulio, would you accept a PR that rework the clang16 packaging to be more like clang17 (and thus clang16-tools-extra is shipped?
I believe I can do this. Thanks! Let me start changing llvm16 first.
I also have colleagues who need clang16 binaries that are currently unshipped
Interesting. Michel, could you share which projects are depending on clang16 binaries, please?
Alyssa and Michel, if we distribute the new clang16 binaries on Fedora 40, would it work for you? Or do you really need it in older versions? I'd like to avoid changing stable versions.
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
Tulio Magno Quites Machado Filho tuliom@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |MODIFIED
--- Comment #5 from Tulio Magno Quites Machado Filho tuliom@redhat.com --- I proposed 2 PRs that implement this: https://src.fedoraproject.org/rpms/llvm16/pull-request/2 https://src.fedoraproject.org/rpms/clang16/pull-request/2
Builds are available in the following copr: https://copr.fedorainfracloud.org/coprs/tuliom/clang16-tools/
Feedback is welcome.
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
--- Comment #6 from Fedora Update System updates@fedoraproject.org --- FEDORA-2024-9b524890ce (clang16-16.0.6-7.fc41 and llvm16-16.0.6-9.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2024-9b524890ce
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
--- Comment #7 from Fedora Update System updates@fedoraproject.org --- FEDORA-2024-9b524890ce (clang16-16.0.6-7.fc41 and llvm16-16.0.6-9.fc41) has been pushed to the Fedora 41 stable repository. If problem still persists, please make note of it in this bug report.
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
--- Comment #8 from Fedora Update System updates@fedoraproject.org --- FEDORA-2024-eed8627ce2 (clang16-16.0.6-7.fc40 and llvm16-16.0.6-9.fc40) has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2024-eed8627ce2
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|MODIFIED |ON_QA
--- Comment #9 from Fedora Update System updates@fedoraproject.org --- FEDORA-2024-eed8627ce2 has been pushed to the Fedora 40 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-eed8627ce2` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-eed8627ce2
See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|ON_QA |MODIFIED
--- Comment #10 from Fedora Update System updates@fedoraproject.org --- FEDORA-2024-254e2bca72 (zlib-ng-2.1.6-4.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2024-254e2bca72
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|MODIFIED |CLOSED Resolution|--- |ERRATA Last Closed| |2024-05-29 13:50:21
--- Comment #11 from Fedora Update System updates@fedoraproject.org --- FEDORA-2024-254e2bca72 (zlib-ng-2.1.6-4.fc41) has been pushed to the Fedora 41 stable repository. If problem still persists, please make note of it in this bug report.
https://bugzilla.redhat.com/show_bug.cgi?id=2277782
Fedora Update System updates@fedoraproject.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed In Version| |clang16-16.0.6-7.fc40
--- Comment #12 from Fedora Update System updates@fedoraproject.org --- FEDORA-2024-eed8627ce2 (clang16-16.0.6-7.fc40 and llvm16-16.0.6-9.fc40) has been pushed to the Fedora 40 stable repository. If problem still persists, please make note of it in this bug report.
epel-packagers-sig@lists.fedoraproject.org