Bug 1632461 - Delete "hacking environment to allow binary Python" message and corresponding hack. r=dmajor

This warning dates from bug 910487, which was 7 years ago. Since joining Mozilla I have *always* gotten this warning, and as far as I can tell since I never had a pre-2019 version of Visual Studio on my dev machine, the VS90COMNTOOLS variable was *never* set. Moreover, the "hack" is written in such a way that it does nothing *unless* you have `VS{100,110,120}COMNTOOLS` set, which I never have on my machine either, as you might expect since I only have the one version of Visual Studio installed.

The [latest public build documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites) recommends that you install the Community edition of Visual Studio 2019, and as of 2019 the variable that's being used is `VS160COMNTOOLS`, so the only way someone would get value out of this hack is if they're using a substantially older version of Visual Studio than we recommend anyway.

Since 1) I *suspect* the hack is not doing anything for the large majority, if not all, of the people currently running builds on Windows on a day-to-day basis and 2) even if the hack continues to do something useful under some hypothetical scenarios, the content of the hack as well as the corresponding warning is so outdated that it should be updated anyway, I propose deleting it entirely.

Differential Revision: https://phabricator.services.mozilla.com/D72925
This commit is contained in:
Ricky Stewart 2020-04-28 19:24:45 +00:00
Родитель 707b0c1a92
Коммит 7b699ef488
1 изменённых файлов: 0 добавлений и 28 удалений

Просмотреть файл

@ -12,7 +12,6 @@ import os
import shutil
import subprocess
import sys
import warnings
from distutils.version import LooseVersion
@ -441,33 +440,6 @@ class VirtualenvManager(object):
old_env_variables[k] = 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:
handle_package(package)