Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A newer package provigind the python libclang bindings is available, called "libclang". Unlike "clang", this package ships the libclang library, removing the dependency from the system's one. This dependency is particularly frustrating as it requires not only the presence of libclang on the system, but also a specific version of it, requiring things like
pip3 install clang==14
where the version depends on the distro and distro's version.The "libclang" library is identical to the "clang" one, the only difference being a pre-set
index.Config.library_path
, set to the package's library.This PR adds support to it, detecting if
index.Config.library_path
is set (and so, if "libclang" is being used) and leaving it as it is unless overridden by the environment variables. With this, pybind11_mkdoc works out-of-the-box.The only issue are the system's headers, not shipped within "libclang" (see sighingnow/libclang#40) which cause some error messages on the stderr like
but the docstrings generation successfully completes anyways.
As a side effect, this fixes pybind11_mkdoc on Arch Linux, as it currently can not find libclang.so (installed under
/usr/lib/
, while pybind11_mkdoc searches it under/usr/lib/llvm{version_number}/
).Tested only on Linux.