classification
Title: Static Windows Build fails to locate existing installation
Type: behavior Stage: test needed
Components: Build Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: loewis Nosy List: amaury.forgeotdarc, babydoe, georg.brandl, loewis
Priority: low Keywords: patch

Created on 2005-10-15 18:43 by babydoe, last changed 2010-08-22 01:06 by BreamoreBoy.

Files
File name Uploaded Description Edit
dl_nt.c babydoe, 2005-10-15 18:43 Modified dl_nt.c (for static/dynamic build)
Messages (4)
msg48869 - (view) Author: Doe, Baby (babydoe) Date: 2005-10-15 18:43
I have used the Python 2.4.2 source to create a static
linkable version under windows (.lib). The executables
using that library fail to find the registry path of an
already existing Python 2.4 installation.

I have traced this down to the PC/dl_nt.c file, where
the variable PyWin_DLLVersionString is defined, but not
initialized, execpt if the DllMain function is called.
That function is only called by a process loading a
DLL, this is not the case with an static linked library.

I have used a preprocessor check against
Py_NO_ENABLE_SHARED to create a modified version of
dl_nt.c that will initialize the variable and remove
the DLLMain function from the static version (and keep
the original code when making a shared DLL)

With this minimal modification "import site" works as
usual even in an static linked version.

For your convenience the modified file can be found in
the attachement.
msg48870 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-02-19 15:48
Logged In: YES 
user_id=1188172

What does the Windows expert say?
msg90575 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-07-16 17:58
Do we want to support this? What is the use of a static build?
msg90577 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-07-16 18:37
I think it would be nice to support it, atleast in the C files (not
necessarily, but possibly, in the project files as well).

The point of a static Python library is that you can embed it into an
application without requiring an additional DLL. That also allows you to
leave out modules that you don't need at link time. Combine this with
freeze, and you can embed an application without any additional files to
be shipped. Without embedding, but with freeze, you get true standalone
binaries (as opposed to py2exe-fake-I-silently-extract-at-run-time
standalone binaries)
History
Date User Action Args
2010-08-22 01:06:03BreamoreBoysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
2009-07-16 18:37:25loewissetmessages: + msg90577
2009-07-16 17:58:57amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg90575
2009-03-20 22:59:33ajaksu2setpriority: normal -> low
stage: test needed
type: behavior
versions: + Python 2.6
2005-10-15 18:43:43babydoecreate