Failed to build on Apple's M1, arm64 architecture (osx-arm64)
See original GitHub issueHello, I’m using one of the new Apple M1 MacBooks with the ARM processor. I tried to install another package where pycares is a dependency, and I got the following error. Any suggestions for a fix? Not sure if this is the problem, but I see a lot of references to x86
and -arch x86_64
, which is the Intel arch.
Failed to build pycares Installing collected packages: pycares, async-timeout, aiohttp, aiodns, ccxt Running setup.py install for pycares ... error ERROR: Command errored out with exit status 1: command: /Users/ryan/miniforge3/envs/ft/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6g/73g1_dms191f5pj1mc5n8byh0000gn/T/pip-install-1nnuf10i/pycares_9779f70fc2de401684607222c93c0ad1/setup.py'"'"'; __file__='"'"'/private/var/folders/6g/73g1_dms191f5pj1mc5n8byh0000gn/T/pip-install-1nnuf10i/pycares_9779f70fc2de401684607222c93c0ad1/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/6g/73g1_dms191f5pj1mc5n8byh0000gn/T/pip-record-zjqxxs6d/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ryan/miniforge3/envs/ft/include/python3.8/pycares cwd: /private/var/folders/6g/73g1_dms191f5pj1mc5n8byh0000gn/T/pip-install-1nnuf10i/pycares_9779f70fc2de401684607222c93c0ad1/ Complete output (105 lines): running install running build running build_py creating build creating build/lib.macosx-10.9-x86_64-3.8 creating build/lib.macosx-10.9-x86_64-3.8/pycares copying src/pycares/errno.py -> build/lib.macosx-10.9-x86_64-3.8/pycares copying src/pycares/_version.py -> build/lib.macosx-10.9-x86_64-3.8/pycares copying src/pycares/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/pycares copying src/pycares/utils.py -> build/lib.macosx-10.9-x86_64-3.8/pycares copying src/pycares/__main__.py -> build/lib.macosx-10.9-x86_64-3.8/pycares running build_ext generating cffi module 'build/temp.macosx-10.9-x86_64-3.8/_cares.c' creating build/temp.macosx-10.9-x86_64-3.8 building '_cares' extension creating build/temp.macosx-10.9-x86_64-3.8/build creating build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8 creating build/temp.macosx-10.9-x86_64-3.8/deps creating build/temp.macosx-10.9-x86_64-3.8/deps/c-ares creating build/temp.macosx-10.9-x86_64-3.8/deps/c-ares/src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ryan/miniforge3/envs/ft/include -arch x86_64 -I/Users/ryan/miniforge3/envs/ft/include -arch x86_64 -DHAVE_CONFIG_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE=1 -I/Users/ryan/miniforge3/envs/ft/include/python3.8 -Ideps/c-ares/src -Ideps/c-ares/src/config_darwin -c build/temp.macosx-10.9-x86_64-3.8/_cares.c -o build/temp.macosx-10.9-x86_64-3.8/build/temp.macosx-10.9-x86_64-3.8/_cares.o build/temp.macosx-10.9-x86_64-3.8/_cares.c:2682:55: error: too many arguments to function call, expected 6, have 7 return ares_parse_ptr_reply(x0, x1, x2, x3, x4, x5, x6); ~~~~~~~~~~~~~~~~~~~~ ^~ /Users/ryan/miniforge3/envs/ft/include/ares.h:653:14: note: 'ares_parse_ptr_reply' declared here CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:2760:59: error: too many arguments to function call, expected 6, have 7 { result = ares_parse_ptr_reply(x0, x1, x2, x3, x4, x5, x6); } ~~~~~~~~~~~~~~~~~~~~ ^~ /Users/ryan/miniforge3/envs/ft/include/ares.h:653:14: note: 'ares_parse_ptr_reply' declared here CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4403:14: error: no member named 'ttl' in 'struct ares_mx_reply' (void)((p->ttl) | 0); /* check that 'struct ares_mx_reply.ttl' is an integer */ ~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4419:14: error: no member named 'ttl' in 'struct ares_naptr_reply' (void)((p->ttl) | 0); /* check that 'struct ares_naptr_reply.ttl' is an integer */ ~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4459:14: error: no member named 'ttl' in 'struct ares_soa_reply' (void)((p->ttl) | 0); /* check that 'struct ares_soa_reply.ttl' is an integer */ ~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4473:14: error: no member named 'ttl' in 'struct ares_srv_reply' (void)((p->ttl) | 0); /* check that 'struct ares_srv_reply.ttl' is an integer */ ~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4486:14: error: no member named 'ttl' in 'struct ares_txt_ext' (void)((p->ttl) | 0); /* check that 'struct ares_txt_ext.ttl' is an integer */ ~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4498:14: error: no member named 'ttl' in 'struct ares_txt_reply' (void)((p->ttl) | 0); /* check that 'struct ares_txt_reply.ttl' is an integer */ ~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4757:12: error: no member named 'ttl' in 'ares_mx_reply' { "ttl", offsetof(struct ares_mx_reply, ttl), ^ ~~~ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof' #define offsetof(t, d) __builtin_offsetof(t, d) ^ ~ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4758:48: error: no member named 'ttl' in 'struct ares_mx_reply' sizeof(((struct ares_mx_reply *)0)->ttl), ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4781:12: error: no member named 'ttl' in 'ares_naptr_reply' { "ttl", offsetof(struct ares_naptr_reply, ttl), ^ ~~~ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof' #define offsetof(t, d) __builtin_offsetof(t, d) ^ ~ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4782:51: error: no member named 'ttl' in 'struct ares_naptr_reply' sizeof(((struct ares_naptr_reply *)0)->ttl), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4853:12: error: no member named 'ttl' in 'ares_soa_reply' { "ttl", offsetof(struct ares_soa_reply, ttl), ^ ~~~ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof' #define offsetof(t, d) __builtin_offsetof(t, d) ^ ~ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4854:49: error: no member named 'ttl' in 'struct ares_soa_reply' sizeof(((struct ares_soa_reply *)0)->ttl), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4871:12: error: no member named 'ttl' in 'ares_srv_reply' { "ttl", offsetof(struct ares_srv_reply, ttl), ^ ~~~ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof' #define offsetof(t, d) __builtin_offsetof(t, d) ^ ~ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4872:49: error: no member named 'ttl' in 'struct ares_srv_reply' sizeof(((struct ares_srv_reply *)0)->ttl), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4886:12: error: no member named 'ttl' in 'ares_txt_ext' { "ttl", offsetof(struct ares_txt_ext, ttl), ^ ~~~ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof' #define offsetof(t, d) __builtin_offsetof(t, d) ^ ~ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4887:47: error: no member named 'ttl' in 'struct ares_txt_ext' sizeof(((struct ares_txt_ext *)0)->ttl), ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ build/temp.macosx-10.9-x86_64-3.8/_cares.c:4898:12: error: no member named 'ttl' in 'ares_txt_reply' { "ttl", offsetof(struct ares_txt_reply, ttl), ^ ~~~ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof' #define offsetof(t, d) __builtin_offsetof(t, d) ^ ~ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/ryan/miniforge3/envs/ft/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6g/73g1_dms191f5pj1mc5n8byh0000gn/T/pip-install-1nnuf10i/pycares_9779f70fc2de401684607222c93c0ad1/setup.py'"'"'; __file__='"'"'/private/var/folders/6g/73g1_dms191f5pj1mc5n8byh0000gn/T/pip-install-1nnuf10i/pycares_9779f70fc2de401684607222c93c0ad1/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/6g/73g1_dms191f5pj1mc5n8byh0000gn/T/pip-record-zjqxxs6d/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ryan/miniforge3/envs/ft/include/python3.8/pycares Check the logs for full command output.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11
Top GitHub Comments
Same issue I was having. Looks like it was a conflict with
c-ares
installed bybrew
.brew uninstall c-ares unbound nghttp2 gnutls
(those are all the dependents of c-ares I had on my install)If something breaks I’ll just reinstall them. But for now everything works.
Thanks qosmio, that seems to have done the trick for me. I stuck with Python 3.8 for this reason, now it seems i can use 3.9