Bug 1278900 - [mach] Also look for config.status when detecting an objdir, r?gps draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 08 Jun 2016 10:33:54 -0400
changeset 377088 1fb6dd2ff7018218bc4a07c7f2a96a88451a1439
parent 376593 f8ad071a6e14331d73fa44c8d3108bc2b66b2174
child 377089 73a38d9338eb404c921ca797c8f03dba4bc54240
push id20747
push userahalberstadt@mozilla.com
push dateThu, 09 Jun 2016 16:41:51 +0000
reviewersgps
bugs1278900
milestone50.0a1
Bug 1278900 - [mach] Also look for config.status when detecting an objdir, r?gps Currently the mach binary will look for 'mozinfo.json' and if it finds it assume we are in an objdir. But now, 'mozinfo.json' can also be found in an extracted tests.zip (depending which zips were used). This trips up the tests.zip mach environment and causes some problems. This works around the issue by looking for both 'mozinfo.json' and 'config.status' MozReview-Commit-ID: BIXcCm4LzE2
mach
--- a/mach
+++ b/mach
@@ -41,19 +41,20 @@ def check_and_get_mach(dir_path):
         if os.path.isfile(mach_path):
             return load_mach(dir_path, mach_path)
     return None
 
 
 def get_mach():
     # Check whether the current directory is within a mach src or obj dir.
     for dir_path in ancestors(os.getcwd()):
-        # If we find a "mozinfo.json" file, we are in the objdir.
+        # If we find a "config.status" and "mozinfo.json" file, we are in the objdir.
+        config_status_path = os.path.join(dir_path, 'config.status')
         mozinfo_path = os.path.join(dir_path, 'mozinfo.json')
-        if os.path.isfile(mozinfo_path):
+        if os.path.isfile(config_status_path) and os.path.isfile(mozinfo_path):
             import json
             info = json.load(open(mozinfo_path))
             if 'mozconfig' in info and 'MOZCONFIG' not in os.environ:
                 # If the MOZCONFIG environment variable is not already set, set it
                 # to the value from mozinfo.json.  This will tell the build system
                 # to look for a config file at the path in $MOZCONFIG rather than
                 # its default locations.
                 #