saghul/aiodns

too many arguments to function call, expected 6, have 7

stiko opened this issue · 9 comments

stiko commented

I'm getting
build/temp.macosx-10.14-x86_64-3.7/_cares.c:2573:55: error: too many arguments to function call, expected 6, have 7
on pip install aiodns
pip/python version: pip 19.0.3 from path/to/venv/lib/python3.7/site-packages/pip-19.0.3-py3.7.egg/pip (python 3.7)
OS: macOS Mojave 10.14.6

What pycares version is being installed?

stiko commented

None. Trying to install pycares produces the same error

That's not really possible. aiodns uses pycares to do the actual resolution. Do you have any more output?

stiko commented

I think I get it. The error is caused by pycares. This is the output

ERROR: Complete output from command /usr/local/opt/python@2/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/2y/9jk44j2961195sw0srljt3lm0000gn/T/pip-install-5qMY_s/pycares/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/2y/9jk44j2961195sw0srljt3lm0000gn/T/pip-record-Yb0wrQ/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-2.7
    creating build/lib.macosx-10.14-x86_64-2.7/pycares
    copying src/pycares/errno.py -> build/lib.macosx-10.14-x86_64-2.7/pycares
    copying src/pycares/_version.py -> build/lib.macosx-10.14-x86_64-2.7/pycares
    copying src/pycares/__init__.py -> build/lib.macosx-10.14-x86_64-2.7/pycares
    copying src/pycares/utils.py -> build/lib.macosx-10.14-x86_64-2.7/pycares
    copying src/pycares/__main__.py -> build/lib.macosx-10.14-x86_64-2.7/pycares
    running build_ext
    generating cffi module 'build/temp.macosx-10.14-x86_64-2.7/_cares.c'
    creating build/temp.macosx-10.14-x86_64-2.7
    building '_cares' extension
    creating build/temp.macosx-10.14-x86_64-2.7/build
    creating build/temp.macosx-10.14-x86_64-2.7/build/temp.macosx-10.14-x86_64-2.7
    creating build/temp.macosx-10.14-x86_64-2.7/deps
    creating build/temp.macosx-10.14-x86_64-2.7/deps/c-ares
    creating build/temp.macosx-10.14-x86_64-2.7/deps/c-ares/src
    clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -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/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7 -Ideps/c-ares/src -Ideps/c-ares/src/config_darwin -c build/temp.macosx-10.14-x86_64-2.7/_cares.c -o build/temp.macosx-10.14-x86_64-2.7/build/temp.macosx-10.14-x86_64-2.7/_cares.o
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:2573:55: error: too many arguments to function call, expected 6, have 7
      return ares_parse_ptr_reply(x0, x1, x2, x3, x4, x5, x6);
             ~~~~~~~~~~~~~~~~~~~~                         ^~
    /usr/local/include/ares.h:581:14: note: 'ares_parse_ptr_reply' declared here
    CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
                 ^
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:2657:59: error: too many arguments to function call, expected 6, have 7
      { result = ares_parse_ptr_reply(x0, x1, x2, x3, x4, x5, x6); }
                 ~~~~~~~~~~~~~~~~~~~~                         ^~
    /usr/local/include/ares.h:581:14: note: 'ares_parse_ptr_reply' declared here
    CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
                 ^
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4316: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.14-x86_64-2.7/_cares.c:4332: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.14-x86_64-2.7/_cares.c:4372: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.14-x86_64-2.7/_cares.c:4386: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.14-x86_64-2.7/_cares.c:4399: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.14-x86_64-2.7/_cares.c:4411: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.14-x86_64-2.7/_cares.c:4666: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/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4667:48: error: no member named 'ttl' in 'struct ares_mx_reply'
               sizeof(((struct ares_mx_reply *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4690: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/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4691:51: error: no member named 'ttl' in 'struct ares_naptr_reply'
               sizeof(((struct ares_naptr_reply *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4762: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/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4763:49: error: no member named 'ttl' in 'struct ares_soa_reply'
               sizeof(((struct ares_soa_reply *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4780: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/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4781:49: error: no member named 'ttl' in 'struct ares_srv_reply'
               sizeof(((struct ares_srv_reply *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4795: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/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4796:47: error: no member named 'ttl' in 'struct ares_txt_ext'
               sizeof(((struct ares_txt_ext *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-2.7/_cares.c:4807: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/10.0.1/include/stddef.h:120: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 'clang' failed with exit status 1
ERROR: Command "/usr/local/opt/python@2/bin/python2.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/2y/9jk44j2961195sw0srljt3lm0000gn/T/pip-install-5qMY_s/pycares/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/2y/9jk44j2961195sw0srljt3lm0000gn/T/pip-record-Yb0wrQ/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/2y/9jk44j2961195sw0srljt3lm0000gn/T/pip-install-5qMY_s/pycares/

The error is true for both python2/3.

Any idea how to fix this? or is this something for pycares?

You seem to have c-area installed on your system. This is not supported as the version bundled by pycares is not compatible.

You need to uninstall it first.

frmz commented

Any way to install pycares without uninstalling OSX c-ares library? There are a bunch of dependencies on that in brew so its not that easy

stiko commented

I ended up not using this repo

frmz commented

I ended up not using this repo

But unfortunately its used by CCXT

stiko commented

Try putting it in a Docker container