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 316222 9d5982f805c9b8cc26360ebafb9519c7414434e9
parent 316221 180d4a79ad6f0c041097b49561e20e41054d4f11
child 316223 27f488a1f9efa704afc98f2319aca94eaed4b32d
push id20649
push userphilringnalda@gmail.com
push dateTue, 04 Oct 2016 03:52:28 +0000
treeherderfx-team@96c39d552134 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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
--- 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:
         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 '