sighingnow / libclang

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

`manylinux2014_aarch64.whl` is broken (needs `GLIBC_2.29`) #59

Closed aloisklink closed 11 months ago

aloisklink commented 11 months ago

The latest manylinux2014_aarch64.whl for libclang 16.0.6 is broken, as it needs a minimum version of GLIBC_2.29. Essentially, this is actually a manylinux_2_29 wheel.

You can quickly search for this issue by running strings on the libclang.so shared library file:

# download link taken from https://pypi.org/project/libclang/#files
wget https://files.pythonhosted.org/packages/d0/66/b4e67a05a00b54dab6af06e04b3e5dd8231c2b7a363df2f86f1a47808321/libclang-16.0.6-py2.py3-none-manylinux2014_aarch64.whl
unzip libclang-16.0.6-py2.py3-none-manylinux2014_aarch64.whl
# search for GLIBC_2.29 string
strings libclang-16.0.6.data/platlib/clang/native/libclang.so | grep 'GLIBC_2.29'

It looks like this repo is building the aarch64 wheels using Ubuntu 20.04, see https://github.com/sighingnow/libclang/blob/58a4861eac255ffc72c7a7f075f9d1744dfc6ba5/.github/workflows/libclang-linux-aarch64.yml#L15

Since Ubuntu 20.04 uses v2.31 of glibc, they should instead be manylinux_2_31 wheels.

How to fix

Easy way (remove manylinx2014 support)

Change the manylinux_2014 flags to manylinux_2_31. This fill fix future package releases. However, anybody on an old operating system will still download the old broken manylinux_2014 wheels.

Hard fix (compile on manylinux2014)

Use something like pypa/cibuildwheel to build the wheels for you on the official pypa/manylinux2014 docker image. This will let you build all of the Linux wheels in a single GitHub Action, but the pypa/manylinux2014 image is based on CentOS, not Ubuntu, so you'd have to replace all of the apt instructions with yum/dnf instructions.

sighingnow commented 11 months ago

We didn't use pypa/cibuildwheel because it is really slow with docker using qemu.

I will take try to make a docker image with a higher version of aarch64-linux-gnu-gcc installed based on manylinux 2014 to fix the issue.

sighingnow commented 11 months ago

The issue has been fixed by avoid using the versioned symbol in new glibc (see https://github.com/sighingnow/libclang/commit/730d7fadea1bbfe52443d0d6d8931d11eb0800e1).

Now the artifacts only require GLIBC_2.17 (manylinux2014-compatible), and the revision has been uploaded to pypi: https://files.pythonhosted.org/packages/fd/c0/c0a49651de49940cd096b3c44af639c4b9b65aad9ffe19d399db552e6b23/libclang-16.0.6-1-py2.py3-none-manylinux2014_aarch64.whl

GLIBC_2.17
__GLIBC__
__GLIBCXX_TYPE_INT_N_0
__GLIBCXX_BITSIZE_INT_N_0
_GLIBCXX_PREDEFINED_OBJC_ARC_IS_SCALAR
_GLIBCXX_ASSERTIONS
_GLIBCXX_CONCEPT_CHECKS
_GLIBCXX_DEBUG
_GLIBCXX_DEBUG_PEDANTIC
_GLIBCXX_PARALLEL
_GLIBCXX_PARALLEL_ASSERTIONS
_GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_USE_CXX11_ABI
_GLIBCXX_USE_DEPRECATED