question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to build on Apple's M1, arm64 architecture (osx-arm64)

See original GitHub issue

Hello, 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:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

3reactions
qosmiocommented, Jan 8, 2021

Same issue I was having. Looks like it was a conflict with c-ares installed by brew.

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.

1reaction
ppkantorskicommented, Feb 7, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build to simulator on Apple Silicon
Using Xcode 12.2, the specific error is "building for iOS Simulator, ... me): the Simulator should run on the arm64 architecture on an...
Read more >
Xcode throwing arm64 architecture error for Macmini with M1 ...
Go into the project Build Settings; Set "Build Active Architecture Only" as "Yes" for both Debug and Release options; Clean the build folder ......
Read more >
Compilation on MacOS Monterey M1 (ARM64 architecture)
1 on M1 (ARM64) fails. Steps : reinstall Homebrew for ARM64 (instead of usr/local/ this installs homebrew to the arm64 compatible directory opt ......
Read more >
Apple M1 – Xcode error when build in simulator - Narlei Moreira
If you have seen this error: “Building for iOS Simulator, but linking in dylib built for iOS, file for architecture arm64.
Read more >
Compiling for iOS on Apple M1 - Mercari Engineering Blog
Project compilation on M1 · The project build architectures should be set to default (armv7, arm64) · Xcode will automatically build a x86_64-sim ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found