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