--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -27,84 +27,16 @@ If you would like to use a different dir
MOZBUILD_STATE_PATH environment variable to the directory you would like to
use and re-run mach. For this change to take effect forever, you'll likely
want to export this environment variable from your shell's init scripts.
Press ENTER/RETURN to continue or CTRL+c to abort.
'''.lstrip()
-# TODO Bug 794506 Integrate with the in-tree virtualenv configuration.
-SEARCH_PATHS = [
- 'python/mach',
- 'python/mozboot',
- 'python/mozbuild',
- 'python/mozlint',
- 'python/mozversioncontrol',
- 'python/blessings',
- 'python/compare-locales',
- 'python/configobj',
- 'python/dlmanager',
- 'python/futures',
- 'python/jsmin',
- 'python/psutil',
- 'python/pylru',
- 'python/which',
- 'python/pystache',
- 'python/pyyaml/lib',
- 'python/requests',
- 'python/slugid',
- 'python/py',
- 'python/pytest',
- 'python/pytoml',
- 'python/redo',
- 'python/voluptuous',
- 'build',
- 'build/pymake',
- 'config',
- 'dom/bindings',
- 'dom/bindings/parser',
- 'dom/media/test/external',
- 'layout/tools/reftest',
- 'other-licenses/ply',
- 'taskcluster',
- 'testing',
- 'testing/firefox-ui/harness',
- 'testing/marionette/client',
- 'testing/marionette/harness',
- 'testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py',
- 'testing/marionette/puppeteer/firefox',
- 'testing/mozbase/mozcrash',
- 'testing/mozbase/mozdebug',
- 'testing/mozbase/mozdevice',
- 'testing/mozbase/mozfile',
- 'testing/mozbase/mozhttpd',
- 'testing/mozbase/mozinfo',
- 'testing/mozbase/mozinstall',
- 'testing/mozbase/mozleak',
- 'testing/mozbase/mozlog',
- 'testing/mozbase/moznetwork',
- 'testing/mozbase/mozprocess',
- 'testing/mozbase/mozprofile',
- 'testing/mozbase/mozrunner',
- 'testing/mozbase/mozsystemmonitor',
- 'testing/mozbase/mozscreenshot',
- 'testing/mozbase/moztest',
- 'testing/mozbase/mozversion',
- 'testing/mozbase/manifestparser',
- 'testing/taskcluster',
- 'testing/tools/autotry',
- 'testing/web-platform',
- 'testing/web-platform/harness',
- 'testing/web-platform/tests/tools/wptserve',
- 'testing/web-platform/tests/tools/six',
- 'testing/xpcshell',
- 'xpcom/idl-parser',
-]
-
# Individual files providing mach commands.
MACH_MODULES = [
'addon-sdk/mach_commands.py',
'build/valgrind/mach_commands.py',
'devtools/shared/css/generated/mach_commands.py',
'dom/bindings/mach_commands.py',
'dom/media/test/external/mach_commands.py',
'layout/tools/reftest/mach_commands.py',
@@ -179,16 +111,31 @@ CATEGORIES = {
}
}
# We submit data to telemetry approximately every this many mach invocations
TELEMETRY_SUBMISSION_FREQUENCY = 10
+def search_path(mozilla_dir, packages_txt):
+ with open(os.path.join(mozilla_dir, packages_txt)) as f:
+ packages = [line.rstrip().split(':') for line in f]
+
+ for package in packages:
+ if package[0] == 'packages.txt':
+ assert len(package) == 2
+ for p in search_path(mozilla_dir, package[1]):
+ yield os.path.join(mozilla_dir, p)
+
+ if package[0].endswith('.pth'):
+ assert len(package) == 2
+ yield os.path.join(mozilla_dir, package[1])
+
+
def bootstrap(topsrcdir, mozilla_dir=None):
if mozilla_dir is None:
mozilla_dir = topsrcdir
# Ensure we are running Python 2.7+. We put this check here so we generate a
# user-friendly error message rather than a cryptic stack trace on module
# import.
if sys.version_info[0] != 2 or sys.version_info[1] < 7:
@@ -199,17 +146,19 @@ def bootstrap(topsrcdir, mozilla_dir=Non
# Global build system and mach state is stored in a central directory. By
# default, this is ~/.mozbuild. However, it can be defined via an
# environment variable. We detect first run (by lack of this directory
# existing) and notify the user that it will be created. The logic for
# creation is much simpler for the "advanced" environment variable use
# case. For default behavior, we educate users and give them an opportunity
# to react. We always exit after creating the directory because users don't
# like surprises.
- sys.path[0:0] = [os.path.join(mozilla_dir, path) for path in SEARCH_PATHS]
+ sys.path[0:0] = [os.path.join(mozilla_dir, path)
+ for path in search_path(mozilla_dir,
+ 'build/virtualenv_packages.txt')]
import mach.main
from mozboot.util import get_state_dir
from mozbuild.util import patch_main
patch_main()
def telemetry_handler(context, data):
# We have not opted-in to telemetry