saghul / pycares

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

Pycares requires gcc 4.2? #144

Closed drixie closed 3 years ago

drixie commented 3 years ago

I am trying to install pycares in a python virtualenv environment (running python 3.9.1). Error code is below

ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/nd/nrz2nn4d6hl8b4p3tq222xjw0000gn/T/pip-install-v_qip48a/pycares_4a3fc59cfa49446b8e6958924f9b1ffe/setup.py'"'"'; __file__='"'"'/private/var/folders/nd/nrz2nn4d6hl8b4p3tq222xjw0000gn/T/pip-install-v_qip48a/pycares_4a3fc59cfa49446b8e6958924f9b1ffe/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/nd/nrz2nn4d6hl8b4p3tq222xjw0000gn/T/pip-wheel-upsehkfo
       cwd: /private/var/folders/nd/nrz2nn4d6hl8b4p3tq222xjw0000gn/T/pip-install-v_qip48a/pycares_4a3fc59cfa49446b8e6958924f9b1ffe/
  Complete output (22 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11-x86_64-3.9
  creating build/lib.macosx-11-x86_64-3.9/pycares
  copying src/pycares/errno.py -> build/lib.macosx-11-x86_64-3.9/pycares
  copying src/pycares/_version.py -> build/lib.macosx-11-x86_64-3.9/pycares
  copying src/pycares/__init__.py -> build/lib.macosx-11-x86_64-3.9/pycares
  copying src/pycares/utils.py -> build/lib.macosx-11-x86_64-3.9/pycares
  copying src/pycares/__main__.py -> build/lib.macosx-11-x86_64-3.9/pycares
  running build_ext
  generating cffi module 'build/temp.macosx-11-x86_64-3.9/_cares.c'
  creating build/temp.macosx-11-x86_64-3.9
  building '_cares' extension
  creating build/temp.macosx-11-x86_64-3.9/build
  creating build/temp.macosx-11-x86_64-3.9/build/temp.macosx-11-x86_64-3.9
  creating build/temp.macosx-11-x86_64-3.9/deps
  creating build/temp.macosx-11-x86_64-3.9/deps/c-ares
  creating build/temp.macosx-11-x86_64-3.9/deps/c-ares/src
  /usr/local/bin/gcc-4.2 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DHAVE_CONFIG_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE=1 -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/tcl-tk/include -I/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/include/python3.9 -Ideps/c-ares/src -Ideps/c-ares/src/config_darwin -c build/temp.macosx-11-x86_64-3.9/_cares.c -o build/temp.macosx-11-x86_64-3.9/build/temp.macosx-11-x86_64-3.9/_cares.o
  error: command '/usr/local/bin/gcc-4.2' failed: No such file or directory
  ----------------------------------------
  ERROR: Failed building wheel for pycares

The key issue here is error: command '/usr/local/bin/gcc-4.2' failed: No such file or directory

I looked at my /usr/local/bin, and I have following already installed: gcc-10, gcc-ar-10, gcc-nm-10, gcc-ranlib-10. Do I need to also install gcc-4.2 before pycares can work?

saghul commented 3 years ago

The macOS build is now fixed in master.