Success Natively Compiling Python-2.3.4 in Mingw?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • A. B., Khalid

    Success Natively Compiling Python-2.3.4 in Mingw?

    Hello all.

    After a search on Google it would seem that the users of
    Mingw have not had good results in compiling the python
    sources natively. See at least:

    [1] http://uucode.com/texts/python-mingw/python-mingw.html


    Having said that, kindly allow me to report that Mingw32 can
    now compile python-2.3.4 sources natively. Both Mingw make files
    and DEV-C++ project files can now compile the python sources.
    There is surely more to be done to remove even more rough
    edges; but the results are very promising.

    The compiled python is, for now, renamed to python23 so as to keep
    my clean working copy of Python-2.1 unaffected.


    +---------------------------------------------------------------+
    My system:
    +---------------------------------------------------------------+
    + Win98
    + Mingw v. 3.2
    + DEV-C++ v. 4.9.8.5
    + MYSYS v. 1.0.9


    +---------------------------------------------------------------+
    For file sizes, here is the list:
    +---------------------------------------------------------------+
    PYTHON23 EXE 11,776 20/06/04 19:24 python23.exe
    PYTHONW EXE 12,800 20/06/04 19:29 pythonw.exe
    PYTHON23 DLL 1,224,704 20/06/04 20:05 python23.dll
    W9XPOPEN EXE 12,288 19/06/04 8:07 w9xpopen.exe


    +---------------------------------------------------------------+
    Running python23 from MSYS:
    +---------------------------------------------------------------+
    $ python23 -i
    Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
    Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
    >>> 1+2[/color][/color][/color]
    3[color=blue][color=green][color=darkred]
    >>>[/color][/color][/color]


    +---------------------------------------------------------------+
    Summary of regrtest.main() output:
    +---------------------------------------------------------------+
    204 tests OK.
    1 test failed:
    test_datetime
    50 tests skipped:
    test_aepack test_al test_bsddb test_bsddb185 test_bsddb3 test_bz2
    test_cd test_cl test_commands test_crypt test_curses test_dbm
    test_dl test_email_code cs test_fcntl test_fork1 test_gdbm test_gl
    test_grp test_gzip test_imgfile test_ioctl test_largefile
    test_linuxaudio dev test_macfs test_macostools test_mhlib test_mpz
    test_nis test_normalizat ion test_openpty test_ossaudiode v
    test_pep277 test_plistlib test_poll test_posix test_pty test_pwd
    test_resource test_scriptpack ages test_signal test_socket_ssl
    test_socketserv er test_sunaudiode v test_timeout test_timing
    test_urllibnet test_zipfile test_zipimport test_zlib
    6 skips unexpected on win32:
    test_bz2 test_zipfile test_bsddb test_zipimport test_gzip
    test_zlib


    +---------------------------------------------------------------+
    More on test_datetime:
    +---------------------------------------------------------------+
    E:\Python23>pyt hon23
    Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
    Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
    >>> from test import test_datetime[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "E:\PYTHON23\li b\test\test_dat etime.py", line 2821, in ?
    Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")
    TypeError: cannot create 'USTimeZone' instances[color=blue][color=green][color=darkred]
    >>>[/color][/color][/color]


    +---------------------------------------------------------------+
    A closer inspection of test test_socket:
    +---------------------------------------------------------------+
    $ /e/python23/python23.exe -i
    Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
    Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
    >>> import test_socket as t
    >>> t.test_main()[/color][/color][/color]
    testCrucialCons tants (test_socket.Ge neralModuleTest s) ... ok
    testDefaultTime out (test_socket.Ge neralModuleTest s) ... ok
    testGetServByNa me (test_socket.Ge neralModuleTest s) ... ok
    testGetSockOpt (test_socket.Ge neralModuleTest s) ... ok
    testHostnameRes (test_socket.Ge neralModuleTest s) ... ok
    testIPv4toStrin g (test_socket.Ge neralModuleTest s) ... ok
    testIPv6toStrin g (test_socket.Ge neralModuleTest s) ... ok
    testInterpreter Crash (test_socket.Ge neralModuleTest s) ... ok
    testNtoH (test_socket.Ge neralModuleTest s) ... ok
    testRefCountGet NameInfo (test_socket.Ge neralModuleTest s) ... ok
    testSendAfterCl ose (test_socket.Ge neralModuleTest s) ... ok
    testSetSockOpt (test_socket.Ge neralModuleTest s) ... ok
    testSockName (test_socket.Ge neralModuleTest s) ... ok
    testSocketError (test_socket.Ge neralModuleTest s) ... ok
    testStringToIPv 4 (test_socket.Ge neralModuleTest s) ... ok
    testStringToIPv 6 (test_socket.Ge neralModuleTest s) ... ok
    testFromFd (test_socket.Ba sicTCPTest) ... ok
    testOverFlowRec v (test_socket.Ba sicTCPTest) ... ok
    testOverFlowRec vFrom (test_socket.Ba sicTCPTest) ... ok
    testRecv (test_socket.Ba sicTCPTest) ... ok
    testRecvFrom (test_socket.Ba sicTCPTest) ... ok
    testSendAll (test_socket.Ba sicTCPTest) ... ok
    testShutdown (test_socket.Ba sicTCPTest) ... ok
    testTCPTimeout (test_socket.TC PTimeoutTest) ... ok
    testTimeoutZero (test_socket.TC PTimeoutTest) ... ok
    testExceptionTr ee (test_socket.Te stExceptions) ... ok
    testRecvFrom (test_socket.Ba sicUDPTest) ... ok
    testSendtoAndRe cv (test_socket.Ba sicUDPTest) ... ok
    testTimeoutZero (test_socket.UD PTimeoutTest) ... ok
    testUDPTimeout (test_socket.UD PTimeoutTest) ... ok
    testAccept (test_socket.No nBlockingTCPTes ts) ... ERROR
    ERROR
    testConnect (test_socket.No nBlockingTCPTes ts) ... ok
    testRecv (test_socket.No nBlockingTCPTes ts) ... ERROR
    testSetBlocking (test_socket.No nBlockingTCPTes ts) ... ok
    testFullRead (test_socket.Fi leObjectClassTe stCase) ... ok
    testReadline (test_socket.Fi leObjectClassTe stCase) ... ok
    testSmallRead (test_socket.Fi leObjectClassTe stCase) ... ok
    testUnbufferedR ead (test_socket.Fi leObjectClassTe stCase) ... ok
    testFullRead (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
    testReadline (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
    testSmallRead (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
    testUnbufferedR ead (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
    testUnbufferedR eadline (test_socket.Un bufferedFileObj ectClassTestCas e) ... ok
    testFullRead (test_socket.Li neBufferedFileO bjectClassTestC ase) ... ok
    testReadline (test_socket.Li neBufferedFileO bjectClassTestC ase) ... ok
    testSmallRead (test_socket.Li neBufferedFileO bjectClassTestC ase) ... ok
    testUnbufferedR ead (test_socket.Li neBufferedFileO bjectClassTestC ase) ... ok
    testFullRead (test_socket.Sm allBufferedFile ObjectClassTest Case) ... ok
    testReadline (test_socket.Sm allBufferedFile ObjectClassTest Case) ... ok
    testSmallRead (test_socket.Sm allBufferedFile ObjectClassTest Case) ... ok
    testUnbufferedR ead (test_socket.Sm allBufferedFile ObjectClassTest Case) ... ok

    =============== =============== =============== =============== ==========
    ERROR: testAccept (test_socket.No nBlockingTCPTes ts)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "E:\PYTHON23\li b\test\test_soc ket.py", line 543, in testAccept
    read, write, err = select.select([self.serv], [], [])
    ValueError: filedescriptor out of range in select()

    =============== =============== =============== =============== ==========
    ERROR: testAccept (test_socket.No nBlockingTCPTes ts)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "E:\PYTHON23\li b\test\test_soc ket.py", line 117, in _tearDown
    self.fail(msg)
    File "E:\PYTHON234\P YTHON-2.3.4\lib\unitt est.py", line 270, in fail
    raise self.failureExc eption, msg
    AssertionError: (10061, 'Connection refused')

    =============== =============== =============== =============== ==========
    ERROR: testRecv (test_socket.No nBlockingTCPTes ts)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "E:\PYTHON23\li b\test\test_soc ket.py", line 571, in testRecv
    read, write, err = select.select([conn], [], [])
    ValueError: filedescriptor out of range in select()

    ----------------------------------------------------------------------
    Ran 51 tests in 14.340s

    FAILED (errors=3)
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "E:\PYTHON23\li b\test\test_soc ket.py", line 752, in test_main
    test_support.ru n_unittest(*tes ts)
    File "test_support.p y", line 262, in run_unittest
    run_suite(suite , testclass)
    File "test_support.p y", line 246, in run_suite
    raise TestFailed(msg)
    test.test_suppo rt.TestFailed: errors occurred; run in verbose mode for details[color=blue][color=green][color=darkred]
    >>>[/color][/color][/color]


    +---------------------------------------------------------------+
    Test test_socket passes or fails?
    +---------------------------------------------------------------+
    Why regrtest.main() is reporting that test_socket passes, when
    test_socket itself reports that it fails is beyond me. Mind you,
    however, that the socket module itself can run the simple echo
    client/server(s) that were modified by me and which came with
    python21 without problems.


    +---------------------------------------------------------------+
    Summary of changes:
    +---------------------------------------------------------------+
    Number of files changed in source Python-2.3.4.tar.bz2: 10


    +---------------------------------------------------------------+
    Overview of all changes which number 16:
    +---------------------------------------------------------------+
    [1] 3 changes in socketmodule.c
    [2] 1 change in socketmodule.h
    (The test fails or passes?)
    [3] 2 changes in posixmodule.c
    [4] 1 change in _csv.c
    [5] 5 changes in datetimemodule. c
    (test_datetime. py is the (only?) test that fails;
    Note that the module appears loadable, however.
    And seems able to run some of its methods; after all
    test_calendar passes).
    [6] 1 change in _winreg.c
    [7] 1 change in ../PC/pyconfig.h
    [8] Not using python_nt.rc
    (Using pythoncore_priv ate.rc, & python_mingw.rc instead).
    [9] 1 change in dynload_win.c
    [10] 1 change in thread_pthread. c (This file is ignored, I think).


    +---------------------------------------------------------------+
    Sources are guarded:
    +---------------------------------------------------------------+
    Most changes guard the original source and are in the form of:
    /* My addition/change */
    /* Comment...*/
    #if defined(__MINGW 32__)
    /*define or do something*/
    #else
    original python source code here
    #endif


    +---------------------------------------------------------------+
    Last words:
    +---------------------------------------------------------------+
    If someone can kindly verify that the failed tests are not
    serious (they don't seem to be; I even don't have the datetime
    module in my current Python-2.1) or can be fixed, or if many people
    are interested in documentation of the source changes, then I'll
    be more than happy to share them.

    Peace





    --
    Q. The purpose of life?

    [A]: "I created the jinn and humankind only that they might
    worship Me." (Translation, Qur'an, 51:56)

    [B]: "Let us hear the conclusion of the whole matter:
    Fear God, and keep his commandments: for this is the
    whole duty of man." (KJV, Ecclesiastes 12:13)
  • cmkl

    #2
    Re: Success Natively Compiling Python-2.3.4 in Mingw?

    abkhd@earth.co. jp (A. B., Khalid) wrote in message news:<8ad8ad0a. 0406201608.7f78 5c3d@posting.go ogle.com>...[color=blue]
    > Hello all.
    > If someone can kindly verify that the failed tests are not
    > serious (they don't seem to be; I even don't have the datetime
    > module in my current Python-2.1) or can be fixed, or if many people
    > are interested in documentation of the source changes, then I'll
    > be more than happy to share them.
    >
    > Peace
    >[/color]

    Providing patches for a working mingw compilation would be great.

    Carl

    Comment

    Working...