termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.08k stars 3k forks source link

[Bug]: Python GRPC Library Error #21272

Closed afrhan-repo closed 1 month ago

afrhan-repo commented 1 month ago

Problem description

Yesterday I have installed this package python-grpcio(version 1.66.1) from official termux-repo. But when I tried to import this package I got this error.

What steps will reproduce the bug?

ipython Python 3.11.9 (main, Aug 13 2024, 11:27:10) [Clang 18.0.1 (https://android.googlesource.com/toolchain/llvm-project d8003a456 Type 'copyright', 'credits' or 'license' for more information IPython 8.26.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import grpc ----------------------------------------------------------------------ImportError Traceback (most recent call last)Cell In[1], line 1 ----> 1 import grpc File /data/data/com.termux/files/usr/lib/python3.11/site-packages/grpc/__init__.py:22 19 import logging 20 import sys ---> 22 from grpc import _compression 23 from grpc._cython import cygrpc as _cygrpc 24 from grpc._runtime_protos import protos File /data/data/com.termux/files/usr/lib/python3.11/site-packages/grpc/_compression.py:20 17 from typing import Optional 19 import grpc ---> 20 from grpc._cython import cygrpc 21 from grpc._typing import MetadataType 23 NoCompression = cygrpc.CompressionAlgorithm.none ImportError: dlopen failed: cannot locate symbol "_ZN4absl12lts_2024011612log_internal10LogMessagelsIiTnNSt6__ndk19enable_ifIXntsr4absl16HasAbslStringifyIT_EE5valueEiE4typeELi0EEERS2_RKS6_" referenced by "/data/data/com.termux/files/usr/lib/python3.11/site-packages/grpc/_cython/cygrpc.cpython-311.so"...

What is the expected behavior?

Few weeks ago , it works perfectly fine in my project .But today I got this error.I tried to build it manually,but also failed .

If somebody could help me, thanks in advance.

System information

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PACKAGE_VARIANT=apt-android-7
TERMUX_APP_PID=13030
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_VERSION=0.119.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://termux.librehat.com/apt/termux-main stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://termux.librehat.com/apt/termux-x11 x11 main
# sources.list.d/termux-adb.list
deb https://nohajc.github.io termux extras
# root-repo (sources.list.d/root.list)
deb https://termux.librehat.com/apt/termux-root root stable
Updatable packages:
gh/stable 2.55.0 aarch64 [upgradable from: 2.54.0]
termux-tools version:
1.43.4
Android version:
9
Kernel build information:
Linux localhost 4.4.153-perf+ #1 SMP PREEMPT Thu Sep 17 11:35:50 WIB 2020 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
Redmi Note 5 Pro
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.styling versionCode:1000
Biswa96 commented 1 month ago

What is the output of apt info abseil-cpp?

afrhan-repo commented 1 month ago

What is the output of apt info abseil-cpp?

Package: abseil-cpp Version: 20240116.2 Maintainer: @termux Installed-Size: 8663 kB Depends: libc++ Conflicts: libgrpc (<< 1.52.0-1) Homepage: https://abseil.io/ Download-Size: 1076 kB APT-Manual-Installed: no APT-Sources: https://termux.librehat.com/apt/termux-main stable/main aarch64 Packages Description: Abseil C++ Common Libraries

Biswa96 commented 1 month ago

Thank you for reporting the issue. I can reproduce it in my system and suspect that build system is using bundled abseil-cpp instead of the system one. I'll try to investigate it more.

afrhan-repo commented 1 month ago

Do you have previous version(deb package) of abseil-cpp? I hope after downgrading to that version,the problem will solve.

Biswa96 commented 1 month ago

Do you have previous version(deb package) of abseil-cpp?

Those are removed automatically after a new version. Quickly, try to downgrade to 1.66.0 or 1.65.5. You have to downgrade both python-grpcio and libgrpc.

licy183 commented 1 month ago

Related to llvm/llvm-project#102443.

In short, clang changed their mangling rules since clang-18, and the symbols exported by abseil-cpp happens to trigger this. Bumping abseil-cpp and their revdeps should resolve this.

licy183 commented 1 month ago

Please install all the debs in https://github.com/termux/termux-packages/actions/runs/10645181804?pr=21303 and test if it works. Thanks!

afrhan-repo commented 1 month ago

Please install all the debs in https://github.com/termux/termux-packages/actions/runs/10645181804?pr=21303 and test if it works. Thanks!

It's now working 😀