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.

Author jfoo
Recipients Daniel.Ozminkowski, Frankie.Jhou, Victor.Lin, bgale, eric.araujo, giampaolo.rodola, ipatrol, jafo, jfoo, lemburg, loewis, lwteng, mdengler, piotr.dobrogost, sayap, schmir, shimizukawa, skrah, srid, steve.dower, tarek, thorsten.behrens, zzzeek
Date 2014-02-25.21:10:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1393362659.89.0.127895208137.issue7511@psf.upfronthosting.co.za>
In-reply-to
Content
I think getting this bug fixed would be really nice from a user experience point of view.

I've further into this for my own setup, which is Python 3.3 64-bit, Visual C++ Express 2010 and the Windows SDK v7.1 (plus service packs), which is probably a typical setup for a user looking to build Python extensions without paying for a compiler. Here's what I've noticed, apart from the fact that msvccompiler9.py is a mess.

query_vcvarsall executes "vcvarsall.bat amd64 & set". The first part, trying to delegate to another batch file that doesn't exist, will fail. So no environment variables will be set, but the PATH environment variable always exists, hence "ValueError: ['path']".

The DISTUTILS_USE_SDK environment variable is useless, even leaving aside the fact that MsSdk also needs to be defined. The idea is that distutils will trust that the user has set the appropriate environment variables (e.g. SetEnv.Cmd /Release). However, successful compilation of 64-bit extensions won't rely on this variable at all:

1. DISTUTILS_USE_SDK/MsSdk defined, SetEnv not called: "cl.exe" and friends can't be resolved and nothing works.

2. DISTUTILS_USE_SDK/MsSdk defined, SetEnv called: "cl.exe" and friends can be resolved and everything works.

3. DISTUTILS_USE_SDK/MsSdk undefined, SetEnv not called: "vcvarsall.bat amd64" will fail and we end up with "ValueError: ['path']" as above.

4. DISTUTILS_USE_SDK/MsSdk undefined, SetEnv called: in query_vcvarsall, "vcvarsall.bat amd64" still fails, but it doesn't matter at this point, because the environment variables INCLUDE, LIB, LIBPATH and PATH will exist, so parsing "vcvarsall.bat amd64 & set" works. This doesn't guarantee linking with the correct bitness, but one would hope so :)


I believe SetEnv.Cmd can be found using HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDKTools or HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.1\WinSDKTools.
History
Date User Action Args
2014-02-25 21:11:00jfoosetrecipients: + jfoo, lemburg, loewis, jafo, giampaolo.rodola, schmir, tarek, sayap, eric.araujo, zzzeek, srid, skrah, ipatrol, shimizukawa, thorsten.behrens, piotr.dobrogost, Victor.Lin, mdengler, steve.dower, Daniel.Ozminkowski, Frankie.Jhou, bgale, lwteng
2014-02-25 21:10:59jfoosetmessageid: <1393362659.89.0.127895208137.issue7511@psf.upfronthosting.co.za>
2014-02-25 21:10:59jfoolinkissue7511 messages
2014-02-25 21:10:58jfoocreate