зеркало из https://github.com/mozilla/gecko-dev.git
Bug 794506 - Part 1: Move virtualenv code under mozbuild; r=ted
--HG-- rename : build/virtualenv/packages.txt => build/virtualenv_packages.txt rename : build/virtualenv/populate_virtualenv.py => python/mozbuild/mozbuild/virtualenv.py
This commit is contained in:
Родитель
e82afeaa6d
Коммит
5916036948
|
@ -24,7 +24,7 @@ dnl If this is a mozilla-central, we'll find the virtualenv in the top
|
||||||
dnl source directory. If this is a SpiderMonkey build, we assume we're at
|
dnl source directory. If this is a SpiderMonkey build, we assume we're at
|
||||||
dnl js/src and try to find the virtualenv from the mozilla-central root.
|
dnl js/src and try to find the virtualenv from the mozilla-central root.
|
||||||
for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
|
for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
|
||||||
possible=$base/build/virtualenv/populate_virtualenv.py
|
possible=$base/python/mozbuild/mozbuild/virtualenv.py
|
||||||
|
|
||||||
if test -e $possible; then
|
if test -e $possible; then
|
||||||
_virtualenv_topsrcdir=$base
|
_virtualenv_topsrcdir=$base
|
||||||
|
@ -53,7 +53,8 @@ if test -z $DONT_POPULATE_VIRTUALENV; then
|
||||||
dnl virtualenv is present and up to date. It sanitizes the environment
|
dnl virtualenv is present and up to date. It sanitizes the environment
|
||||||
dnl for us, so we don't need to clean anything out.
|
dnl for us, so we don't need to clean anything out.
|
||||||
$PYTHON $_virtualenv_populate_path \
|
$PYTHON $_virtualenv_populate_path \
|
||||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv || exit 1
|
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv \
|
||||||
|
$_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1
|
||||||
|
|
||||||
case "$host_os" in
|
case "$host_os" in
|
||||||
mingw*)
|
mingw*)
|
||||||
|
|
|
@ -325,8 +325,8 @@ CONFIG_STATUS_DEPS := \
|
||||||
$(TOPSRCDIR)/config/milestone.txt \
|
$(TOPSRCDIR)/config/milestone.txt \
|
||||||
$(TOPSRCDIR)/js/src/config/milestone.txt \
|
$(TOPSRCDIR)/js/src/config/milestone.txt \
|
||||||
$(TOPSRCDIR)/browser/config/version.txt \
|
$(TOPSRCDIR)/browser/config/version.txt \
|
||||||
$(TOPSRCDIR)/build/virtualenv/packages.txt \
|
$(TOPSRCDIR)/build/virtualenv_packages.txt \
|
||||||
$(TOPSRCDIR)/build/virtualenv/populate_virtualenv.py \
|
$(TOPSRCDIR)/python/mozbuild/mozbuild/virtualenv.py \
|
||||||
$(TOPSRCDIR)/testing/mozbase/packages.txt \
|
$(TOPSRCDIR)/testing/mozbase/packages.txt \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ dnl If this is a mozilla-central, we'll find the virtualenv in the top
|
||||||
dnl source directory. If this is a SpiderMonkey build, we assume we're at
|
dnl source directory. If this is a SpiderMonkey build, we assume we're at
|
||||||
dnl js/src and try to find the virtualenv from the mozilla-central root.
|
dnl js/src and try to find the virtualenv from the mozilla-central root.
|
||||||
for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
|
for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
|
||||||
possible=$base/build/virtualenv/populate_virtualenv.py
|
possible=$base/python/mozbuild/mozbuild/virtualenv.py
|
||||||
|
|
||||||
if test -e $possible; then
|
if test -e $possible; then
|
||||||
_virtualenv_topsrcdir=$base
|
_virtualenv_topsrcdir=$base
|
||||||
|
@ -53,7 +53,8 @@ if test -z $DONT_POPULATE_VIRTUALENV; then
|
||||||
dnl virtualenv is present and up to date. It sanitizes the environment
|
dnl virtualenv is present and up to date. It sanitizes the environment
|
||||||
dnl for us, so we don't need to clean anything out.
|
dnl for us, so we don't need to clean anything out.
|
||||||
$PYTHON $_virtualenv_populate_path \
|
$PYTHON $_virtualenv_populate_path \
|
||||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv || exit 1
|
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv \
|
||||||
|
$_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1
|
||||||
|
|
||||||
case "$host_os" in
|
case "$host_os" in
|
||||||
mingw*)
|
mingw*)
|
||||||
|
|
|
@ -366,7 +366,7 @@ class VirtualenvManager(object):
|
||||||
# the virtualenv for paths to be proper.
|
# the virtualenv for paths to be proper.
|
||||||
|
|
||||||
args = [self.python_path, __file__, 'populate', self.topsrcdir,
|
args = [self.python_path, __file__, 'populate', self.topsrcdir,
|
||||||
self.topobjdir, self.virtualenv_root]
|
self.topobjdir, self.virtualenv_root, self.manifest_path]
|
||||||
|
|
||||||
result = subprocess.call(args, stdout=self.log_handle,
|
result = subprocess.call(args, stdout=self.log_handle,
|
||||||
stderr=subprocess.STDOUT, cwd=self.topsrcdir)
|
stderr=subprocess.STDOUT, cwd=self.topsrcdir)
|
||||||
|
@ -409,26 +409,19 @@ def verify_python_version(log_handle):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) < 4:
|
if len(sys.argv) < 5:
|
||||||
print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/topobjdir /path/to/virtualenv')
|
print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/topobjdir /path/to/virtualenv /path/to/virtualenv_manifest')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
verify_python_version(sys.stdout)
|
verify_python_version(sys.stdout)
|
||||||
|
|
||||||
topsrcdir = sys.argv[1]
|
topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[1:5]
|
||||||
topobjdir = sys.argv[2]
|
|
||||||
virtualenv_path = sys.argv[3]
|
|
||||||
populate = False
|
populate = False
|
||||||
|
|
||||||
# This should only be called internally.
|
# This should only be called internally.
|
||||||
if sys.argv[1] == 'populate':
|
if sys.argv[1] == 'populate':
|
||||||
populate = True
|
populate = True
|
||||||
topsrcdir = sys.argv[2]
|
topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[2:]
|
||||||
topobjdir = sys.argv[3]
|
|
||||||
virtualenv_path = sys.argv[4]
|
|
||||||
|
|
||||||
# path to default packages.txt
|
|
||||||
manifest_path = os.path.join(topsrcdir, 'build', 'virtualenv', 'packages.txt')
|
|
||||||
|
|
||||||
manager = VirtualenvManager(topsrcdir, topobjdir, virtualenv_path,
|
manager = VirtualenvManager(topsrcdir, topobjdir, virtualenv_path,
|
||||||
sys.stdout, manifest_path)
|
sys.stdout, manifest_path)
|
Загрузка…
Ссылка в новой задаче