From 5916036948090f8ad1a3880e0ec01adbcf69e81e Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Fri, 20 Sep 2013 15:46:23 -0700 Subject: [PATCH] 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 --- build/autoconf/python-virtualenv.m4 | 5 +++-- .../packages.txt => virtualenv_packages.txt} | 0 client.mk | 4 ++-- js/src/build/autoconf/python-virtualenv.m4 | 5 +++-- .../mozbuild/mozbuild/virtualenv.py | 17 +++++------------ 5 files changed, 13 insertions(+), 18 deletions(-) rename build/{virtualenv/packages.txt => virtualenv_packages.txt} (100%) rename build/virtualenv/populate_virtualenv.py => python/mozbuild/mozbuild/virtualenv.py (97%) diff --git a/build/autoconf/python-virtualenv.m4 b/build/autoconf/python-virtualenv.m4 index ef8e476a8071..dbc8a21cf0da 100644 --- a/build/autoconf/python-virtualenv.m4 +++ b/build/autoconf/python-virtualenv.m4 @@ -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 js/src and try to find the virtualenv from the mozilla-central root. 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 _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 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 $MOZ_BUILD_ROOT/_virtualenv \ + $_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1 case "$host_os" in mingw*) diff --git a/build/virtualenv/packages.txt b/build/virtualenv_packages.txt similarity index 100% rename from build/virtualenv/packages.txt rename to build/virtualenv_packages.txt diff --git a/client.mk b/client.mk index 4fe5b61d3271..3723b2ee3e71 100644 --- a/client.mk +++ b/client.mk @@ -325,8 +325,8 @@ CONFIG_STATUS_DEPS := \ $(TOPSRCDIR)/config/milestone.txt \ $(TOPSRCDIR)/js/src/config/milestone.txt \ $(TOPSRCDIR)/browser/config/version.txt \ - $(TOPSRCDIR)/build/virtualenv/packages.txt \ - $(TOPSRCDIR)/build/virtualenv/populate_virtualenv.py \ + $(TOPSRCDIR)/build/virtualenv_packages.txt \ + $(TOPSRCDIR)/python/mozbuild/mozbuild/virtualenv.py \ $(TOPSRCDIR)/testing/mozbase/packages.txt \ $(NULL) diff --git a/js/src/build/autoconf/python-virtualenv.m4 b/js/src/build/autoconf/python-virtualenv.m4 index ef8e476a8071..dbc8a21cf0da 100644 --- a/js/src/build/autoconf/python-virtualenv.m4 +++ b/js/src/build/autoconf/python-virtualenv.m4 @@ -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 js/src and try to find the virtualenv from the mozilla-central root. 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 _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 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 $MOZ_BUILD_ROOT/_virtualenv \ + $_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1 case "$host_os" in mingw*) diff --git a/build/virtualenv/populate_virtualenv.py b/python/mozbuild/mozbuild/virtualenv.py similarity index 97% rename from build/virtualenv/populate_virtualenv.py rename to python/mozbuild/mozbuild/virtualenv.py index 8b0b124cbab6..d9c2a2850e21 100644 --- a/build/virtualenv/populate_virtualenv.py +++ b/python/mozbuild/mozbuild/virtualenv.py @@ -366,7 +366,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.topobjdir, self.virtualenv_root, self.manifest_path] result = subprocess.call(args, stdout=self.log_handle, stderr=subprocess.STDOUT, cwd=self.topsrcdir) @@ -409,26 +409,19 @@ 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) < 5: + print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/topobjdir /path/to/virtualenv /path/to/virtualenv_manifest') sys.exit(1) verify_python_version(sys.stdout) - topsrcdir = sys.argv[1] - topobjdir = sys.argv[2] - virtualenv_path = sys.argv[3] + topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[1:5] 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] - - # path to default packages.txt - manifest_path = os.path.join(topsrcdir, 'build', 'virtualenv', 'packages.txt') + topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[2:] manager = VirtualenvManager(topsrcdir, topobjdir, virtualenv_path, sys.stdout, manifest_path)