From b5b5de46a42fb7a3c3f33d58c2f413a9dfc09177 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Wed, 8 Jun 2016 10:33:54 -0400 Subject: [PATCH] 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 --HG-- extra : rebase_source : 6e2dc0502de1cddec8eccdfe30524864be81536c --- mach | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mach b/mach index 433f3f43716d..e745cbc2eac5 100755 --- a/mach +++ b/mach @@ -46,9 +46,10 @@ def check_and_get_mach(dir_path): 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: