[Distutils] Re: Patch for NT

Greg Ward gward@python.net
Thu, 30 Mar 2000 22:54:14 -0500


On 29 March 2000, Thomas Heller said:
> The attached patch fixes the followoing problems:
> 1. self.build_extensions - (which I reported already)
> 2. The python library directory is now again used (also already reported by me)
> 3. Debug and Release versions of python extensions under windows are now
> compiled in different directories (as it should be!).
> 4. Unneeded junk from the MSVC linker (.lib and .exp files) are now created in the
> temporary build directory.

Thanks!  I see a few potential problems here (maybe -- remember, I'm not
a Windows user, so if these sound like trying to apply The Unix Way to
Windows, tell me).

> +             if self.debug:
> +                 self.build_temp = os.path.join (self.build_temp, "Debug")
> +             else:
> +                 self.build_temp = os.path.join (self.build_temp, "Release")

So you'll have build directories build/temp.nt/Debug and
build/temp.nt/Release -- is that somehow better than build/temp.nt-debug
and build/temp.nt-release?  I was kinda thinking along the latter lines;
I don't *think* it makes any difference, apart from aesthetics.  Does
it?  I'm guessing that The Microsoft Way would be to create an
unnecessarily deep hierarchy.

> diff -cr distutils/msvccompiler.py distutils.new/msvccompiler.py
> *** distutils/msvccompiler.py Wed Mar 29 09:01:40 2000
> --- distutils.new/msvccompiler.py Wed Mar 29 20:58:54 2000
[...]
> --- 319,331 ----
>               raise TypeError, "'output_dir' must be a string or None"
>           if output_dir is not None:
>               output_filename = os.path.join (output_dir, output_filename)
> +         else:
> +             output_dir = os.path.dirname (output_filename)

What does this add?  The name 'output_dir' isn't referenced anywhere
after this point.

I fixed the stupid 'build_extensions' bug differently, so that part of
your patch is unneeded.  (Thanks anyway. ;-)

There, I've just applied your patch, discarded the unneeded
'build_extensions' and 'output_dir' bits, and checked it all in.  Looks
like it all still works for me under Linux...

Thanks again!

        Greg
-- 
Greg Ward - Unix bigot                                  gward@python.net
http://starship.python.net/~gward/
God is real, unless declared integer.