sighingnow / libclang

(Unofficial) Release libclang (clang.cindex) on pypi.
https://pypi.org/project/libclang
Other
84 stars 21 forks source link

MacOS-arm64 wheels for 18.1.1 and 17.0.6 fail with `Error parsing translation unit` #71

Closed julian-smith-artifex-com closed 3 months ago

julian-smith-artifex-com commented 6 months ago

Thanks for fixing #70. The new libclang-MacOS-x86_64 wheel on pypi.org works fine for me.

However i've noticed a different issue with the libclang-MacOS-arm64 18.1.1 and 17.0.6 wheels. They both fail to parse my C++ code with error clang.cindex.TranslationUnitLoadError: Error parsing translation unit..

The MacOS-arm64 16.06 wheel continues to work fine, as do the 18.1.1 wheels for other platforms (Linux, Windows, MacOS-x86_64).

There doesn't seem to be any detailed information about where the parse failed. I'm parsing the MuPDF library's header files. I suspect it's a build issue with the wheel? but i can probably create a simple reproducer if it would help.

wyfo commented 4 months ago

I'm currently facing the same issue on macOS with a m3 processor.

JhnW commented 4 months ago

I also encountered this issue by upgrading the MacOS version in my libclang dependent project (https://github.com/JhnW/devana). Migrating from 11 to 13 macos causes fail a lot of tests with parsing error. Does anyone have any information on what's next for this problem? I don't have MacOS for development, either it will be fixed or I will simply disable this target...

wyfo commented 4 months ago

I managed to get it work by using a manually installed llvm and setting LIBCLANG_LIBRARY_PATH environment variable. But of course, I would love to be able to just do a pip install libclang.

JhnW commented 4 months ago

@sighingnow so if wyfo was able to using new clang just installed manually, maybe update version of package is needed or something happens during installation on mac target?

sighingnow commented 4 months ago

Will process this issue today, sorry for the late.

JhnW commented 3 months ago

Will process this issue today, sorry for the late.

Nice to hear. Any update about this topic?

sighingnow commented 3 months ago

I have uploaded a new revision to pypi and confirmed it works on M1 MacOS:

https://files.pythonhosted.org/packages/4b/49/f5e3e7e1419872b69f6f5e82ba56e33955a74bd537d8a1f5f1eff2f3668a/libclang-18.1.1-1-py2.py3-none-macosx_11_0_arm64.whl

Try to upgrade your installation via pip3 install -i https://pypi.org/simple -U libclang --force-reinstall and make sure the correct wheel is downloaded.