Patches item #780821, was opened at 2003-07-31 14:50
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=780821&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Distutils and setup.py
Group: Python 2.3
>Status: Closed
>Resolution: Out of Date
Priority: 5
Submitted By: Garth T Kidd (gtk)
Assigned to: Jeremy Hylton (jhylton)
Summary: More robust MSVC6 finder

Initial Comment:
My VS6 install on XP didn't set the 
r"Software\Microsoft\Devstudio\6.0\Build System" 
registry key relied upon by distutils.msvccompiler to find 
the compiler and linker executable. 

As a backup to the registry paths, this patch looks up 
the MSVCDIR environment variable and ensures its 
basename is appropriate for the Python build version: 

            if self.__version == 6: 
                matchbase = 'vc98'
            elif self.__version == 7: 
                matchbase = 'vc7'

Works fine on my machine, so long as I run 
VCVARS32.BAT, and fails appropriately if I ran the wrong 
VCVARS32.BAT by mistake (I have Visual Studio Net 
2003 also installed). 

The patch should be applied to distutils/msvccompiler.py.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2006-04-15 11:04

Message:
Logged In: YES 
user_id=21627

As Python 2.3 is no longer maintained, and Python 2.4 (and
later) uses VS 2003, I'm rejecting the patch as out-of-date.

----------------------------------------------------------------------

Comment By: Paul Magwene (pmagwene)
Date: 2003-11-13 21:12

Message:
Logged In: YES 
user_id=23286

The reliance on registry keys (and ignoring other environment variables) can 
also cause other headaches.  Here's a problem I ran into on a stock Python 2.3 
when trying to compile extensions using VC6:

I'm using STLport instead of the buggy STL implementation that ships with VC6.  
To have the STL headers included I put the STL directory at the beginning of 
the INCLUDE search path in VCVARS32.BAT *and* by setting the appropriate values 
in the environment variables.  

With these settings, when I built my Python C++ extension by hand everything 
worked hunky-dory.  However when I tried to use distutils it kept including the 
old header files.  It took me a good 20 minutes of head scratching to realize 
that distutils was ignoring my environment variables and preferentially 
grabbing whatever INCLUDE directory was specified in the registry key (even if 
I ran VCVARS32.bat before compiling). Once I set the registry variable by hand, 
everything worked ok.

Perhaps distutils can be configured to look for environment settings *before* 
searching out whatever is buried in the registry?

--Paul M.

----------------------------------------------------------------------

Comment By: Murray Steele (murraysteele)
Date: 2003-10-21 13:10

Message:
Logged In: YES 
user_id=891425

Having come across this problem myself, it seems that MSVC 6
doesn't create the r"Software\Microsoft\Devstudio\6.0\Build
System" registry keys until *after* you run the actual
Visual Studio IDE.  So just doing a plain install and never
running the IDE isn't enough.

This isn't much of a fix, just some kind of documentation
incase it bites some other fumbling developer in the future.

Someone somewhere else
(http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451285&group_id=5470)
 suggested using the Environment Variables as well as the
registry keys in distutils to check for compiler
correctness.  Seems like a plan to me. 

And there is some more chat about this problem here
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=614770&group_id=5470

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-08-01 09:16

Message:
Logged In: YES 
user_id=21627

I'm curious, though, how you installed VS6 without getting
the registry settings. Doesn't this mean your installation
of VS6 is broken?

----------------------------------------------------------------------

Comment By: Garth T Kidd (gtk)
Date: 2003-08-01 06:06

Message:
Logged In: YES 
user_id=59803

WARNING: the first patch contains a typo. s/nstring/string/ 
and you'll be fine. New version attached. 

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2003-08-01 00:09

Message:
Logged In: YES 
user_id=31392

I've desired the same functionality in the past.


----------------------------------------------------------------------

Comment By: Garth T Kidd (gtk)
Date: 2003-07-31 14:52

Message:
Logged In: YES 
user_id=59803

Whups. The patch didn't attach. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=780821&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches

Reply via email to