[Python-Dev] addressing distutils inability to track file dependencies

Thomas Heller thomas.heller@ion-tof.com
Fri, 14 Jun 2002 16:59:06 +0200


From: "Guido van Rossum" <guido@python.org>
> > What do you think is broken with the debug builds?
> > I use it routinely and have no problems at all...
> 
> I was repeating hearsay.

The complaints I remember (mostly from c.l.p) are from
people who want to build debug versions of extensions
while at the same time refusing to build a debug version
of Python from the sources.

> 
> Here's what used to be broken on Unix: if you built a debug Python but
> did not install it (assuming a non-debug Python was already
> installed), and then used that debug Python to build a 3rd party
> extension, the debug Python's configuration would be ignored, and the
> extension would be built with the configuration of the installed
> Python instead.  Such extensions can't be linked with the debug
> Python, which was the whole point of using the debug Python to build
> in the first place.
> 
> Jeremy recently fixed this for Unix, and I'm very happy.
> 
> But I believe that on Windows you still have to add "--debug" to your
> setup.py build command to get the same effect.  I think that using the
> debug executable should be sufficient to turn on the debug flags.
> 
> More generally, I think that when you use a Python executable that
> lives in a build directory, the configuration of that build directory
> should be used for all extensions you build.  This is what Jeremy did
> in his fix.  (As a side effect, building the Python extensions no
> longer needs to be special-cased.)
> 

I don't know anything about building Python (and extensions) on Unix,
but here's how it works on windows:
You can use the release as well as the debug version of Python to build
release debug or release extensions with distutils. You have to use the
--debug switch to specify which one to use.
The debug version needs other libraries than the release version, they
all have an _d inserted into the filename just before the filename-
extension (but you probably know this already ;-).

I don't know if it even is possible (in Python code) to determine
whether the debug or the release exe is currently running.

With changes I recently made to distutils, you can even do all this
in a 'not installed' version, straight from CVS, for example.

Thomas