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 mdehoon
Recipients
Date 2004-11-30.10:06:26
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
C extension modules can be built for Python on Windows
with various compilers, such as Borland's C compiler
and the gcc compiler using cygwin/mingw. With Python
2.3, a binary installer for Windows can be built as
follows:

python setup.py build --compiler=mingw32
# compiles the extension module using the gcc compiler
# on cygwin / mingw
python setup.py bdist_wininst
# to create the binary installer.

Hence, no need for Microsoft's compiler.

With Python 2.4, a problem arises with the
bdist_wininst command (and also with python setup.py
install) if a user does not have Microsoft's compiler
installed, even if gcc or Borland's compiler is used to
compile the extension module.

The problem is that distutils first creates an
MSVCCompiler object and then checks if anything still
needs to be compiled. In Python 2.4, the __init__
function of MSVCCompiler checks if the version of the
installed Microsoft VC compiler is compatible with the
version that was used to build Python itself. If
Microsoft's VC compiler is not installed, __init__ will
fail, even though the extension module has already been
compiled by gcc or Borland's compiler.

The solution, in the attached patch, is to postpone the
full initialization of MSVCCompiler until Distutils
determines that there is something left to be compiled.
For users of gcc or Borland, MSVCCompiler's __init__
function does not need Microsoft VC to be installed.
For users of Microsoft VC, the remainder of the
initialization is performed when MSVCCompiler is asked
to compile or link something for the first time. Hence,
both gcc or Borland and Microsoft VC can be used to
build extension modules for Python on Windows, just
like in Python 2.3.
History
Date User Action Args
2007-08-23 15:40:47adminlinkissue1075887 messages
2007-08-23 15:40:47admincreate