Bug 1410773: Add optional comm-central virtualenv manifest; r?Build draft
authorTom Prince <mozilla@hocat.ca>
Sun, 22 Oct 2017 13:40:20 -0600
changeset 684972 285455cdd62c23f2aa13784d674a48fcb9eae62b
parent 684554 b98f7c744f936af6670a92475e18b11a4243ced2
child 737015 2fc57d0251d8621ab9fa6eac3a18a4ae50aa257b
push id85784
push userbmo:mozilla@hocat.ca
push dateMon, 23 Oct 2017 21:02:21 +0000
reviewersBuild
bugs1410773
milestone58.0a1
Bug 1410773: Add optional comm-central virtualenv manifest; r?Build comm-central taskcluster builds have comm-central checkout in `comm/`. This will add packages specified in comm-central when it checked out, and will ignore the missing file for mozilla-central builds. MozReview-Commit-ID: Amg5vJHoWkS
build/mach_bootstrap.py
build/virtualenv_packages.txt
--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -117,26 +117,37 @@ 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:
+    def handle_package(package):
+        if package[0] == 'optional':
+            try:
+                for path in handle_package(package[1:]):
+                    yield path
+            except:
+                pass
+
         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])
 
+    for package in packages:
+        for path in handle_package(package):
+            yield path
+
 
 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.
--- a/build/virtualenv_packages.txt
+++ b/build/virtualenv_packages.txt
@@ -52,8 +52,9 @@ mozilla.pth:testing/xpcshell
 mozilla.pth:third_party/python/mock-1.0.0
 mozilla.pth:xpcom/typelib/xpt/tools
 mozilla.pth:tools/docs
 mozilla.pth:media/webrtc/trunk/tools/gyp/pylib
 mozilla.pth:third_party/python/pyasn1
 mozilla.pth:third_party/python/pyasn1-modules
 mozilla.pth:third_party/python/rsa
 mozilla.pth:third_party/python/PyECC
+optional:packages.txt:comm/build/virtualenv_packages.txt