[issue7833] Bdist_wininst installers fail to load extensions built with Issue4120 patch
report at bugs.python.org
Thu Feb 4 01:37:24 CET 2010
Christoph Gohlke <cgohlke at uci.edu> added the comment:
I thought one conclusion of the discussion on issue4120 was that any executable, which embeds Python and imports MSVCR9 dependent extensions, must now provide the manifest for the MSVCR9 runtimes, either embedded or as a separate file. See <http://bugs.python.org/issue4120#msg94644> and responses. Why shouldn't this apply to wininst executables?
Another observation: importing the winsound extension in the postinstall script works even though it also depends on MSVCR90.DLL. Winsound.pyd does not have an embedded manifest. It is linked with /MANIFEST:NO. Apparently there is a difference between an "empty" manifest and no manifest.
How about a patch that does:
1) not embed any manifest into PYD files if the manifest contains only a single MSVCR90 dependentAssembly element.
2) remove the MSVCR90 dependentAssembly element from manifests embedded into PYD files if the manifest defines additional dependentAssembly elements (e.g. for MFC or Common Controls). This is essentially what the msvc9compiler_stripruntimes patch does now.
3) not embed manifests into any file (EXE, PYD, or DLL) if '/MANIFEST:NO' is defined in extra_link_args. Extension developers can then provide external manifest files.
4) not touch the default manifests embedded into EXE and DLL files. The msvc9compiler_stripruntimes currently produces DLLs that can not be used standalone, such as pythoncom26.dll from the pywin32 package (I can file a separate bug if requested). Pythoncom26.dll is meant to be placed in the system32 folder and to be used outside of a Python environment, i.e. from the Windows Scripting Host. Several pywin32 tests fail with the pythoncom26.dll built with the msvc9compiler_stripruntimes patch. Placing a MSVCR9 manifest file into the system32 folder next to the pythoncom26.dll is not an option.
A tentative patch against the Python 2.6 branch is attached. I will test it further.
(1) and (4) will solve the original pywin32 wininstaller problem without changing wininst.exe.
As it is now the installer and some functionality of the pywin32 package will likely break if pywin32 is built on Python 2.6.5.
Added file: http://bugs.python.org/file16121/msvc9compiler_stripruntimes_revised.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list