[Distutils] WinNT and distutils
Tue, 1 Feb 2000 09:04:14 -0500
On 31 January 2000, Mark Hammond said:
> > Surely msvccompiler can tell if a particular file (say cl.exe) isn't in
> > any of the well known places. Then it can just issue the correct
> > commands with the path attached or tell the user it can't find
> > cl.exe/link.exe and then ask for vcvars32.bat to be run first. I assume
> > we're not going to search all known drives for the correct exe's.
> I agree. IMO, we could take the following approach:
> * Look in C:\Program Files\The default place\...
> * Look in \Program Files\The default place\...
> * Try and import win32api, catching the import error
* what is "The default place"?
* if/when a standard Python 1.6 way for accessing the Windows registry
comes into existence, should it be added that to list?
Otherwise, that sounds good. Patches welcome, tested patches especially
> However, it is worth noting that running "vcvars32.bat" wont work if run via
> a seperate "system()" call - the environment variables set will not persist.
> The only decent solution I can see is to create a temporary batch file, that
> first calls "vcvars32.bat" before the builds. Depending on how distutils
> does its thing, it may just be simpler to detect the condition, and politely
> ask the user to run the batch file themselves...
Yecch. 1) I don't like the idea of running a batch file (or shell
script on the Unix side) for every compiler invocation -- I haven't
worried much about performance on the Python side so far in the
Distutils (since copying and compiling files is so expensive), but I
might have to draw the line at this. 2) If I have no idea where cl.exe
is, how am I supposed to know where vcvars32.bat is?