Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#124 1.1.9 setup.py broken for Windows

MySQLdb-1.1
closed
Andy Dustman
MySQLdb (285)
6
2012-09-19
2005-01-21
Andy Dustman
No

The new setup.py uses the mysql_config external program
for determining libraries and other items needed for
compiling client programs. Sadly (for Windows users),
this is a shell script and seems to not be included
with the Windows installation of MySQL-4.1. I will
probably have to add a separate configuration section
for Windows similar to that in 1.1.8 and earlier, but I
am open to suggestions. I have been told by people who
have made Windows packaging that setup.py needed to be
patched anyway, but I have never had specifics on what
the problem might be.

Discussion

1 2 > >> (Page 1 of 2)
  • Andy Dustman
    Andy Dustman
    2005-01-23

    Logged In: YES
    user_id=71372

    The current CVS version should be usable for Windows. Note
    that you must set an environment variable (mysqlroot) that
    is the path to your MySQL installation.

     
  • Logged In: YES
    user_id=274034

    There are some issues with un-initialized variables on
    Windows. Here's one traceback:


    C:\temp\MySQLdb>python setup.py biuld
    Traceback (most recent call last):
    File "setup.py", line 52, in ?
    libraries.extend(['zlib', 'msvcrt', 'libcmt', 'wsock32',
    'advapi32']
    )
    NameError: name 'libraries' is not defined


    I went in to the setup.py and added the following at line 41:
    libraries = []

    My new traceback error is:

    C:\temp\MySQLdb>python setup.py build
    Traceback (most recent call last):
    File "setup.py", line 136, in ?
    extra_compile_args=extra_compile_args,
    NameError: name 'extra_compile_args' is not defined


    For which I added the following at line 42:
    extra_compile_args = []

    Now it runs fine. I get a lot of "unresolved external
    symbol" errors from Visual Studio compiler, but that's
    probably my fault :(

    Note: I would generate a patch for this from diff if I knew
    how to do it and how to submit it. Would that be useful?
    Are you accepting patches from outside?

     
  • Andy Dustman
    Andy Dustman
    2005-01-24

    Logged In: YES
    user_id=71372

    I think I need to add this:

    extra_objects = [ os.path.join(mysqlroot, 'lib',
    

    'mysqlclient.lib') ]

    and add the extra_objects back into the compile options for
    Extension; I think this will fix your symbol problems. I'll
    work on this later tonight.

    You can probably just change libraries.extend() to libraries
    = and make that work.

    Patches are welcome, if you can generate them. diff is the
    usual tool for this, but I'm not optimistic about you having it.

    Looking at the 1.1.8 version may be instructive:

    http://cvs.sourceforge.net/viewcvs.py/mysql-python/MySQLdb/setup.py?rev=1.47&view=markup

     
  • Logged In: YES
    user_id=274034

    I followed your advice on extra_objects and it seems to have
    worked.

    I have generated a patch file for setup.py using diff -c (I
    have cygwin installed). How can I check it in? I assume it
    goes into some testing branch or something.

     
  • Andy Dustman
    Andy Dustman
    2005-01-24

    Logged In: YES
    user_id=71372

    Submit it as an attachment/upload to this bug.

     
  • Logged In: YES
    user_id=274034

    How do I submit an attachment to this bug?

     
  • Andy Dustman
    Andy Dustman
    2005-01-24

    Logged In: YES
    user_id=71372

    Scroll to the bottom.

     
  • Logged In: YES
    user_id=274034

    I see the (empty) list of attachments, but I don't see any
    links there allowing new attachments.

     
  • Andy Dustman
    Andy Dustman
    2005-01-24

    Logged In: YES
    user_id=71372

    So you can't see the bit just above it where it says "Check
    to Upload and Attach a File:"?

     
  • Logged In: YES
    user_id=274034

    Nope. I looked with both Firefox and IE and neither has the
    option to Attach a file. Perhaps one needs developer
    access? Not that I'm asking for it, just a thought as to
    why I can't upload.

     
1 2 > >> (Page 1 of 2)