clangd 16.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- clangd-16.0.6/CMakeLists.txt +51 -0
- clangd-16.0.6/COPYING.md +16 -0
- clangd-16.0.6/LICENSE.md +191 -0
- clangd-16.0.6/MANIFEST.in +6 -0
- clangd-16.0.6/PKG-INFO +69 -0
- clangd-16.0.6/README.md +49 -0
- clangd-16.0.6/clangd/__init__.py +58 -0
- clangd-16.0.6/clangd.egg-info/PKG-INFO +69 -0
- clangd-16.0.6/clangd.egg-info/SOURCES.txt +16 -0
- clangd-16.0.6/clangd.egg-info/dependency_links.txt +1 -0
- clangd-16.0.6/clangd.egg-info/entry_points.txt +2 -0
- clangd-16.0.6/clangd.egg-info/not-zip-safe +1 -0
- clangd-16.0.6/clangd.egg-info/top_level.txt +1 -0
- clangd-16.0.6/clangd_version.cmake +2 -0
- clangd-16.0.6/pyproject.toml +15 -0
- clangd-16.0.6/setup.cfg +4 -0
- clangd-16.0.6/setup.py +67 -0
- clangd-16.0.6/test/test_executable.py +30 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
project(clangd-wheel)
|
|
2
|
+
cmake_minimum_required(VERSION 3.16)
|
|
3
|
+
|
|
4
|
+
# Include the "single source of truth" for the clangd version
|
|
5
|
+
include(clangd_version.cmake)
|
|
6
|
+
string(REPLACE "-" "" CLANGD_VERSION_SHORT "${CLANGD_VERSION}")
|
|
7
|
+
string(REPLACE "." ";" CLANGD_VERSION_LIST ${CLANGD_VERSION})
|
|
8
|
+
list(GET CLANGD_VERSION_LIST 0 CLANGD_VERSION_MAJOR)
|
|
9
|
+
|
|
10
|
+
# Define a build rule clangd
|
|
11
|
+
set(LLVM_DOWNLOAD_URL "https://github.com/llvm/llvm-project/releases/download/llvmorg-${CLANGD_VERSION}/llvm-project-${CLANGD_VERSION_SHORT}.src.tar.xz")
|
|
12
|
+
include(ExternalProject)
|
|
13
|
+
ExternalProject_add(build-clangd
|
|
14
|
+
URL "${LLVM_DOWNLOAD_URL}"
|
|
15
|
+
SOURCE_SUBDIR llvm
|
|
16
|
+
SOURCE_DIR ${CMAKE_BINARY_DIR}/llvm-project
|
|
17
|
+
BINARY_DIR ${CMAKE_BINARY_DIR}/llvm
|
|
18
|
+
UPDATE_COMMAND ""
|
|
19
|
+
INSTALL_COMMAND ""
|
|
20
|
+
USES_TERMINAL_DOWNLOAD 1
|
|
21
|
+
USES_TERMINAL_CONFIGURE 1
|
|
22
|
+
USES_TERMINAL_BUILD 1
|
|
23
|
+
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DLLVM_ENABLE_ZSTD=OFF -DLLVM_ENABLE_PROJECTS=clang$<SEMICOLON>clang-tools-extra
|
|
24
|
+
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target clangd
|
|
25
|
+
)
|
|
26
|
+
set(clangd-executable ${CMAKE_BINARY_DIR}/llvm/bin/clangd${CMAKE_EXECUTABLE_SUFFIX})
|
|
27
|
+
|
|
28
|
+
# Reduce the size of the executable by executing strip if it is present on the system
|
|
29
|
+
find_program(STRIP_EXECUTABLE strip)
|
|
30
|
+
if(STRIP_EXECUTABLE)
|
|
31
|
+
add_custom_target(
|
|
32
|
+
strip-clangd
|
|
33
|
+
ALL
|
|
34
|
+
COMMAND ${STRIP_EXECUTABLE} ${clangd-executable}
|
|
35
|
+
COMMENT "Stripping clangd executable for size reduction"
|
|
36
|
+
)
|
|
37
|
+
add_dependencies(strip-clangd build-clangd)
|
|
38
|
+
endif()
|
|
39
|
+
|
|
40
|
+
# Define an installation rule that copies the executable to our Python package
|
|
41
|
+
install(
|
|
42
|
+
PROGRAMS
|
|
43
|
+
${clangd-executable}
|
|
44
|
+
DESTINATION clangd/data/bin
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
install(
|
|
48
|
+
DIRECTORY
|
|
49
|
+
${CMAKE_BINARY_DIR}/llvm/lib/clang/${CLANGD_VERSION_MAJOR}/include
|
|
50
|
+
DESTINATION clangd/data/lib/clang/${CLANGD_VERSION_MAJOR}
|
|
51
|
+
)
|
clangd-16.0.6/COPYING.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Copyright 2025 Dan Ilan
|
|
2
|
+
|
|
3
|
+
This project is a fork of the code for [clang-tidy wheel](https://github.com/ssciwr/clang-tidy-wheel), authored by Dominic Kempf, Heidelberg University and contributors.
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
|
clangd-16.0.6/LICENSE.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
|
34
|
+
available under the License, as indicated by a copyright notice that is included
|
|
35
|
+
in or attached to the work (an example is provided in the Appendix below).
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
41
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
42
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
45
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
46
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
47
|
+
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
48
|
+
on behalf of the copyright owner. For the purposes of this definition,
|
|
49
|
+
"submitted" means any form of electronic, verbal, or written communication sent
|
|
50
|
+
to the Licensor or its representatives, including but not limited to
|
|
51
|
+
communication on electronic mailing lists, source code control systems, and
|
|
52
|
+
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
53
|
+
the purpose of discussing and improving the Work, but excluding communication
|
|
54
|
+
that is conspicuously marked or otherwise designated in writing by the copyright
|
|
55
|
+
owner as "Not a Contribution."
|
|
56
|
+
|
|
57
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
58
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
59
|
+
incorporated within the Work.
|
|
60
|
+
|
|
61
|
+
2. Grant of Copyright License.
|
|
62
|
+
|
|
63
|
+
Subject to the terms and conditions of this License, each Contributor hereby
|
|
64
|
+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
|
65
|
+
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
|
66
|
+
publicly display, publicly perform, sublicense, and distribute the Work and such
|
|
67
|
+
Derivative Works in Source or Object form.
|
|
68
|
+
|
|
69
|
+
3. Grant of Patent License.
|
|
70
|
+
|
|
71
|
+
Subject to the terms and conditions of this License, each Contributor hereby
|
|
72
|
+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
|
73
|
+
irrevocable (except as stated in this section) patent license to make, have
|
|
74
|
+
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
|
|
75
|
+
such license applies only to those patent claims licensable by such Contributor
|
|
76
|
+
that are necessarily infringed by their Contribution(s) alone or by combination
|
|
77
|
+
of their Contribution(s) with the Work to which such Contribution(s) was
|
|
78
|
+
submitted. If You institute patent litigation against any entity (including a
|
|
79
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
|
80
|
+
Contribution incorporated within the Work constitutes direct or contributory
|
|
81
|
+
patent infringement, then any patent licenses granted to You under this License
|
|
82
|
+
for that Work shall terminate as of the date such litigation is filed.
|
|
83
|
+
|
|
84
|
+
4. Redistribution.
|
|
85
|
+
|
|
86
|
+
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
|
87
|
+
in any medium, with or without modifications, and in Source or Object form,
|
|
88
|
+
provided that You meet the following conditions:
|
|
89
|
+
|
|
90
|
+
You must give any other recipients of the Work or Derivative Works a copy of
|
|
91
|
+
this License; and
|
|
92
|
+
You must cause any modified files to carry prominent notices stating that You
|
|
93
|
+
changed the files; and
|
|
94
|
+
You must retain, in the Source form of any Derivative Works that You distribute,
|
|
95
|
+
all copyright, patent, trademark, and attribution notices from the Source form
|
|
96
|
+
of the Work, excluding those notices that do not pertain to any part of the
|
|
97
|
+
Derivative Works; and
|
|
98
|
+
If the Work includes a "NOTICE" text file as part of its distribution, then any
|
|
99
|
+
Derivative Works that You distribute must include a readable copy of the
|
|
100
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
101
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
102
|
+
following places: within a NOTICE text file distributed as part of the
|
|
103
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
104
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
105
|
+
Works, if and wherever such third-party notices normally appear. The contents of
|
|
106
|
+
the NOTICE file are for informational purposes only and do not modify the
|
|
107
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
108
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
109
|
+
provided that such additional attribution notices cannot be construed as
|
|
110
|
+
modifying the License.
|
|
111
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
112
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
113
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
114
|
+
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
115
|
+
with the conditions stated in this License.
|
|
116
|
+
|
|
117
|
+
5. Submission of Contributions.
|
|
118
|
+
|
|
119
|
+
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
|
120
|
+
for inclusion in the Work by You to the Licensor shall be under the terms and
|
|
121
|
+
conditions of this License, without any additional terms or conditions.
|
|
122
|
+
Notwithstanding the above, nothing herein shall supersede or modify the terms of
|
|
123
|
+
any separate license agreement you may have executed with Licensor regarding
|
|
124
|
+
such Contributions.
|
|
125
|
+
|
|
126
|
+
6. Trademarks.
|
|
127
|
+
|
|
128
|
+
This License does not grant permission to use the trade names, trademarks,
|
|
129
|
+
service marks, or product names of the Licensor, except as required for
|
|
130
|
+
reasonable and customary use in describing the origin of the Work and
|
|
131
|
+
reproducing the content of the NOTICE file.
|
|
132
|
+
|
|
133
|
+
7. Disclaimer of Warranty.
|
|
134
|
+
|
|
135
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the
|
|
136
|
+
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
137
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
|
138
|
+
including, without limitation, any warranties or conditions of TITLE,
|
|
139
|
+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
|
|
140
|
+
solely responsible for determining the appropriateness of using or
|
|
141
|
+
redistributing the Work and assume any risks associated with Your exercise of
|
|
142
|
+
permissions under this License.
|
|
143
|
+
|
|
144
|
+
8. Limitation of Liability.
|
|
145
|
+
|
|
146
|
+
In no event and under no legal theory, whether in tort (including negligence),
|
|
147
|
+
contract, or otherwise, unless required by applicable law (such as deliberate
|
|
148
|
+
and grossly negligent acts) or agreed to in writing, shall any Contributor be
|
|
149
|
+
liable to You for damages, including any direct, indirect, special, incidental,
|
|
150
|
+
or consequential damages of any character arising as a result of this License or
|
|
151
|
+
out of the use or inability to use the Work (including but not limited to
|
|
152
|
+
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
|
153
|
+
any and all other commercial damages or losses), even if such Contributor has
|
|
154
|
+
been advised of the possibility of such damages.
|
|
155
|
+
|
|
156
|
+
9. Accepting Warranty or Additional Liability.
|
|
157
|
+
|
|
158
|
+
While redistributing the Work or Derivative Works thereof, You may choose to
|
|
159
|
+
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
|
|
160
|
+
other liability obligations and/or rights consistent with this License. However,
|
|
161
|
+
in accepting such obligations, You may act only on Your own behalf and on Your
|
|
162
|
+
sole responsibility, not on behalf of any other Contributor, and only if You
|
|
163
|
+
agree to indemnify, defend, and hold each Contributor harmless for any liability
|
|
164
|
+
incurred by, or claims asserted against, such Contributor by reason of your
|
|
165
|
+
accepting any such warranty or additional liability.
|
|
166
|
+
|
|
167
|
+
END OF TERMS AND CONDITIONS
|
|
168
|
+
|
|
169
|
+
APPENDIX: How to apply the Apache License to your work
|
|
170
|
+
|
|
171
|
+
To apply the Apache License to your work, attach the following boilerplate
|
|
172
|
+
notice, with the fields enclosed by brackets "[]" replaced with your own
|
|
173
|
+
identifying information. (Don't include the brackets!) The text should be
|
|
174
|
+
enclosed in the appropriate comment syntax for the file format. We also
|
|
175
|
+
recommend that a file or class name and description of purpose be included on
|
|
176
|
+
the same "printed page" as the copyright notice for easier identification within
|
|
177
|
+
third-party archives.
|
|
178
|
+
|
|
179
|
+
Copyright [yyyy] [name of copyright owner]
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
clangd-16.0.6/PKG-INFO
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: clangd
|
|
3
|
+
Version: 16.0.6
|
|
4
|
+
Summary: binaries for clangd, a clang-based C++ language server (LSP)
|
|
5
|
+
Author: Dan Ilan
|
|
6
|
+
License: Apache 2.0
|
|
7
|
+
Project-URL: Documentation, https://clangd.llvm.org/
|
|
8
|
+
Project-URL: Source, https://github.com/jmpfar/clangd-wheel
|
|
9
|
+
Keywords: clangd,lsp,language-server,llvm,clang,static-analysis
|
|
10
|
+
Classifier: Environment :: No Input/Output (Daemon)
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: C
|
|
15
|
+
Classifier: Programming Language :: C++
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE.md
|
|
19
|
+
License-File: COPYING.md
|
|
20
|
+
|
|
21
|
+
# clangd Python distribution
|
|
22
|
+
|
|
23
|
+
[](https://pypi.org/project/clangd)
|
|
24
|
+
|
|
25
|
+
This project packages the `clangd` utility as a Python package. It allows you to install `clangd` directly from PyPI:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
python -m pip install clangd
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This projects intends to release a new PyPI package for each major and minor release of `clangd`.
|
|
32
|
+
|
|
33
|
+
## Use with pipx
|
|
34
|
+
|
|
35
|
+
You can use `pipx` to run clangd, as well. For example, `pipx run clangd <args>` will run clangd without any previous install required on any machine with pipx (including all default GitHub Actions / Azure runners, avoiding requiring a pre-install step or even `actions/setup-python`).
|
|
36
|
+
|
|
37
|
+
## Building new releases
|
|
38
|
+
|
|
39
|
+
The [clangd-wheel repository](https://github.com/jmpfar/clangd-wheel) provides the logic to build and publish binary wheels of the `clangd` utility.
|
|
40
|
+
|
|
41
|
+
In order to add a new release, the following steps are necessary:
|
|
42
|
+
|
|
43
|
+
* Edit the [version file](https://github.com/jmpfar/clangd-wheel/blob/main/clangd_version.cmake) to reflect the new version.
|
|
44
|
+
* Make a GitHub release to trigger the [GitHub Actions release workflow](https://github.com/jmpfar/clangd-wheel/actions/workflows/release.yml). Alternatively, the workflow can be triggered manually.
|
|
45
|
+
|
|
46
|
+
On manual triggers, the following input variables are available:
|
|
47
|
+
* `llvm_version`: Override the LLVM version (default: `""`)
|
|
48
|
+
* `wheel_version`: Override the wheel packaging version (default `"0"`)
|
|
49
|
+
* `deploy_to_testpypi`: Whether to deploy to TestPyPI instead of PyPI (default: `false`)
|
|
50
|
+
|
|
51
|
+
The repository with the precommit hook is automatically updated using a scheduled Github Actions workflow.
|
|
52
|
+
|
|
53
|
+
## Acknowledgments
|
|
54
|
+
|
|
55
|
+
This repository extends the great work of several other projects:
|
|
56
|
+
|
|
57
|
+
* This is a fork of the [clang-tidy-wheel](https://github.com/ssciwr/clang-tidy-wheel) project,
|
|
58
|
+
and their original work was used to create a wheel for clangd.
|
|
59
|
+
* `clangd` itself is [provided by the LLVM project](https://github.com/llvm/llvm-project) under the Apache 2.0 License with LLVM exceptions.
|
|
60
|
+
* The build logic is based on [scikit-build](https://github.com/scikit-build/scikit-build) which greatly reduces the amount of low level code necessary to package `clangd`.
|
|
61
|
+
* The `scikit-build` packaging examples of [CMake](https://github.com/scikit-build/cmake-python-distributions) and [Ninja](https://github.com/scikit-build/ninja-python-distributions) were very helpful in packaging `clangd`.
|
|
62
|
+
* The CI build process is controlled by [cibuildwheel](https://github.com/pypa/cibuildwheel) which makes building wheels across a number of platforms a pleasant experience (!)
|
|
63
|
+
|
|
64
|
+
We are grateful for the generous provisioning with CI resources that GitHub currently offers to Open Source projects.
|
|
65
|
+
|
|
66
|
+
## Troubleshooting
|
|
67
|
+
|
|
68
|
+
To see which clangd binary the package is using
|
|
69
|
+
you can set `CLANGD_WHEEL_VERBOSE` to `1` in your environment.
|
clangd-16.0.6/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# clangd Python distribution
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/clangd)
|
|
4
|
+
|
|
5
|
+
This project packages the `clangd` utility as a Python package. It allows you to install `clangd` directly from PyPI:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
python -m pip install clangd
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This projects intends to release a new PyPI package for each major and minor release of `clangd`.
|
|
12
|
+
|
|
13
|
+
## Use with pipx
|
|
14
|
+
|
|
15
|
+
You can use `pipx` to run clangd, as well. For example, `pipx run clangd <args>` will run clangd without any previous install required on any machine with pipx (including all default GitHub Actions / Azure runners, avoiding requiring a pre-install step or even `actions/setup-python`).
|
|
16
|
+
|
|
17
|
+
## Building new releases
|
|
18
|
+
|
|
19
|
+
The [clangd-wheel repository](https://github.com/jmpfar/clangd-wheel) provides the logic to build and publish binary wheels of the `clangd` utility.
|
|
20
|
+
|
|
21
|
+
In order to add a new release, the following steps are necessary:
|
|
22
|
+
|
|
23
|
+
* Edit the [version file](https://github.com/jmpfar/clangd-wheel/blob/main/clangd_version.cmake) to reflect the new version.
|
|
24
|
+
* Make a GitHub release to trigger the [GitHub Actions release workflow](https://github.com/jmpfar/clangd-wheel/actions/workflows/release.yml). Alternatively, the workflow can be triggered manually.
|
|
25
|
+
|
|
26
|
+
On manual triggers, the following input variables are available:
|
|
27
|
+
* `llvm_version`: Override the LLVM version (default: `""`)
|
|
28
|
+
* `wheel_version`: Override the wheel packaging version (default `"0"`)
|
|
29
|
+
* `deploy_to_testpypi`: Whether to deploy to TestPyPI instead of PyPI (default: `false`)
|
|
30
|
+
|
|
31
|
+
The repository with the precommit hook is automatically updated using a scheduled Github Actions workflow.
|
|
32
|
+
|
|
33
|
+
## Acknowledgments
|
|
34
|
+
|
|
35
|
+
This repository extends the great work of several other projects:
|
|
36
|
+
|
|
37
|
+
* This is a fork of the [clang-tidy-wheel](https://github.com/ssciwr/clang-tidy-wheel) project,
|
|
38
|
+
and their original work was used to create a wheel for clangd.
|
|
39
|
+
* `clangd` itself is [provided by the LLVM project](https://github.com/llvm/llvm-project) under the Apache 2.0 License with LLVM exceptions.
|
|
40
|
+
* The build logic is based on [scikit-build](https://github.com/scikit-build/scikit-build) which greatly reduces the amount of low level code necessary to package `clangd`.
|
|
41
|
+
* The `scikit-build` packaging examples of [CMake](https://github.com/scikit-build/cmake-python-distributions) and [Ninja](https://github.com/scikit-build/ninja-python-distributions) were very helpful in packaging `clangd`.
|
|
42
|
+
* The CI build process is controlled by [cibuildwheel](https://github.com/pypa/cibuildwheel) which makes building wheels across a number of platforms a pleasant experience (!)
|
|
43
|
+
|
|
44
|
+
We are grateful for the generous provisioning with CI resources that GitHub currently offers to Open Source projects.
|
|
45
|
+
|
|
46
|
+
## Troubleshooting
|
|
47
|
+
|
|
48
|
+
To see which clangd binary the package is using
|
|
49
|
+
you can set `CLANGD_WHEEL_VERBOSE` to `1` in your environment.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import functools
|
|
5
|
+
import os
|
|
6
|
+
|
|
7
|
+
if sys.version_info.minor >= 9:
|
|
8
|
+
# Only available on 3.9 or later, and required on 3.12
|
|
9
|
+
from importlib.resources import files
|
|
10
|
+
else:
|
|
11
|
+
import pkg_resources
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@functools.lru_cache(maxsize=None)
|
|
15
|
+
def _get_executable(name: str) -> Path:
|
|
16
|
+
if sys.version_info.minor >= 9:
|
|
17
|
+
# Only available in 3.9 or later, and required in 3.12
|
|
18
|
+
possibles = [
|
|
19
|
+
Path(files("clangd") / f"data/bin/{name}{s}")
|
|
20
|
+
for s in ("", ".exe", ".bin", ".dmg")
|
|
21
|
+
]
|
|
22
|
+
else:
|
|
23
|
+
possibles = [
|
|
24
|
+
Path(pkg_resources.resource_filename("clangd", f"data/bin/{name}{s}"))
|
|
25
|
+
for s in ("", ".exe", ".bin", ".dmg")
|
|
26
|
+
]
|
|
27
|
+
for exe in possibles:
|
|
28
|
+
if exe.exists():
|
|
29
|
+
if os.environ.get("CLANGD_WHEEL_VERBOSE", None):
|
|
30
|
+
print(f"Found binary: {exe} ")
|
|
31
|
+
return exe
|
|
32
|
+
|
|
33
|
+
raise FileNotFoundError(f"No executable found for {name} at\n{possibles}")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _run(name, *args):
|
|
37
|
+
command = [_get_executable(name)]
|
|
38
|
+
if args:
|
|
39
|
+
command += list(args)
|
|
40
|
+
else:
|
|
41
|
+
command += sys.argv[1:]
|
|
42
|
+
return subprocess.call(command)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _run_python(name, *args):
|
|
46
|
+
command = [sys.executable, _get_executable(name)]
|
|
47
|
+
if args:
|
|
48
|
+
command += list(args)
|
|
49
|
+
else:
|
|
50
|
+
command += sys.argv[1:]
|
|
51
|
+
|
|
52
|
+
# as MS Windows is not able to run Python scripts directly by name,
|
|
53
|
+
# we have to call the interpreter and pass the script as parameter
|
|
54
|
+
return subprocess.call(command)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def clangd():
|
|
58
|
+
raise SystemExit(_run("clangd"))
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: clangd
|
|
3
|
+
Version: 16.0.6
|
|
4
|
+
Summary: binaries for clangd, a clang-based C++ language server (LSP)
|
|
5
|
+
Author: Dan Ilan
|
|
6
|
+
License: Apache 2.0
|
|
7
|
+
Project-URL: Documentation, https://clangd.llvm.org/
|
|
8
|
+
Project-URL: Source, https://github.com/jmpfar/clangd-wheel
|
|
9
|
+
Keywords: clangd,lsp,language-server,llvm,clang,static-analysis
|
|
10
|
+
Classifier: Environment :: No Input/Output (Daemon)
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: C
|
|
15
|
+
Classifier: Programming Language :: C++
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE.md
|
|
19
|
+
License-File: COPYING.md
|
|
20
|
+
|
|
21
|
+
# clangd Python distribution
|
|
22
|
+
|
|
23
|
+
[](https://pypi.org/project/clangd)
|
|
24
|
+
|
|
25
|
+
This project packages the `clangd` utility as a Python package. It allows you to install `clangd` directly from PyPI:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
python -m pip install clangd
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This projects intends to release a new PyPI package for each major and minor release of `clangd`.
|
|
32
|
+
|
|
33
|
+
## Use with pipx
|
|
34
|
+
|
|
35
|
+
You can use `pipx` to run clangd, as well. For example, `pipx run clangd <args>` will run clangd without any previous install required on any machine with pipx (including all default GitHub Actions / Azure runners, avoiding requiring a pre-install step or even `actions/setup-python`).
|
|
36
|
+
|
|
37
|
+
## Building new releases
|
|
38
|
+
|
|
39
|
+
The [clangd-wheel repository](https://github.com/jmpfar/clangd-wheel) provides the logic to build and publish binary wheels of the `clangd` utility.
|
|
40
|
+
|
|
41
|
+
In order to add a new release, the following steps are necessary:
|
|
42
|
+
|
|
43
|
+
* Edit the [version file](https://github.com/jmpfar/clangd-wheel/blob/main/clangd_version.cmake) to reflect the new version.
|
|
44
|
+
* Make a GitHub release to trigger the [GitHub Actions release workflow](https://github.com/jmpfar/clangd-wheel/actions/workflows/release.yml). Alternatively, the workflow can be triggered manually.
|
|
45
|
+
|
|
46
|
+
On manual triggers, the following input variables are available:
|
|
47
|
+
* `llvm_version`: Override the LLVM version (default: `""`)
|
|
48
|
+
* `wheel_version`: Override the wheel packaging version (default `"0"`)
|
|
49
|
+
* `deploy_to_testpypi`: Whether to deploy to TestPyPI instead of PyPI (default: `false`)
|
|
50
|
+
|
|
51
|
+
The repository with the precommit hook is automatically updated using a scheduled Github Actions workflow.
|
|
52
|
+
|
|
53
|
+
## Acknowledgments
|
|
54
|
+
|
|
55
|
+
This repository extends the great work of several other projects:
|
|
56
|
+
|
|
57
|
+
* This is a fork of the [clang-tidy-wheel](https://github.com/ssciwr/clang-tidy-wheel) project,
|
|
58
|
+
and their original work was used to create a wheel for clangd.
|
|
59
|
+
* `clangd` itself is [provided by the LLVM project](https://github.com/llvm/llvm-project) under the Apache 2.0 License with LLVM exceptions.
|
|
60
|
+
* The build logic is based on [scikit-build](https://github.com/scikit-build/scikit-build) which greatly reduces the amount of low level code necessary to package `clangd`.
|
|
61
|
+
* The `scikit-build` packaging examples of [CMake](https://github.com/scikit-build/cmake-python-distributions) and [Ninja](https://github.com/scikit-build/ninja-python-distributions) were very helpful in packaging `clangd`.
|
|
62
|
+
* The CI build process is controlled by [cibuildwheel](https://github.com/pypa/cibuildwheel) which makes building wheels across a number of platforms a pleasant experience (!)
|
|
63
|
+
|
|
64
|
+
We are grateful for the generous provisioning with CI resources that GitHub currently offers to Open Source projects.
|
|
65
|
+
|
|
66
|
+
## Troubleshooting
|
|
67
|
+
|
|
68
|
+
To see which clangd binary the package is using
|
|
69
|
+
you can set `CLANGD_WHEEL_VERBOSE` to `1` in your environment.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
CMakeLists.txt
|
|
2
|
+
COPYING.md
|
|
3
|
+
LICENSE.md
|
|
4
|
+
MANIFEST.in
|
|
5
|
+
README.md
|
|
6
|
+
clangd_version.cmake
|
|
7
|
+
pyproject.toml
|
|
8
|
+
setup.py
|
|
9
|
+
clangd/__init__.py
|
|
10
|
+
clangd.egg-info/PKG-INFO
|
|
11
|
+
clangd.egg-info/SOURCES.txt
|
|
12
|
+
clangd.egg-info/dependency_links.txt
|
|
13
|
+
clangd.egg-info/entry_points.txt
|
|
14
|
+
clangd.egg-info/not-zip-safe
|
|
15
|
+
clangd.egg-info/top_level.txt
|
|
16
|
+
test/test_executable.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
clangd
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel", "scikit-build", "cmake>=3.16", "ninja; platform_system!='Windows'"]
|
|
3
|
+
|
|
4
|
+
[tool.cibuildwheel]
|
|
5
|
+
# Super-verbose output for debugging purpose
|
|
6
|
+
build-verbosity = 3
|
|
7
|
+
|
|
8
|
+
# We restrict ourselves to CPython 3.8 and then repair the wheels to be
|
|
9
|
+
# independent of the Python version - I have not found a different solution
|
|
10
|
+
# within cibuildwheel to achieve this.
|
|
11
|
+
build = "cp38-*"
|
|
12
|
+
|
|
13
|
+
# Testing commands for our wheels
|
|
14
|
+
test-requires = ["pytest"]
|
|
15
|
+
test-command = "pytest {package}/test"
|
clangd-16.0.6/setup.cfg
ADDED
clangd-16.0.6/setup.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
|
|
3
|
+
from skbuild import setup
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
|
|
7
|
+
class genericpy_bdist_wheel(_bdist_wheel):
|
|
8
|
+
def finalize_options(self):
|
|
9
|
+
_bdist_wheel.finalize_options(self)
|
|
10
|
+
self.root_is_pure = False
|
|
11
|
+
|
|
12
|
+
def get_tag(self):
|
|
13
|
+
python, abi, plat = _bdist_wheel.get_tag(self)
|
|
14
|
+
python, abi = "py2.py3", "none"
|
|
15
|
+
return python, abi, plat
|
|
16
|
+
|
|
17
|
+
# Read the clangd version from the "single source of truth"
|
|
18
|
+
def get_version():
|
|
19
|
+
with open("clangd_version.cmake", "r") as version_file:
|
|
20
|
+
parsed = {}
|
|
21
|
+
for line in version_file:
|
|
22
|
+
match = re.match("set\((.*) (.*)\)", line)
|
|
23
|
+
if len(match.groups()) != 2:
|
|
24
|
+
raise ValueError("Version File not readable")
|
|
25
|
+
parsed[match.groups()[0]] = match.groups()[1]
|
|
26
|
+
if parsed["CLANGD_WHEEL_VERSION"] == "0":
|
|
27
|
+
return f"{parsed['CLANGD_VERSION']}"
|
|
28
|
+
else:
|
|
29
|
+
return f"{parsed['CLANGD_VERSION']}.{parsed['CLANGD_WHEEL_VERSION']}"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Parse the given README file
|
|
33
|
+
with open("README.md", "r") as readme_file:
|
|
34
|
+
readme = readme_file.read()
|
|
35
|
+
|
|
36
|
+
cmdclass = {"bdist_wheel": genericpy_bdist_wheel}
|
|
37
|
+
setup(
|
|
38
|
+
name="clangd",
|
|
39
|
+
version=get_version(),
|
|
40
|
+
cmdclass=cmdclass,
|
|
41
|
+
author="Dan Ilan",
|
|
42
|
+
packages=["clangd"],
|
|
43
|
+
zip_safe=False,
|
|
44
|
+
entry_points={
|
|
45
|
+
"console_scripts": [
|
|
46
|
+
"clangd=clangd:clangd",
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
description="binaries for clangd, a clang-based C++ language server (LSP)",
|
|
50
|
+
long_description=readme,
|
|
51
|
+
long_description_content_type="text/markdown",
|
|
52
|
+
project_urls={
|
|
53
|
+
"Documentation": "https://clangd.llvm.org/",
|
|
54
|
+
"Source": "https://github.com/jmpfar/clangd-wheel",
|
|
55
|
+
},
|
|
56
|
+
keywords=["clangd", "lsp", "language-server", "llvm", "clang", "static-analysis"],
|
|
57
|
+
classifiers=[
|
|
58
|
+
"Environment :: No Input/Output (Daemon)",
|
|
59
|
+
"Intended Audience :: Developers",
|
|
60
|
+
"License :: OSI Approved :: Apache Software License",
|
|
61
|
+
"Operating System :: OS Independent",
|
|
62
|
+
"Programming Language :: C",
|
|
63
|
+
"Programming Language :: C++",
|
|
64
|
+
"Topic :: Software Development",
|
|
65
|
+
],
|
|
66
|
+
license="Apache 2.0",
|
|
67
|
+
)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import tempfile
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import pytest
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@pytest.fixture(autouse=True)
|
|
10
|
+
def ensure_clangd_from_wheel(monkeypatch):
|
|
11
|
+
"""test the installed clangd package, not the local one"""
|
|
12
|
+
this_dir = Path(__file__).resolve().absolute().parent
|
|
13
|
+
for pd in (this_dir, this_dir / ".."):
|
|
14
|
+
try:
|
|
15
|
+
new_path = sys.path.remove(pd)
|
|
16
|
+
monkeypatch.setattr(sys, "path", new_path)
|
|
17
|
+
except ValueError:
|
|
18
|
+
pass
|
|
19
|
+
monkeypatch.delitem(sys.modules, "clangd", raising=False)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_executable_file(capsys):
|
|
23
|
+
import clangd
|
|
24
|
+
|
|
25
|
+
clangd._get_executable.cache_clear()
|
|
26
|
+
exe = clangd._get_executable("clangd")
|
|
27
|
+
assert os.path.exists(exe)
|
|
28
|
+
assert os.access(exe, os.X_OK)
|
|
29
|
+
assert capsys.readouterr().out == ""
|
|
30
|
+
|