Asyncpg: fails to compile under pypy

Created on 25 Sep 2018  Â·  7Comments  Â·  Source: MagicStack/asyncpg

Details

  • Python version: Python 3.5.3 (a39af0be3a22, Jun 05 2017, 20:18:00); [PyPy 5.8.0-beta0 with GCC 6.2.0 20160901]
  • Platform: Ubuntu 18.04.1 LTS
  • Do you use pgbouncer?: N/A, failed to install
  • Did you install asyncpg with pip?: Tried to
  • If you built asyncpg locally, which version of Cython did you use?: Installed from pypi
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : N/A, failed to install

Build log

$ cd $(mktemp -d)
$ pypy3 -m venv .
$ source bin/activate
$ pypy3 -m pip install asyncpg
Collecting asyncpg
  Using cached https://files.pythonhosted.org/packages/bb/78/2a2a0fcfe9b0b08cdf5d03907251502fd127395d50c21f430a1645490293/asyncpg-0.17.0.tar.gz
  DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release.
Installing collected packages: asyncpg
  Running setup.py install for asyncpg ... error
    Complete output from command /tmp/tmp.3Bm2olgKoj/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-k9_z22sp/asyncpg/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-eonpx9k1-record/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/tmp.3Bm2olgKoj/include/site/python3.5/asyncpg:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/utils.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/prepared_stmt.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/connection.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/transaction.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/__init__.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/types.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/cursor.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/introspection.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/connresource.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/serverversion.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/connect_utils.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/cluster.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/compat.py -> build/lib.linux-x86_64-3.5/asyncpg
    copying asyncpg/pool.py -> build/lib.linux-x86_64-3.5/asyncpg
    running egg_info
    writing asyncpg.egg-info/PKG-INFO
    writing dependency_links to asyncpg.egg-info/dependency_links.txt
    writing requirements to asyncpg.egg-info/requires.txt
    writing top-level names to asyncpg.egg-info/top_level.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'asyncpg.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.py' under directory 'examples'
    writing manifest file 'asyncpg.egg-info/SOURCES.txt'
    creating build/lib.linux-x86_64-3.5/asyncpg/_testbase
    copying asyncpg/_testbase/__init__.py -> build/lib.linux-x86_64-3.5/asyncpg/_testbase
    copying asyncpg/_testbase/fuzzer.py -> build/lib.linux-x86_64-3.5/asyncpg/_testbase
    creating build/lib.linux-x86_64-3.5/asyncpg/exceptions
    copying asyncpg/exceptions/__init__.py -> build/lib.linux-x86_64-3.5/asyncpg/exceptions
    copying asyncpg/exceptions/_base.py -> build/lib.linux-x86_64-3.5/asyncpg/exceptions
    creating build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/__init__.py -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/buffer.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/buffer.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/consts.pxi -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/coreproto.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/coreproto.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/debug.h -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/debug.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/encodings.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/hton.h -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/hton.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/pgtypes.pxi -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/prepared_stmt.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/prepared_stmt.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/protocol.c -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/protocol.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/protocol.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/python.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/settings.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    copying asyncpg/protocol/settings.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol
    creating build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/__init__.py -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/array.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/base.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/base.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/bits.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/bytea.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/datetime.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/float.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/geometry.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/hstore.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/int.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/json.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/misc.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/money.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/network.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/numeric.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/range.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/record.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/text.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/textutils.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/tid.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/tsearch.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/txid.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    copying asyncpg/protocol/codecs/uuid.pyx -> build/lib.linux-x86_64-3.5/asyncpg/protocol/codecs
    creating build/lib.linux-x86_64-3.5/asyncpg/protocol/record
    copying asyncpg/protocol/record/__init__.pxd -> build/lib.linux-x86_64-3.5/asyncpg/protocol/record
    copying asyncpg/protocol/record/recordobj.c -> build/lib.linux-x86_64-3.5/asyncpg/protocol/record
    copying asyncpg/protocol/record/recordobj.h -> build/lib.linux-x86_64-3.5/asyncpg/protocol/record
    running build_ext
    building 'asyncpg.protocol.protocol' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/asyncpg
    creating build/temp.linux-x86_64-3.5/asyncpg/protocol
    creating build/temp.linux-x86_64-3.5/asyncpg/protocol/record
    cc -pthread -DNDEBUG -O2 -fPIC -I/tmp/tmp.3Bm2olgKoj/include -I/snap/pypy3/2/include -c asyncpg/protocol/record/recordobj.c -o build/temp.linux-x86_64-3.5/asyncpg/protocol/record/recordobj.o -O2 -fsigned-char -Wall -Wsign-compare -Wconversion
    In file included from /snap/pypy3/2/include/Python.h:120:0,
                     from asyncpg/protocol/record/recordobj.h:4,
                     from asyncpg/protocol/record/recordobj.c:9:
    /snap/pypy3/2/include/unicodeobject.h: In function ‘Py_UNICODE_strlen’:
    /snap/pypy3/2/include/unicodeobject.h:341:12: warning: conversion to ‘size_t {aka long unsigned int}’ from ‘int’ may change the sign of the result [-Wsign-conversion]
         return res;
                ^~~
    asyncpg/protocol/record/recordobj.c: In function ‘record_hash’:
    asyncpg/protocol/record/recordobj.c:132:12: error: ‘_PyHASH_MULTIPLIER’ undeclared (first use in this function)
         mult = _PyHASH_MULTIPLIER;
                ^~~~~~~~~~~~~~~~~~
    asyncpg/protocol/record/recordobj.c:132:12: note: each undeclared identifier is reported only once for each function it appears in
    asyncpg/protocol/record/recordobj.c: In function ‘record_richcompare’:
    asyncpg/protocol/record/recordobj.c:165:13: error: ‘Py_RETURN_NOTIMPLEMENTED’ undeclared (first use in this function); did you mean ‘Py_RETURN_NONE’?
                 Py_RETURN_NOTIMPLEMENTED;
                 ^~~~~~~~~~~~~~~~~~~~~~~~
                 Py_RETURN_NONE
    asyncpg/protocol/record/recordobj.c: In function ‘record_subscript’:
    asyncpg/protocol/record/recordobj.c:336:5: warning: implicit declaration of function ‘_PyErr_SetKeyError’; did you mean ‘PyExc_KeyError’? [-Wimplicit-function-declaration]
         _PyErr_SetKeyError(item);
         ^~~~~~~~~~~~~~~~~~
         PyExc_KeyError
    asyncpg/protocol/record/recordobj.c: In function ‘record_repr’:
    asyncpg/protocol/record/recordobj.c:346:5: error: unknown type name ‘_PyUnicodeWriter’; did you mean ‘_PyUnicode_Ready’?
         _PyUnicodeWriter writer;
         ^~~~~~~~~~~~~~~~
         _PyUnicode_Ready
    asyncpg/protocol/record/recordobj.c:358:9: warning: implicit declaration of function ‘Py_ReprEnter’ [-Wimplicit-function-declaration]
         i = Py_ReprEnter((PyObject *)v);
             ^~~~~~~~~~~~
    asyncpg/protocol/record/recordobj.c:364:5: warning: implicit declaration of function ‘_PyUnicodeWriter_Init’; did you mean ‘_PyUnicode_AsString’? [-Wimplicit-function-declaration]
         _PyUnicodeWriter_Init(&writer);
         ^~~~~~~~~~~~~~~~~~~~~
         _PyUnicode_AsString
    asyncpg/protocol/record/recordobj.c:365:11: error: request for member ‘overallocate’ in something not a structure or union
         writer.overallocate = 1;
               ^
    asyncpg/protocol/record/recordobj.c:366:11: error: request for member ‘min_length’ in something not a structure or union
         writer.min_length = 12; /* <Record a=1> */
               ^
    asyncpg/protocol/record/recordobj.c:368:9: warning: implicit declaration of function ‘_PyUnicodeWriter_WriteASCIIString’; did you mean ‘PyUnicode_CompareWithASCIIString’? [-Wimplicit-function-declaration]
         if (_PyUnicodeWriter_WriteASCIIString(&writer, "<Record ", 8) < 0) {
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             PyUnicode_CompareWithASCIIString
    asyncpg/protocol/record/recordobj.c:378:17: warning: implicit declaration of function ‘_PyUnicodeWriter_WriteChar’; did you mean ‘PyUnicode_FromWideChar’? [-Wimplicit-function-declaration]
                 if (_PyUnicodeWriter_WriteChar(&writer, ' ') < 0) {
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
                     PyUnicode_FromWideChar
    asyncpg/protocol/record/recordobj.c:406:13: warning: implicit declaration of function ‘_PyUnicodeWriter_WriteStr’; did you mean ‘PyUnicode_InternFromString’? [-Wimplicit-function-declaration]
             if (_PyUnicodeWriter_WriteStr(&writer, key_repr) < 0) {
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
                 PyUnicode_InternFromString
    asyncpg/protocol/record/recordobj.c:425:11: error: request for member ‘overallocate’ in something not a structure or union
         writer.overallocate = 0;
               ^
    asyncpg/protocol/record/recordobj.c:431:5: warning: implicit declaration of function ‘Py_ReprLeave’ [-Wimplicit-function-declaration]
         Py_ReprLeave((PyObject *)v);
         ^~~~~~~~~~~~
    asyncpg/protocol/record/recordobj.c:432:12: warning: implicit declaration of function ‘_PyUnicodeWriter_Finish’; did you mean ‘_PyUnicode_AsString’? [-Wimplicit-function-declaration]
         return _PyUnicodeWriter_Finish(&writer);
                ^~~~~~~~~~~~~~~~~~~~~~~
                _PyUnicode_AsString
    asyncpg/protocol/record/recordobj.c:432:12: warning: return makes pointer from integer without a cast [-Wint-conversion]
         return _PyUnicodeWriter_Finish(&writer);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    asyncpg/protocol/record/recordobj.c:436:5: warning: implicit declaration of function ‘_PyUnicodeWriter_Dealloc’; did you mean ‘_PyUnicode_Ready’? [-Wimplicit-function-declaration]
         _PyUnicodeWriter_Dealloc(&writer);
         ^~~~~~~~~~~~~~~~~~~~~~~~
         _PyUnicode_Ready
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/tmp/tmp.3Bm2olgKoj/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-k9_z22sp/asyncpg/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-eonpx9k1-record/install-record.txt --single-version-externally-managed --compile --install-headers /tmp/tmp.3Bm2olgKoj/include/site/python3.5/asyncpg" failed with error code 1 in /tmp/pip-build-k9_z22sp/asyncpg/
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Most helpful comment

Is PyPy support somewhere on the roadmap?

All 7 comments

asyncpg has no official support for PyPy yet.

Is PyPy support somewhere on the roadmap?

there are quite a few resources listed under https://bitbucket.org/pypy/compatibility/wiki/Home#!db-adaptors for pypy compatible Postgres libraries. That said, I'd prefer to continue to use asyncpg.

Having the same problem too

Any progress on this?

Asyncpg is one of my core libs for building microservices... and that is the only reason I do not use pypy for now, as I need asyncpg. pypy support is VERY VERY wanted. asyncpg busts performance for database interaction... but pypy adds performance for the rest of the code. It is really important.

Currently using Docker's python:3.7 due to unable to compile under python:3.7-alpine.

Was this page helpful?
0 / 5 - 0 ratings