Closed Bug 1144502 Opened 10 years ago Closed 10 months ago

MySQL-python requires gcc 4.9 or later and no pre-4.9 gcc be installed to compile

Categories

(www.mozilla.org :: Bedrock, defect)

Production
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: pmac, Unassigned)

Details

(Whiteboard: [kb=1715438] )

I got this from :mhoye who was attempting to install bedrock and run the tests: ========================= So, this thing below happens if you've got a pre-4.9 gcc installed _as well_ as a 4.9 or later gcc - for some reason it picks 4.8 preferentially, even though 4.9 will fail. (venv)mhoye@hdxr:~/src/bedrock$ pip install -r requirements/compiled.txt Downloading/unpacking MySQL-python==1.2.3c1 (from -r requirements/compiled.txt (line 4)) Downloading MySQL-python-1.2.3c1.tar.gz (89kB): 89kB downloaded Running setup.py (path:/home/mhoye/src/bedrock/venv/build/MySQL-python/setup.py) egg_info for package MySQL-python Downloading/unpacking Jinja2==2.5.5 (from -r requirements/compiled.txt (line 6)) Downloading Jinja2-2.5.5.tar.gz (438kB): 438kB downloaded Running setup.py (path:/home/mhoye/src/bedrock/venv/build/Jinja2/setup.py) egg_info for package Jinja2 warning: no previously-included files matching '*' found under directory 'docs/_build' warning: no previously-included files matching '*.pyc' found under directory 'jinja2' warning: no previously-included files matching '*.pyc' found under directory 'docs' warning: no previously-included files matching '*.pyo' found under directory 'jinja2' warning: no previously-included files matching '*.pyo' found under directory 'docs' Downloading/unpacking lxml==2.3.3 (from -r requirements/compiled.txt (line 8)) Downloading lxml-2.3.3.tar.gz (3.1MB): 3.1MB downloaded Running setup.py (path:/home/mhoye/src/bedrock/venv/build/lxml/setup.py) egg_info for package lxml Building lxml version 2.3.3. Building without Cython. Using build configuration of libxslt 1.1.28 warning: no previously-included files found matching '*.py' Installing collected packages: MySQL-python, Jinja2, lxml Running setup.py install for MySQL-python building '_mysql' extension i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,3,'gamma',1) -D__version__=1.2.3c1 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-i686-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -DTAOCRYPT_DISABLE_X86ASM -g -DNDEBUG i586-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’ error: command 'i586-linux-gnu-gcc' failed with exit status 1 Complete output from command /home/mhoye/src/bedrock/venv/bin/python -c "import setuptools, tokenize;__file__='/home/mhoye/src/bedrock/venv/build/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zVFeoi-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/mhoye/src/bedrock/venv/include/site/python2.7: running install running build running build_py creating build creating build/lib.linux-i686-2.7 copying _mysql_exceptions.py -> build/lib.linux-i686-2.7 creating build/lib.linux-i686-2.7/MySQLdb copying MySQLdb/__init__.py -> build/lib.linux-i686-2.7/MySQLdb copying MySQLdb/converters.py -> build/lib.linux-i686-2.7/MySQLdb copying MySQLdb/connections.py -> build/lib.linux-i686-2.7/MySQLdb copying MySQLdb/cursors.py -> build/lib.linux-i686-2.7/MySQLdb copying MySQLdb/release.py -> build/lib.linux-i686-2.7/MySQLdb copying MySQLdb/times.py -> build/lib.linux-i686-2.7/MySQLdb creating build/lib.linux-i686-2.7/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.7/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.7/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.7/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.7/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.7/MySQLdb/constants copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.7/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.7/MySQLdb/constants running build_ext building '_mysql' extension creating build/temp.linux-i686-2.7 i586-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,3,'gamma',1) -D__version__=1.2.3c1 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-i686-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -DTAOCRYPT_DISABLE_X86ASM -g -DNDEBUG i586-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’ error: command 'i586-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Cleaning up... Command /home/mhoye/src/bedrock/venv/bin/python -c "import setuptools, tokenize;__file__='/home/mhoye/src/bedrock/venv/build/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zVFeoi-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/mhoye/src/bedrock/venv/include/site/python2.7 failed with error code 1 in /home/mhoye/src/bedrock/venv/build/MySQL-python Traceback (most recent call last): File "/home/mhoye/src/bedrock/venv/bin/pip", line 11, in <module> sys.exit(main()) File "/home/mhoye/src/bedrock/venv/local/lib/python2.7/site-packages/pip/__init__.py", line 185, in main return command.main(cmd_args) File "/home/mhoye/src/bedrock/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 64: ordinal not in range(128) ============================ I'm not sure if this is just something we should document, or if there's an upgrade for MySQL-python that would help, or if the install docs should even recommend installing MySQL-python since much dev can happen using SQLite (the default in settings).
Whiteboard: [kb=1715438]

Hi @snowrider - are you looking to run https://github.com/mozilla/bedrock with MySQL? MySQL isn't formally part of our stack (this ticket is 10 years old) - we use Sqlite and/or Postgres locally.

If you're having trouble with the mysql-python library itself, I suggest you check out the open issues on the project https://github.com/farcepest/MySQLdb1/issues - which includes the suggestion to move to mysqlclient instead: https://github.com/farcepest/MySQLdb1/issues/151.

Best of luck solving your problem - in your situation I'd definitely try a different mysql client, as the one you are using looks pretty old.

Steve

Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.