Bug 1304593 - Take universal binaries into account when detecting objdir mismatches, r=gps
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 30 Sep 2016 14:27:38 -0400
changeset 316198 9d5982f805c9b8cc26360ebafb9519c7414434e9
parent 316197 180d4a79ad6f0c041097b49561e20e41054d4f11
child 316199 27f488a1f9efa704afc98f2319aca94eaed4b32d
push id30765
push userphilringnalda@gmail.com
push dateTue, 04 Oct 2016 03:06:46 +0000
treeherdermozilla-central@adb484f84dec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1304593
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1304593 - Take universal binaries into account when detecting objdir mismatches, r=gps When attempting to run mach from a make target, there were failures on OSX due to an objdir mismatch: https://dxr.mozilla.org/mozilla-central/rev/7c576fe3279d87543f0a03b844eba7bc215e17f1/python/mozbuild/mozbuild/base.py#656 The two detected objdirs were "<objdir>" and "<objdir>/x86_64". I believe this should not count as a mismatch, otherwise it would not be possible to run a mach command from the x86_64 directory. MozReview-Commit-ID: CXDEABNWX8L
python/mozbuild/mozbuild/base.py
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -643,18 +643,24 @@ class MachCommandBase(MozbuildObject):
             topobjdir = dummy._topobjdir
             if topobjdir:
                 # If we're inside a objdir and the found mozconfig resolves to
                 # another objdir, we abort. The reasoning here is that if you
                 # are inside an objdir you probably want to perform actions on
                 # that objdir, not another one. This prevents accidental usage
                 # of the wrong objdir when the current objdir is ambiguous.
                 config_topobjdir = dummy.resolve_mozconfig_topobjdir()
-                if config_topobjdir and not samepath(topobjdir,
-                                                     config_topobjdir):
+
+                try:
+                    universal_bin = dummy.substs.get('UNIVERSAL_BINARY')
+                except:
+                    universal_bin = False
+
+                if config_topobjdir and not (samepath(topobjdir, config_topobjdir) or
+                        universal_bin and topobjdir.startswith(config_topobjdir)):
                     raise ObjdirMismatchException(topobjdir, config_topobjdir)
         except BuildEnvironmentNotFoundException:
             pass
         except ObjdirMismatchException as e:
             print('Ambiguous object directory detected. We detected that '
                 'both %s and %s could be object directories. This is '
                 'typically caused by having a mozconfig pointing to a '
                 'different object directory from the current working '