This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: distutils don't respect standard env variables
Type: Stage:
Components: Distutils Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: loewis, luks
Priority: normal Keywords:

Created on 2006-10-03 10:59 by luks, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg30141 - (view) Author: Lukas Lalinsky (luks) Date: 2006-10-03 10:59
Using environment variables INCLUDE and LIB is a
standard way to set system-wide paths for C compilers.
However distutils.msvccompiler always overwrites these
variables with it's own values, which means users have
no way to customize their MSVC setups. It should
*append* the Python-specific stuff to the variables,
not overwrite them.

--- msvccompiler.py.orig	2006-10-03 12:56:15.812500000
+0200
+++ msvccompiler.py	2006-10-03 12:56:22.718750000 +0200
@@ -635,4 +635,7 @@
         else:
             p = self.get_msvc_paths(name)
         if p:
-            os.environ[name] = string.join(p, ';')
+            p = string.join(p, ';')
+            if name in os.environ:
+                p = os.environ[name] + ';' + p
+            os.environ[name] = p
msg30142 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-10-03 12:50
Logged In: YES 
user_id=21627

This bug was fixed in Python 2.5. If the environment
variables MSSdk and DISTUTILS_USE_SDK are set, then
distutils doesn't attempt to overwrite LIB or INCLUDE.
msg30143 - (view) Author: Lukas Lalinsky (luks) Date: 2006-10-03 13:02
Logged In: YES 
user_id=587716

Oh, I didn't know about this. Thank you.
History
Date User Action Args
2022-04-11 14:56:20adminsetgithub: 44074
2006-10-03 10:59:29lukscreate