[issue2975] VS8 include dirs grow without bound

Jim Kleckner report at bugs.python.org
Mon May 26 21:56:36 CEST 2008


New submission from Jim Kleckner <jek-python at kleckner.net>:

I tracked down a testing failure for Cython tests
on the Windows platform to be the result of how the
Visual C environment variables are being detected.

In the function, query_vcvarsall, the .bat file:
 "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
is being run with the arguments:
 x86 & set

This in turn calls the platform-specific file vcvars32.bat (or other).
In this file, the PATH, INCLUDE, and LIBPATH environment variables are
simply being appended/prepended with their values.

initialize() then just overrides the os.environ values with these
monotonically growing variables.

It seems that duplicate names should be filtered out from these paths
to prevent overflow.

The attached patch seems to fix this issue, if a bit brute force.
Please review as a candidate.


=====
@set
PATH=%DevEnvDir%;%VCINSTALLDIR%\BIN;%VSINSTALLDIR%\Common7\Tools;%VSINSTALLDIR%\Common7\Tools\bin;%FrameworkDir%\%Framework35Version%;%FrameworkDir%\%Framework35Version%\Microsoft
.NET Framework 3.5 (Pre-Release
Version);%FrameworkDir%\%FrameworkVersion%;%VCINSTALLDIR%\VCPackages;%PATH%
@set INCLUDE=%VCINSTALLDIR%\ATLMFC\INCLUDE;%VCINSTALLDIR%\INCLUDE;%INCLUDE%
@set LIB=%VCINSTALLDIR%\ATLMFC\LIB;%VCINSTALLDIR%\LIB;%LIB%
@set
LIBPATH=%FrameworkDir%\%Framework35Version%;%FrameworkDir%\%FrameworkVersion%;%VCINSTALLDIR%\ATLMFC\LIB;%VCINSTALLDIR%\LIB;%LIBPATH%


=====

----------
components: Distutils
files: dist.patch
keywords: patch
messages: 67387
nosy: jkleckner
severity: normal
status: open
title: VS8 include dirs grow without bound
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file10442/dist.patch

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2975>
__________________________________


More information about the Python-bugs-list mailing list