<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65575>65575</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Official standalone clang-format distribution for Windows
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format,
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
swaldhoer
</td>
</tr>
</table>
<pre>
I like to suggest that the LLVM project provides (version specific) ``clang-format`` installers/executables for Windows.
## Why do I think this is a good idea?
- Projects fix certain software versions, so that things are reproducible.
This not only true for compilers, but also for style checkers, linters etc.
On Linux this is not a problem as standalone packages of clang-format are available.
On Windows however, only the whole LLVM installer is available, which might not be required, as only clang-format
will be needed to format.
Furthermore the LLVM installer requires elevated privileges and does not support side-by-side installation of
different versions.
- Other projects that just repack the executable would not need to rebuild the binary, instead these downstream
consumers could just use the official build.
- Sure, every project that requires only clang-format could just build it on its own and distribute it, but this dos not seem like a good idea, as these might not fully grasp yow to build as this is often not so easy and this is most times not the scope of the project.
There are already projects that rebuild and distribute only ``clang-format``, e.g.,
- Microsoft's VS Code extension [C/C++ for Visual Studio Code](https://github.com/microsoft/vscode-cpptools)
- [clang-format](https://pypi.org/project/clang-format/) Python package
These, and the community, would profit if they were just able to consume the LLVM single executable/installer.
These two exemplary projects have two downsides for developers: They are only come within a text editor (why install a text editor when you need a formatter) or you are required to install Python and optimally create Python environment just for that purpose.
## What do I actually suggest?
- The LLVm project should build a clang-format Installer for Windows.
- This installer should not require elevate privileges.
- Run as a user the installer should e.g., install to: ``%LOCALAPPDATA%\Programs\clang-format\``
- Run as a administrator the installer should e.g., install to: ``%PROGRAMFILES%\clang-format\``
- This installer should support side-by-side installations ``clang-format.exe`` pointing to the latest version, e.g.,
```bash
C:\Users\user\AppData\Local\Programs\clang-format
├───clang-format.exe
├───clang-format-15.0.0.exe
├───# and so on
└───clang-format-16.0.6.exe # same as 'clang-format.exe'
```
I think this would greatly improve the developer experience for current users and would also benefit the further adaption of ``clang-format`` in the community.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycV01z2zgS_TXQpUsqmjIl66CDLI-2UuWUXYk3cwaJJokxCHABUDT__VYDpD6sTHYnh0gKAfbH69ev29w5WWnELcseWfY0452vjd26nitRG7Sz3Ihh-wWUfEfwBlxXVeg8-JrTB8Lz84-v0FrzFxaevo9SoAOWPhzROmk0uBYLWcqCpRtgq4StkkJxXc1LYxvu4xOQ2nmuFFrH0gN-YNF5nit0UBoLf0otTO8WLHliyW78TJcsXcKf9QDCwBfwtdTv9OlAOuBQGSNACuRsebh8bw6vMVYHpfyAAq3nUoMzpe-5RRijdizdgzNTmlJXDujYYmuN6AqZKxzjAXgjr9p4MFoN4G2HIezCNK2MKe0h7zxw5Uw4cX5QCEWNxft4rKT2aB2gL05mXzQ8S919nLIiF5wwzhU2wB04z7XgymiElhfvvEIHpoRLfEPU_Mil4pchv-gJVahNj0e0FEWMv0boa6PG0p4qE3CdDNHtvpZFDY2sah9Cywme_3TSoqBj7qK9q2qP7nupFN3XiAIF8Sqen-I7dNbXaBtj8cyycyijHweo8Mg9CmitPEqFhADXAoTBiJfr2tZYD04KnOfDnL4nQ9wTP005ORWyLNGi9icWLCbSvFA0E81dpMVfnfNECF68hxjPtIXedEoE_5Qh5Wcx76QS4WIuNbcDYUSBIA9PHYIwvXbeIm-miAqjXdcQMYpgMbjsXMTElKUsJFcQLJ9C_d7ZUB4q6nDqzBDxCbabwlzaj4FKojNI78D0OmIqnbcy7zyC9BOnAzeFGcFGbKJSXDZg5EJM8cyWslNqgMpy18JgesIoOg53I-FN6VFHywaQuyHEMZ02hnRINmOlCRJXmJaACf8ZU7-SjbcaqR_on7LIxfCpplOZPuUb8Po78QpgL6oFS_fXSvNVFtaQsrB07eDHd9gbQTTxqIMysuxxz9LDnqWPLH0MyvBDuo4r-O47IU24z7Inlj7U3reOLXcsPbD0UElfd_miMA1LD83Zy-HoC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