Comments (9)
It seems that bundled clang/cindex.py is too old for clang 3.4.
from cldoc.
Yes, I've seen this problem coming. I'm not entirely sure what the best way to fix this is. Unfortunately, libclang isn't backwards compatible, or at least so it seems. I'll have a look if there is a robust way to distribute the python bindings for multiple versions of libclang and decide which to use at runtime.
from cldoc.
Hi hi,
yes I have the same problem, I would prefer to not downgrade clang ;)
Although, I tried to match the numbers (i.e. 114) from clang/cindex.py with some libclang-includes and could not guess where they exactly come from. Could you explain based on which files the cindex.py was generated(?)/hand-written?
To solve this issue generally there could be a cindex.py for specific clang versions and python could decide during cldoc execution dynamically which one to take - but just guessing, haven't really looked deeper into it ...
from cldoc.
The cindex.py is just taken from clang sources, but I had to apply some small patches. I know that's messy, but at the time I mostly wanted to get it working. So, I'd be very happy to have this issue resolved properly. The way forward for me would be:
- Decide to support a minimal version of clang (e.g. what major distros distribute these days)
- Check the cindex.py file distributed with that version and compare with the one currently checked into cldoc. See if locally applied patches still apply or not, etc.
- Check in pristine cindex.py for versions of clang from the minimal supported version up to the latest
- Do any required hot-fixes by re-applying previously made patches, if they still apply
- At runtime, decide which version of clang were talking to and load the right bindings. I'm not aware of a reliable way to get the clang version on the system though, so this requires some more thought.
Unfortunately, I don't really have time currently to work on this. If anyone wants to pick it up, all help is welcome
from cldoc.
Hehe, funny I haven't wasted one thought about cindex.py being a part of clang...
Well, as this is the case why not try to rely on the original clang python module and build a wrapper for it... I'm travelling the whole next week, thus there is also a no-time constraint for me, but after that I could look into this...
Could you maybe outline what kind of patches were applied to the clang module and why?
Are there real patches, which you could provide maybe? Or are we talking about hand-patches? ;)
from cldoc.
It's recorded in the history of that file. I think the only relevant patch was this one:
22c665e
Then there is one that is somewhat cosmetic, to make imports work since the files were moved in a subdir:
4bb8d72#diff-0a66b3f487eb9ac81a636fa6b862bb69
As far as I remember, the initial import of cindex.py was taken from clang. If someone looks at this at some point, it might be worth thinking also about py3 support. For now I have postponed it mostly because cindex.py is not py3 compatible. A wip can be found here: https://github.com/jessevdk/cldoc/commits/wip/py3
from cldoc.
So this tool is completely broken on clang 3.4? I haven't actually tried it yet but checked the bugs before I did to make sure I didn't run into any showstoppers. I'm glad I did. :)
clang 3.4 has been out since 3 months already, it's probably time to give it full support.
Also about Python 3, did you try https://github.com/kennytm/clang-cindex-python3 ? It's somewhat out of date but might be a good start.
from cldoc.
Luckily it's all out on github then. As it happens to be, I've been busy with other things (shockingly!) the last months. Wrt py3, I've used the one you refer to with additional patches (see https://git.gnome.org/browse/gnome-code-assistance/tree/backends/c/clang/cindex.py). Yes, it would be nice to fix all these issues. If someone is willing to work on it, I'd be very happy to accept patches
from cldoc.
I think this was fixed. Please feel free to reopen if the problem still persists
from cldoc.
Related Issues (20)
- Not recognizing function parameters and returns HOT 2
- Install on Arch linux fails HOT 10
- ValueError: Unknown cursor kind 601 on macOS HOT 3
- Errors when including <cstdint> HOT 2
- Support C variable arguments HOT 2
- ValueError: Unknown type kind 119 (Mac OS X Sierra)
- Unknown type kind HOT 4
- Clang 3.9 incompatibilities HOT 2
- 'friend class Bar' causes "ValueError: Unknown template argument kind 603" HOT 2
- Not working with Python3 HOT 3
- ubuntu 17.10 problem library problem with 1.11 latest release HOT 2
- TypeError: expected a string or other character buffer object HOT 2
- Passing linker arguments into cldoc is broken
- Unable to match comments if a macro is expanded before the declaration.
- Failed to run on Ubuntu 18.04 LTS HOT 6
- how to generate documentation from folder tree HOT 1
- python 3.5 compatibility HOT 1
- Is this library still maintained? HOT 1
- Links in README.md are broken HOT 1
- Python 3.10 > AttributeError: module 'collections' has no attribute 'MutableMapping'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cldoc.