saghul / pycares

Python interface for c-ares
https://pypi.org/project/pycares/
MIT License
162 stars 74 forks source link

pycares fails to install in arm8 android device #191

Open 023948799e213e21b53eb83785356208 opened 8 months ago

023948799e213e21b53eb83785356208 commented 8 months ago

im using termux but when i do python setup.py install this error appears:

/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/data/data/com.termux/files/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
running bdist_egg
running egg_info
creating src/pycares.egg-info
writing src/pycares.egg-info/PKG-INFO
writing dependency_links to src/pycares.egg-info/dependency_links.txt
writing requirements to src/pycares.egg-info/requires.txt
writing top-level names to src/pycares.egg-info/top_level.txt
writing manifest file 'src/pycares.egg-info/SOURCES.txt'
reading manifest file 'src/pycares.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'tox.ini'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
warning: no previously-included files matching '*.[ao]' found under directory '*'
warning: no previously-included files matching '*.so' found under directory '*'
no previously-included directories found matching 'docs/_build'
adding license file 'LICENSE'
writing manifest file 'src/pycares.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv8l/egg
running install_lib
running build_py
creating build
creating build/lib.linux-armv8l-cpython-311
creating build/lib.linux-armv8l-cpython-311/pycares
copying src/pycares/__init__.py -> build/lib.linux-armv8l-cpython-311/pycares
copying src/pycares/__main__.py -> build/lib.linux-armv8l-cpython-311/pycares
copying src/pycares/_version.py -> build/lib.linux-armv8l-cpython-311/pycares
copying src/pycares/errno.py -> build/lib.linux-armv8l-cpython-311/pycares
copying src/pycares/utils.py -> build/lib.linux-armv8l-cpython-311/pycares
running build_ext
generating cffi module 'build/temp.linux-armv8l-cpython-311/_cares.c'
creating build/temp.linux-armv8l-cpython-311
building '_cares' extension
creating build/temp.linux-armv8l-cpython-311/build
creating build/temp.linux-armv8l-cpython-311/build/temp.linux-armv8l-cpython-311
creating build/temp.linux-armv8l-cpython-311/deps
creating build/temp.linux-armv8l-cpython-311/deps/c-ares
creating build/temp.linux-armv8l-cpython-311/deps/c-ares/src
creating build/temp.linux-armv8l-cpython-311/deps/c-ares/src/lib
arm-linux-androideabi-clang -mfloat-abi=softfp -mfpu=vfpv3-d16 -DNDEBUG -g -fwrapv -O3 -Wall -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -O3 -fPIC -DHAVE_CONFIG_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DCARES_STATICLIB=1 -Ideps/build-config/config_android -Ideps/build-config/include -Ideps/c-ares/include -I/data/data/com.termux/files/usr/include/python3.11 -c build/temp.linux-armv8l-cpython-311/_cares.c -o build/temp.linux-armv8l-cpython-311/build/temp.linux-armv8l-cpython-311/_cares.o
build/temp.linux-armv8l-cpython-311/_cares.c:580:10: fatal error: 'ares.h' file not found
  580 | #include <ares.h>
      |          ^~~~~~~~
1 error generated.
error: command '/data/data/com.termux/files/usr/bin/arm-linux-androideabi-clang' failed with exit code 1

gcc is also installed

romanovj commented 8 months ago

pkg install c-ares

wget https://files.pythonhosted.org/packages/1b/8f/daf60bbc06f4a3cd1cfb0ab807057151287df6f5c78f2e0d298acc9193ac/pycares-4.4.0.tar.gz
tar -xf pycares-4.4.0.tar.gz
sed -i s/'#define HAVE_GETSERVBYPORT_R 1'//g ./pycares-4.4.0/deps/build-config/config_android/ares_config.h
pip install ./pycares-4.4.0
023948799e213e21b53eb83785356208 commented 8 months ago

pkg install c-ares

wget https://files.pythonhosted.org/packages/1b/8f/daf60bbc06f4a3cd1cfb0ab807057151287df6f5c78f2e0d298acc9193ac/pycares-4.4.0.tar.gz
tar -xf pycares-4.4.0.tar.gz
sed -i s/'#define HAVE_GETSERVBYPORT_R 1'//g ./pycares-4.4.0/deps/build-config/config_android/ares_config.h
pip install ./pycares-4.4.0

No the pycares for arm8/arm7 is missing

saghul commented 8 months ago

What error do you get then?

023948799e213e21b53eb83785356208 commented 8 months ago

What error do you get then?

It says ares.h is missing

saghul commented 8 months ago

I see -Ideps/c-ares/include in the compiler line, the file is there so this is weird.

romanovj commented 8 months ago

pkg install c-ares

wget https://files.pythonhosted.org/packages/1b/8f/daf60bbc06f4a3cd1cfb0ab807057151287df6f5c78f2e0d298acc9193ac/pycares-4.4.0.tar.gz
tar -xf pycares-4.4.0.tar.gz
sed -i s/'#define HAVE_GETSERVBYPORT_R 1'//g ./pycares-4.4.0/deps/build-config/config_android/ares_config.h
pip install ./pycares-4.4.0

No the pycares for arm8/arm7 is missing

did you install c-ares package?

~ $ apt-file search /ares.h
c-ares: /data/data/com.termux/files/usr/include/ares.h
saghul commented 8 months ago

Or make sure the submodule is downloaded.

023948799e213e21b53eb83785356208 commented 8 months ago

pkg install c-ares

wget https://files.pythonhosted.org/packages/1b/8f/daf60bbc06f4a3cd1cfb0ab807057151287df6f5c78f2e0d298acc9193ac/pycares-4.4.0.tar.gz
tar -xf pycares-4.4.0.tar.gz
sed -i s/'#define HAVE_GETSERVBYPORT_R 1'//g ./pycares-4.4.0/deps/build-config/config_android/ares_config.h
pip install ./pycares-4.4.0

No the pycares for arm8/arm7 is missing

did you install c-ares package?

~ $ apt-file search /ares.h
c-ares: /data/data/com.termux/files/usr/include/ares.h

Yes i did all of that

saghul commented 8 months ago

Did you try with the submodule? That would use the bundled one.

023948799e213e21b53eb83785356208 commented 8 months ago

Did you try with the submodule? That would use the bundled one.

I dont understand what your talking about sorry im not a programmer

saghul commented 8 months ago

No worries. How did you download the pycares source code

023948799e213e21b53eb83785356208 commented 8 months ago

No worries. How did you download the pycares source code

from here not pip

romanovj commented 8 months ago
git clone --recurse-submodules https://github.com/saghul/pycares
sed -i s/'#define HAVE_GETSERVBYPORT_R 1'//g ./pycares/deps/build-config/config_android/ares_config.h
pip install ./pycares
saghul commented 8 months ago

No worries. How did you download the pycares source code

from here not pip

What exact command did you use?

023948799e213e21b53eb83785356208 commented 8 months ago

No worries. How did you download the pycares source code

from here not pip

What exact command did you use?

python setup.py install

saghul commented 8 months ago

I meant download it.