Skip to content

Compilation fails with MariaDB #275

@foobar26

Description

@foobar26

Hi,
I tried to compile the latest release (1.9.1) on most recent Ubuntu 18.04.3 LTS with MariaDB (1:10.1.47-0ubuntu0.18.04.1) with libmariadb-dev (3.0.3-1build1), and compilation fails:

Building wheels for collected packages: tokenserver, mysqlclient, SyncStorage
  Building wheel for tokenserver (setup.py) ... done
  Created wheel for tokenserver: filename=tokenserver-1.5.11-py2-none-any.whl size=76558 sha256=70b10a271f456222cd1cb091f77a7378e5053d60f277781c418cd193642d8569
  Stored in directory: /tmp/pip-ephem-wheel-cache-Iwe4YO/wheels/4d/d7/f6/122711ae13201bd78899e3cc414356532f97c5e55f790a11c3
  Building wheel for mysqlclient (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /var/lib/syncserver_1.9_doesntWork/local/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-L6APrD/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-L6APrD/mysqlclient/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 /tmp/pip-wheel-ytsKvD
       cwd: /tmp/pip-install-L6APrD/mysqlclient/
  Complete output (39 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/compat.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
  creating build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  running build_ext
  building 'MySQLdb._mysql' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/MySQLdb
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wno-error -Wno-error=format-security -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I/usr/include/python2.7 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o
  MySQLdb/_mysql.c: In function ‘_mysql_field_to_python’:
  MySQLdb/_mysql.c:1145:33: warning: passing argument 1 of ‘PyInt_FromString’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
           return PyInt_FromString(rowitem, NULL, 10);
                                   ^~~~~~~
  In file included from /usr/include/python2.7/Python.h:89:0,
                   from MySQLdb/_mysql.c:38:
  /usr/include/python2.7/intobject.h:37:24: note: expected ‘char *’ but argument is of type ‘const char *’
   PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
                          ^~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wno-error -Wno-error=format-security -fPIC build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o -L/usr/lib/x86_64-linux-gnu/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto -o build/lib.linux-x86_64-2.7/MySQLdb/_mysql.so
  /usr/bin/ld: -lz kann nicht gefunden werden
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
  Building wheel for SyncStorage (setup.py) ... done
  Created wheel for SyncStorage: filename=SyncStorage-1.8.0-py2-none-any.whl size=134927 sha256=6eefeda3880df7974407a1642508d4cb8f0685b345b9071382cd2ccbeaa18584
  Stored in directory: /tmp/pip-ephem-wheel-cache-Iwe4YO/wheels/1a/b3/a7/c4a20c59595db53cc096c436c87cac53ffd9c3aff36e5901b5
Successfully built tokenserver SyncStorage
Failed to build mysqlclient
Installing collected packages: simplejson, repoze.lru, zope.deprecation, zope.interface, PasteDeploy, venusian, WebOb, translationstring, pyramid, cornice, gunicorn, chardet, certifi, idna, urllib3, requests, SQLAlchemy, six, linecache2, traceback2, unittest2, zope.event, zope.component, configparser, konfig, mozsvc, futures, backports.functools-lru-cache, soupsieve, umemcache, pyasn1, pyasn1-modules, rsa, cachetools, google-auth, protobuf, pyparsing, packaging, enum34, grpcio, googleapis-common-protos, pytz, grpcio-gcp, google-api-core, google-cloud-core, grpc-google-iam-v1, google-cloud-spanner, python-dateutil, python-editor, MarkupSafe, Mako, alembic, asn1crypto, boto, ipaddress, pycparser, cffi, cryptography, greenlet, gevent, hawkauthlib, hupper, mysqlclient, Paste, plaster, plaster-pastedeploy, PyBrowserID, PyJWT, PyFxA, PyMySQL, pymysql-sa, testfixtures, tokenlib, tokenserver, pyramid-hawkauth, wsgiproxy, waitress, beautifulsoup4, webtest, SyncStorage
    Running setup.py install for mysqlclient ... error
    ERROR: Command errored out with exit status 1:
     command: /var/lib/syncserver_1.9_doesntWork/local/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-L6APrD/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-L6APrD/mysqlclient/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-record-Sitrjc/install-record.txt --single-version-externally-managed --compile --install-headers /var/lib/syncserver_1.9_doesntWork/local/include/site/python2.7/mysqlclient
         cwd: /tmp/pip-install-L6APrD/mysqlclient/
    Complete output (39 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/compat.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
    creating build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    running build_ext
    building 'MySQLdb._mysql' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/MySQLdb
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wno-error -Wno-error=format-security -fPIC -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I/usr/include/python2.7 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o
    MySQLdb/_mysql.c: In function ‘_mysql_field_to_python’:
    MySQLdb/_mysql.c:1145:33: warning: passing argument 1 of ‘PyInt_FromString’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
             return PyInt_FromString(rowitem, NULL, 10);
                                     ^~~~~~~
    In file included from /usr/include/python2.7/Python.h:89:0,
                     from MySQLdb/_mysql.c:38:
    /usr/include/python2.7/intobject.h:37:24: note: expected ‘char *’ but argument is of type ‘const char *’
     PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int);
                            ^~~~~~~~~~~~~~~~
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wno-error -Wno-error=format-security -fPIC build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o -L/usr/lib/x86_64-linux-gnu/ -lmariadb -lz -ldl -lm -lpthread -lssl -lcrypto -o build/lib.linux-x86_64-2.7/MySQLdb/_mysql.so
    /usr/bin/ld: -lz kann nicht gefunden werden
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /var/lib/syncserver_1.9_doesntWork/local/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-L6APrD/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-L6APrD/mysqlclient/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-record-Sitrjc/install-record.txt --single-version-externally-managed --compile --install-headers /var/lib/syncserver_1.9_doesntWork/local/include/site/python2.7/mysqlclient Check the logs for full command output.
Makefile:27: recipe for target 'local/COMPLETE' failed
make: *** [local/COMPLETE] Error 1


I already fiddled around with the mysql.h, but couldn't find a working solution.
Is there anything I can do to prevent the mysql package from being built or to fix this issue?

Thanks in advance,
Frank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions