[clang-tools-extra] 6c78711 - [clang-tidy] Install run-clang-tidy.py in bin/ as run-clang-tidy

Nathan James via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 23 04:38:37 PST 2021


Author: Florian Schmaus
Date: 2021-02-23T12:38:27Z
New Revision: 6c78711f106fe01cd8c8c85a5c42953035453135

URL: https://github.com/llvm/llvm-project/commit/6c78711f106fe01cd8c8c85a5c42953035453135
DIFF: https://github.com/llvm/llvm-project/commit/6c78711f106fe01cd8c8c85a5c42953035453135.diff

LOG: [clang-tidy] Install run-clang-tidy.py in bin/ as run-clang-tidy

The run-clang-tidy.py helper script is supposed to be used by the
user, hence it should be placed in the user's PATH. Some
distributions, like Gentoo [1], won't have it in PATH unless it is
installed in bin/.

Furthermore, installed scripts in PATH usually do not carry a filename
extension, since there is no need to know that this is a Python
script. For example Debian and Ubuntu already install this script as
'run-clang-tidy' [2] and hence build systems like Meson also look for
this name first [3]. Hence we install run-clang-tidy.py as
run-clang-tidy, as suggested by Sylvestre Ledru [4].

1: https://bugs.gentoo.org/753380
2: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/60aefb14171ab5c3867a0081844b507fc9f6e015/debian/clang-tidy-X.Y.links.in#L2
3: https://github.com/mesonbuild/meson/blob/b6dc4d5e5c6e838de0b52e62d982ba2547eb366d/mesonbuild/scripts/clangtidy.py#L44
4: https://reviews.llvm.org/D90972#2380640

Reviewed By: sylvestre.ledru, JonasToth

Differential Revision: https://reviews.llvm.org/D90972

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/tool/CMakeLists.txt
    clang-tools-extra/docs/ReleaseNotes.rst

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
index f12cff1b1303..ad3255b024fc 100644
--- a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
@@ -55,5 +55,6 @@ install(PROGRAMS clang-tidy-
diff .py
   DESTINATION share/clang
   COMPONENT clang-tidy)
 install(PROGRAMS run-clang-tidy.py
-  DESTINATION share/clang
-  COMPONENT clang-tidy)
+  DESTINATION bin
+  COMPONENT clang-tidy
+  RENAME run-clang-tidy)

diff  --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 0481904398b8..c0e80230c8ce 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -67,6 +67,9 @@ The improvements are...
 Improvements to clang-tidy
 --------------------------
 
+- The `run-clang-tidy.py` helper script is now installed in `bin/` as
+  `run-clang-tidy`. It was previously installed in `share/clang/`.
+
 New checks
 ^^^^^^^^^^
 


        


More information about the cfe-commits mailing list