зеркало из https://github.com/mozilla/gecko-dev.git
Backout 4682ed369545 (bug 841713) for reftest make target bustage
--HG-- extra : rebase_source : 6bf45c9f33563109cf6d17197f9184a3a336efe0
This commit is contained in:
Родитель
a4b2ea78c7
Коммит
a9616cce11
|
@ -53,7 +53,7 @@ if test -z $DONT_POPULATE_VIRTUALENV; then
|
|||
dnl virtualenv is present and up to date. It sanitizes the environment
|
||||
dnl for us, so we don't need to clean anything out.
|
||||
$PYTHON $_virtualenv_populate_path \
|
||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv || exit 1
|
||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT/_virtualenv || exit 1
|
||||
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
|
|
|
@ -13,4 +13,3 @@ mozilla.pth:config
|
|||
mozilla.pth:xpcom/typelib/xpt/tools
|
||||
copy:build/buildconfig.py
|
||||
packages.txt:testing/mozbase/packages.txt
|
||||
objdir:build
|
||||
|
|
|
@ -22,8 +22,7 @@ MINIMUM_PYTHON_MINOR = 7
|
|||
class VirtualenvManager(object):
|
||||
"""Contains logic for managing virtualenvs for building the tree."""
|
||||
|
||||
def __init__(self, topsrcdir, topobjdir, virtualenv_path, log_handle,
|
||||
manifest_path):
|
||||
def __init__(self, topsrcdir, virtualenv_path, log_handle, manifest_path):
|
||||
"""Create a new manager.
|
||||
|
||||
Each manager is associated with a source directory, a path where you
|
||||
|
@ -31,7 +30,6 @@ class VirtualenvManager(object):
|
|||
"""
|
||||
assert os.path.isabs(manifest_path), "manifest_path must be an absolute path: %s" % (manifest_path)
|
||||
self.topsrcdir = topsrcdir
|
||||
self.topobjdir = topobjdir
|
||||
self.virtualenv_root = virtualenv_path
|
||||
self.log_handle = log_handle
|
||||
self.manifest_path = manifest_path
|
||||
|
@ -153,14 +151,6 @@ class VirtualenvManager(object):
|
|||
copy -- Copies the given file in the virtualenv site packages
|
||||
directory.
|
||||
|
||||
packages.txt -- Denotes that the specified path is a child manifest. It
|
||||
will be read and processed as if its contents were concatenated
|
||||
into the manifest being read.
|
||||
|
||||
objdir -- Denotes a relative path in the object directory to add to the
|
||||
search path. e.g. "objdir:build" will add $topobjdir/build to the
|
||||
search path.
|
||||
|
||||
Note that the Python interpreter running this function should be the
|
||||
one from the virtualenv. If it is the system Python or if the
|
||||
environment is not configured properly, packages could be installed
|
||||
|
@ -195,7 +185,6 @@ class VirtualenvManager(object):
|
|||
src = os.path.join(self.topsrcdir, package[1])
|
||||
assert os.path.isfile(src), "'%s' does not exist" % src
|
||||
submanager = VirtualenvManager(self.topsrcdir,
|
||||
self.topobjdir,
|
||||
self.virtualenv_root,
|
||||
self.log_handle,
|
||||
src)
|
||||
|
@ -223,15 +212,6 @@ class VirtualenvManager(object):
|
|||
file=self.log_handle)
|
||||
return False
|
||||
|
||||
if package[0] == 'objdir':
|
||||
assert len(package) == 2
|
||||
path = os.path.join(self.topobjdir, package[1])
|
||||
|
||||
with open(os.path.join(python_lib, 'objdir.pth'), 'a') as f:
|
||||
f.write('%s\n' % path)
|
||||
|
||||
return True
|
||||
|
||||
raise Exception('Unknown action: %s' % package[0])
|
||||
|
||||
# We always target the OS X deployment target that Python itself was
|
||||
|
@ -313,7 +293,7 @@ class VirtualenvManager(object):
|
|||
# the virtualenv for paths to be proper.
|
||||
|
||||
args = [self.python_path, __file__, 'populate', self.topsrcdir,
|
||||
self.topobjdir, self.virtualenv_root]
|
||||
self.virtualenv_root]
|
||||
|
||||
result = subprocess.call(args, stdout=self.log_handle,
|
||||
stderr=subprocess.STDOUT, cwd=self.topsrcdir)
|
||||
|
@ -349,29 +329,26 @@ def verify_python_version(log_handle):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 4:
|
||||
print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/topobjdir /path/to/virtualenv')
|
||||
if len(sys.argv) < 3:
|
||||
print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/virtualenv')
|
||||
sys.exit(1)
|
||||
|
||||
verify_python_version(sys.stdout)
|
||||
|
||||
topsrcdir = sys.argv[1]
|
||||
topobjdir = sys.argv[2]
|
||||
virtualenv_path = sys.argv[3]
|
||||
virtualenv_path = sys.argv[2]
|
||||
populate = False
|
||||
|
||||
# This should only be called internally.
|
||||
if sys.argv[1] == 'populate':
|
||||
populate = True
|
||||
topsrcdir = sys.argv[2]
|
||||
topobjdir = sys.argv[3]
|
||||
virtualenv_path = sys.argv[4]
|
||||
virtualenv_path = sys.argv[3]
|
||||
|
||||
# path to default packages.txt
|
||||
manifest_path = os.path.join(topsrcdir, 'build', 'virtualenv', 'packages.txt')
|
||||
|
||||
manager = VirtualenvManager(topsrcdir, topobjdir, virtualenv_path,
|
||||
sys.stdout, manifest_path)
|
||||
manager = VirtualenvManager(topsrcdir, virtualenv_path, sys.stdout, manifest_path)
|
||||
|
||||
if populate:
|
||||
manager.populate()
|
||||
|
|
|
@ -53,7 +53,7 @@ if test -z $DONT_POPULATE_VIRTUALENV; then
|
|||
dnl virtualenv is present and up to date. It sanitizes the environment
|
||||
dnl for us, so we don't need to clean anything out.
|
||||
$PYTHON $_virtualenv_populate_path \
|
||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv || exit 1
|
||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT/_virtualenv || exit 1
|
||||
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
|
|
Загрузка…
Ссылка в новой задаче