This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: VS2008, quick hack for distutils.msvccompiler
Type: enhancement Stage:
Components: Distutils Versions: Python 3.0
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: amaury.forgeotdarc, christian.heimes, loewis, mhammond, weck
Priority: high Keywords: patch

Created on 2007-11-17 13:48 by christian.heimes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
py3k_vs2008_hack.patch christian.heimes, 2007-11-17 13:48
py3k_vs2008_2.patch christian.heimes, 2007-11-18 01:09
py3k_vs2008_3.patch christian.heimes, 2007-11-19 20:05
py3k_vs2008_4.patch christian.heimes, 2007-11-27 14:43 weck, 2007-12-19 10:10
Messages (15)
msg57599 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-17 13:48
I've come up with a quick hack to support VS 2008. VS 2008 Standard
Edition doesn't store the include and lib dirs in the registry any more.
However I came up with a nice way to get the env settings from the
vcvarsall.bat. How do you like it?

Do we need support for VS6 and VS7.1 or can I remove the code from the
msg57600 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-11-17 14:01
There is always the debate whether distutils might be repackaged and
backported to older Python releases, therefore people hesitate to remove
support for older versions.

As for finding it in the registry: are you sure it has no registry
settings anymore? I find that hard to believe.
msg57601 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-11-17 14:04
As another note: you shouldn't remove support code for Itanium. Even
though no Itanium binaries will be produced at the releases, I see no
reason to rip the code out - people with Itanium machines should still
be able to build Python, with some effort.
msg57602 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-17 14:17
Neither VS8 Professional nor VS9 Beta 2 Standard are storing the lib and
include directories in the registry. I've searched in HKCU and HKLM. The
best I could find was the path to a XML file in My Documents that
contains the information.
msg57603 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-11-17 15:17
Ok. Running vsvars is fine, then.

The change to get_build_architecture is broken in another way: as it
parses the architecture out of sys.version, you still get Intel, not x86
(unless you also change PC/pyconfig.h - which may break code that relies
on the specific format of sys.version)

Otherwise, the patch looks fine.
msg57606 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-17 18:08
Ok, I'll take it from here. I'm going to wait until it's decided to use
VS 2008 as the new default compiler.
msg57610 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-18 01:09

* Cleanup and rewrite of the registry related code
* Moved search code to find_vcvarsall().
* Added fallback using the VS90COMNTOOL env var for Express edition
msg57660 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-19 20:05
Updated compiler and linker args from the project command lines.
msg57703 - (view) Author: zouguangxian (weck) Date: 2007-11-20 13:41
Why don't use "Visual Studio 200x Command Prompt" to get a shell window 
with correct environment settings? 

In this way can get LIB, INCLUDE, LIBPATH, PATH with 
msg57709 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-11-20 21:13
It's tedious to require users to invoke such a shell, and it would
produce an endless flood of support requests if we made that a
requirement. So requiring to build in such a shell is absolutely
msg57873 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-27 14:43
I've created another patch to add VS 2008 support to distutils. The new
patch requires you to copy the first:

$ cd Lib/distutils
$ svn copy
$ cd ../..
$ patch -p0 < py3k_vs2008_4.patch

Martin, if you are going to build Python 3.0a2 with VS 2008 then this
patch should be applied. I've tested it with VS 2008 and it *may* be
compatible with VS 2005, too.
msg58127 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-12-03 14:35
I've applied the patch to the trunk in r59290 together with a fix for
the cygwin compiler. distutils now support VS 2005 and VS 2008 (both
tested) and cygwin (only tested for msvcr80).
msg58802 - (view) Author: zouguangxian (weck) Date: 2007-12-19 10:10
I succeed in building python26 with msvc 2005. I create a tool to 
convert pcbuild9 to pcbuild8.

1. delete pcbuild8
2. copy pcbuild9 to pcbuild8
3. run in pcbuild8, will change the format flag.
msg58850 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2007-12-20 00:27
I already do the same: pcbuild9 is easy to convert to vs2005, and the
project is much better than the current pcbuild8.

What do the others think? Should we update pcbuild8 with the content of
pcbuild9, with the few changes proposed by weck? Or simply remove
pcbuild8 and propose vs2005 users to run the attached script?
msg59058 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-12-31 10:22
This issue is closed, and didn't really deal with VS 2005 at all, so we
should avoid tracking any further changes in it.

I personally don't care about the PCbuild8 folder at all. It can be
removed, updated, replaced with that script - whatever people like most.
You might want to ask Kristjan Jonsson (who created it originally) about
its fate.
Date User Action Args
2022-04-11 14:56:28adminsetgithub: 45796
2008-01-06 22:29:45adminsetkeywords: - py3k
versions: Python 3.0
2007-12-31 10:22:30loewissetmessages: + msg59058
2007-12-20 00:27:25amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg58850
2007-12-19 10:10:09wecksetfiles: +
messages: + msg58802
2007-12-03 14:35:51christian.heimessetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg58127
2007-11-27 14:43:42christian.heimessetpriority: normal -> high
files: + py3k_vs2008_4.patch
messages: + msg57873
2007-11-20 21:13:21loewissetmessages: + msg57709
2007-11-20 13:41:47wecksetnosy: + weck
messages: + msg57703
2007-11-19 20:05:36christian.heimessetfiles: + py3k_vs2008_3.patch
messages: + msg57660
2007-11-18 22:28:47mhammondsetnosy: + mhammond
2007-11-18 01:09:32christian.heimessetfiles: + py3k_vs2008_2.patch
messages: + msg57610
2007-11-17 18:08:05christian.heimessetassignee: loewis -> christian.heimes
messages: + msg57606
2007-11-17 15:17:40loewissetresolution: accepted
2007-11-17 15:17:30loewissetmessages: + msg57603
2007-11-17 14:17:38christian.heimessetmessages: + msg57602
2007-11-17 14:04:08loewissetmessages: + msg57601
2007-11-17 14:01:23loewissetmessages: + msg57600
2007-11-17 13:48:13christian.heimescreate