#219 build breaks, Solaris 10/amd64, w/ MySQL Enterprise 5.0.28

MySQLdb-1.2
closed
Andy Dustman
MySQLdb (285)
5
2012-09-19
2006-11-25
Toby Thain
No

When the 32-bit MySQL Enterprise package for Solaris 10 is installed, mysql-config returns the following options:

    --cflags         [-I/opt/mysql/mysql/include -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic]
    --include        [-I/opt/mysql/mysql/include]
    --libs           [-L/opt/mysql/mysql/lib -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm]
    --libs_r         [-L/opt/mysql/mysql/lib -lmysqlclient_r -lz -lpthread -lthread -lposix4 -lgen -lsocket -lnsl -lm -lpthread -lthread]
    --socket         [/tmp/mysql.sock]
    --port           [3306]
    --version        [5.0.28]
    --libmysqld-libs [-L/opt/mysql/mysql/lib -lmysqld -lz -lpthread -lthread -lposix4 -lgen -lsocket -lnsl -lm -lpthread -lthread   -lrt]

The '%' signs embedded in certain Sun cc compiler options break setup.py spectacularly:

Traceback (most recent call last):
File "setup.py", line 117, in ?
setup(**metadata)
... snip ...
File "/usr/sfw/lib/python2.3/distutils/log.py", line 23, in _log
print msg % args
TypeError: not enough arguments for format string

A simple-minded kludge of filtering these options out confirms that they are the cause of the breakage. (It happens to be quite safe to remove these two options [-ftrap=%none -xbuiltin=%all], but this is not the right fix to the build script, of course, so I have not attached a patch.)

Discussion

  • Andy Dustman
    Andy Dustman
    2007-02-10

    Logged In: YES
    user_id=71372
    Originator: NO

    You never explicitly reported your MySQLdb version number. Anyway, this looks like a problem in distutils.

     
  • Toby Thain
    Toby Thain
    2007-02-11

    Logged In: YES
    user_id=831113
    Originator: YES

    Yes, I did: in subject line. "MySQL Enterprise 5.0.28", but that's hardly relevant.

    Does your answer imply that this bug should be filed elsewhere?

     
  • Andy Dustman
    Andy Dustman
    2007-02-11

    Logged In: YES
    user_id=71372
    Originator: NO

    That is your MySQL version, not MySQLdb version. And since MySQLdb is what you were filing the bug on, I consider an exact version number to be pretty important.

    distutils is a standard Python module.

    I could probably escape any percent signs in compiler flags without much trouble. In 1.2.2b3, you would do this in setup_posix.py.

     
  • Andy Dustman
    Andy Dustman
    2007-02-11

    Logged In: YES
    user_id=71372
    Originator: NO

    Fix in r476.

     
  • Toby Thain
    Toby Thain
    2007-02-11

    Logged In: YES
    user_id=831113
    Originator: YES

    Sorry, misunderstood re version number. Thanks for fix.