blob: 4fe77de0f694caccb37f01bfb4d3b907e8127f11 [file] [log] [blame]
Mike Frysinger51f0d522015-11-21 00:11:17 +00001Remove local python modules from the search path when running the compiler.
2
3The python build will invoke python with a custom PYTHONPATH (pointing to
4local libs) which will mess up any python scripts we execute, like our
5compiler wrapper.
6
7We can't create wrappers and point the build at those because python will
8record the values for CC/CXX and write it out to its installed modules, and
9those values will be loaded later when cross-compiling other python packages.
10
11This hack is kind of terrible, but so are many of the alternatives.
12
13--- a/setup.py
14+++ a/setup.py
15@@ -46,6 +46,10 @@
16 disable_ssl = 0
17
18
19+for v in ('CC', 'CXX', 'LDSHARED'):
20+ if v in os.environ:
21+ os.environ[v] = 'env -u PYTHONPATH ' + os.environ[v]
22+
23 exit_status = 0
24
25 def add_dir_to_list(dirlist, dir):