mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
Bug 910487 - Hack binary Python extensions into building on Windows; r=mshal
This commit is contained in:
parent
bbb14a7245
commit
5be305df32
@ -12,6 +12,7 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
|
||||||
# Minimum version of Python required to build.
|
# Minimum version of Python required to build.
|
||||||
@ -273,6 +274,33 @@ class VirtualenvManager(object):
|
|||||||
old_env_variables[k] = os.environ[k]
|
old_env_variables[k] = os.environ[k]
|
||||||
del os.environ[k]
|
del os.environ[k]
|
||||||
|
|
||||||
|
# HACK ALERT.
|
||||||
|
#
|
||||||
|
# The following adjustment to the VSNNCOMNTOOLS environment
|
||||||
|
# variables are wrong. This is done as a hack to facilitate the
|
||||||
|
# building of binary Python packages - notably psutil - on Windows
|
||||||
|
# machines that don't have the Visual Studio 2008 binaries
|
||||||
|
# installed. This hack assumes the Python on that system was built
|
||||||
|
# with Visual Studio 2008. The hack is wrong for the reasons
|
||||||
|
# explained at
|
||||||
|
# http://stackoverflow.com/questions/3047542/building-lxml-for-python-2-7-on-windows/5122521#5122521.
|
||||||
|
if sys.platform in ('win32', 'cygwin') and \
|
||||||
|
'VS90COMNTOOLS' not in os.environ:
|
||||||
|
|
||||||
|
warnings.warn('Hacking environment to allow binary Python '
|
||||||
|
'extensions to build. You can make this warning go away '
|
||||||
|
'by installing Visual Studio 2008. You can download the '
|
||||||
|
'Express Edition installer from '
|
||||||
|
'http://go.microsoft.com/?linkid=7729279')
|
||||||
|
|
||||||
|
# We list in order from oldest to newest to prefer the closest
|
||||||
|
# to 2008 so differences are minimized.
|
||||||
|
for ver in ('100', '110', '120'):
|
||||||
|
var = 'VS%sCOMNTOOLS' % ver
|
||||||
|
if var in os.environ:
|
||||||
|
os.environ['VS90COMNTOOLS'] = os.environ[var]
|
||||||
|
break
|
||||||
|
|
||||||
for package in packages:
|
for package in packages:
|
||||||
handle_package(package)
|
handle_package(package)
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user