[Python-Dev] Building Python with Visual C++ 2005 Express Edition

Paul Moore p.f.moore at gmail.com
Sat Nov 12 16:20:35 CET 2005


On 11/10/05, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Christos Georgiou wrote:
> > I didn't see any mention of this product in the Python-Dev list, so I
> > thought to let you know.
> >
> > http://msdn.microsoft.com/vstudio/express/visualc/download/
> >
> > There is also a link for a CD image (.img) file to download.
> >
> > I am downloading now, so I don't know yet whether Python compiles with it
> > without any problems.  So if anyone has previous experience, please reply.
>
> I don't have previous experience, but I think this it likely shares the
> issues that VS.NET 2005 has with the current code:
> 1. the project files are for VS.NET 2003. In theory, conversion to
>     the new format is supported, but I don't know whether this conversion
>     works flawlessly.
> 2. MS broke ISO C conformance in VS.NET 2005 in a way that affects
>     Python's signal handling. There is a patch on SF which addresses
>     the issue, but that hasn't been checked in yet.

FWIW, I downloaded Visual C++ 2005 Express edition, and the latest
platform SDK, and had a go at building Python trunk.

I just followed the build instructions from PCBuild\readme.txt as best
I could - of the optional packages, I only got zlib to work. The
issues with the other modules may or may not be serious - for example,
bzip2 is now at version 1.0.3, and the old source isn't available.
Just renaming the directory didn't work, but I didn't bother
investigating further.

I applied the patch you mentioned, but otherwise left everything unchanged.

The project file conversions seemed to go fine, and the debug builds
were OK, although the deprecation warnings for all the "insecure" CRT
functions was a pain. It might be worth adding
_CRT_SECURE_NO_DEPRECATE to the project defines somehow.

I then ran the test suite, which mostly worked.

Results:

235 tests OK.
5 tests failed:
    test_asynchat test_cookie test_grammar test_mmap test_profile
58 tests skipped:
    test__locale test_aepack test_al test_applesingle test_bsddb185
    test_bsddb3 test_cd test_cl test_cmd_line test_code
    test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp
    test_codecmaps_kr test_codecmaps_tw test_coding test_commands
    test_crypt test_curses test_dbm test_dl test_fcntl test_float
    test_fork1 test_functional test_gdbm test_gl test_grp test_hashlib
    test_hashlib_speed test_imgfile test_ioctl test_largefile
    test_linuxaudiodev test_macfs test_macostools test_mhlib test_nis
    test_normalization test_openpty test_ossaudiodev test_plistlib
    test_poll test_posix test_pty test_pwd test_resource
    test_scriptpackages test_signal test_socket_ssl test_socketserver
    test_sunaudiodev test_threadsignals test_timeout test_timing
    test_urllib2net test_urllibnet test_xdrlib
7 skips unexpected on win32:
    test_hashlib test_cmd_line test_xdrlib test_code test_float
    test_coding test_functional

I'm not sure what to make of the "unexpected" skips...

The output for the failed tests was:

test_asynchat
test test_asynchat produced unexpected output:
**********************************************************************
*** lines 2-3 of actual output doesn't appear in expected output after line 1:
+ Connected
+ Received: 'hello world'
**********************************************************************

test_cookie
test test_cookie produced unexpected output:
**********************************************************************
*** mismatch between lines 3-4 of expected output and lines 3-4 of
actual output:
- Set-Cookie: chips=ahoy
+ Set-Cookie: chips=ahoy;
?                       +
- Set-Cookie: vienna=finger
+ Set-Cookie: vienna=finger;
?                          +
*** mismatch between line 6 of expected output and line 6 of actual output:
- Set-Cookie: chips=ahoy
+ Set-Cookie: chips=ahoy;
?                       +
*** mismatch between line 8 of expected output and line 8 of actual output:
- Set-Cookie: vienna=finger
+ Set-Cookie: vienna=finger;
?                          +
*** mismatch between line 10 of expected output and line 10 of actual output:
- Set-Cookie: keebler="E=mc2; L=\"Loves\"; fudge=\012;"
+ Set-Cookie: keebler="E=mc2; L=\"Loves\"; fudge=\012;";
?                                                      +
*** mismatch between line 12 of expected output and line 12 of actual output:
- Set-Cookie: keebler="E=mc2; L=\"Loves\"; fudge=\012;"
+ Set-Cookie: keebler="E=mc2; L=\"Loves\"; fudge=\012;";
?                                                      +
*** mismatch between line 14 of expected output and line 14 of actual output:
- Set-Cookie: keebler=E=mc2
+ Set-Cookie: keebler=E=mc2;
?                          +
*** mismatch between lines 16-17 of expected output and lines 16-17 of
actual output:
- Set-Cookie: keebler=E=mc2
+ Set-Cookie: keebler=E=mc2;
?                          +
- Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme
+ Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme;
?                                                 +
*** mismatch between line 19 of expected output and line 19 of actual output:
-         <script type="text/javascript">
+         <SCRIPT LANGUAGE="JavaScript">
*** mismatch between line 21 of expected output and line 21 of actual output:
-         document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme; Version=1";
?                                                                            -
+         document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme; Version=1;"
?                                                                           +
*** mismatch between line 26 of expected output and line 26 of actual output:
-         <script type="text/javascript">
+         <SCRIPT LANGUAGE="JavaScript">
*** mismatch between line 28 of expected output and line 28 of actual output:
-         document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme";
?                                                                 -
+         document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme;"
?                                                                +
**********************************************************************

test_grammar
test test_grammar produced unexpected output:
**********************************************************************
*** line 37 of expected output missing:
- yield_stmt
**********************************************************************

test_mmap
test test_mmap produced unexpected output:
**********************************************************************
*** lines 34-35 of expected output missing:
-   Ensuring that passing 0 as map length sets map size to current file size.
-   Ensuring that passing 0 as map length sets map size to current file size.
**********************************************************************

test_profile
test test_profile produced unexpected output:
**********************************************************************
*** mismatch between line 10 of expected output and line 10 of actual output:
-         1    0.000    0.000    1.000    1.000 <string>:1(<module>)
?                                                          ^^^^^^^^
+         1    0.000    0.000    1.000    1.000 <string>:1(?)
?                                                          ^
**********************************************************************

I don't have time to investigate much further, and not all of these
look to be VC 2005 Express issues (for example, the test_profile and
test_cookie errors look like code issues rather than compiler ones),
but I don't have an alternative compiler to check.

I hope this is of some use - it would be brilliant if VC 2005 Express
could be a supported build environment. (Of course, MS have updated
the CRT again, so binaries built with VC 2005 Express aren't binary
compatible with extensions built for the standard release... :-( )

Regards,
Paul.


More information about the Python-Dev mailing list