Bug 1317674 - Use the correct path to the binary for comm builds in the XPCOM glue check + exceptions for Calendar and Instantbird. r=glandium
authoraleth <aleth@instantbird.org>
Wed, 16 Nov 2016 02:01:04 +0100
changeset 322938 c5f032bd4cf861c3058f244140399f7fb2fea663
parent 322937 a72de75573c855e675328d3ceba32ebd84fab983
child 322939 68b33d652efc4e502fc2f270026434cee7dc86a9
push id84012
push useraleth@instantbird.org
push dateThu, 17 Nov 2016 10:16:44 +0000
treeherdermozilla-inbound@c5f032bd4cf8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1317674
milestone53.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 1317674 - Use the correct path to the binary for comm builds in the XPCOM glue check + exceptions for Calendar and Instantbird. r=glandium
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/test/frontend/test_emitter.py
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -137,16 +137,18 @@ ALLOWED_XPCOM_GLUE = {
     ('testcrasher', 'toolkit/crashreporter/test'),
     ('jsep_session_unittest', 'media/webrtc/signaling/test'),
     ('jsep_track_unittest', 'media/webrtc/signaling/test'),
     ('mediaconduit_unittests', 'media/webrtc/signaling/test'),
     ('mediapipeline_unittest', 'media/webrtc/signaling/test'),
     ('sdp_file_parser', 'media/webrtc/signaling/fuzztest'),
     ('signaling_unittests', 'media/webrtc/signaling/test'),
     ('TestMailCookie', 'mailnews/base/test'),
+    ('calbasecomps', 'calendar/base/backend/libical/build'),
+    ('purplexpcom', 'extensions/purple/purplexpcom/src'),
 }
 
 
 class TreeMetadataEmitter(LoggingMixin):
     """Converts the executed mozbuild files into data structures.
 
     This is a bridge between reader.py and data.py. It takes what was read by
     reader.BuildReader and converts it into the classes defined in the data
@@ -410,20 +412,27 @@ class TreeMetadataEmitter(LoggingMixin):
             obj.link_library(candidates[0])
 
         # Link system libraries from OS_LIBS/HOST_OS_LIBS.
         for lib in context.get(variable.replace('USE', 'OS'), []):
             obj.link_system_library(lib)
 
         key = (obj.name, obj.relativedir)
         substs = context.config.substs
-        extra_allowed = [
-            (substs.get('MOZ_APP_NAME'), '%s/app' % substs.get('MOZ_BUILD_APP')),
-            ('%s-bin' % substs.get('MOZ_APP_NAME'), '%s/app' % substs.get('MOZ_BUILD_APP')),
-        ]
+        extra_allowed = []
+        moz_build_app = substs.get('MOZ_BUILD_APP')
+        if moz_build_app is not None: # None during some test_emitter.py tests.
+            if moz_build_app.startswith('../'):
+                # For comm-central builds, where topsrcdir is not the root
+                # source dir.
+                moz_build_app = moz_build_app[3:]
+            extra_allowed = [
+                (substs.get('MOZ_APP_NAME'), '%s/app' % moz_build_app),
+                ('%s-bin' % substs.get('MOZ_APP_NAME'), '%s/app' % moz_build_app),
+            ]
         if substs.get('MOZ_WIDGET_TOOLKIT') != 'android':
             extra_allowed.append((substs.get('MOZ_CHILD_PROCESS_NAME'), 'ipc/app'))
 
         if key in ALLOWED_XPCOM_GLUE or key in extra_allowed:
             if not use_xpcom:
                 raise SandboxValidationError(
                     "%s is in the exception list for XPCOM glue dependency but "
                     "doesn't depend on the XPCOM glue. Please adjust the list "
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -1174,17 +1174,17 @@ class TestEmitterBasic(unittest.TestCase
         from mozbuild.frontend.emitter import ALLOWED_XPCOM_GLUE
 
         allowed = defaultdict(list)
         useless = []
         for name, path in ALLOWED_XPCOM_GLUE:
             allowed[path].append(name)
 
         for path, names in allowed.iteritems():
-            if path.startswith('mailnews/'):
+            if path.startswith(('mailnews/', 'calendar/', 'extensions/purple/purplexpcom')):
                 continue
             try:
                 content = open(os.path.join(topsrcdir, path, 'moz.build')).read()
             except:
                 content = ''
             for name in names:
                 if "'%s'" % name in content or '"%s"' % name in content:
                     continue