Bug 1386876 - Allow dictionary variables to be passed to gyp_dir_attrs. r=glandium
authorChris Manchester <cmanchester@mozilla.com>
Mon, 11 Sep 2017 11:36:46 -0700
changeset 429623 562b0ea038287db1aa841d8db7d3f631ff286df4
parent 429622 40dbde701504661c0b537073ba6bbd305c76e7a9
child 429624 2de74e37233164513adc7145871ea56b3fb76166
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1386876
milestone57.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 1386876 - Allow dictionary variables to be passed to gyp_dir_attrs. r=glandium MozReview-Commit-ID: HTfZLqM9Mdd
python/mozbuild/mozbuild/frontend/gyp_reader.py
--- a/python/mozbuild/mozbuild/frontend/gyp_reader.py
+++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py
@@ -329,16 +329,18 @@ def process_gyp_result(gyp_result, gyp_d
         context['COMPILE_FLAGS']['STL'] = []
 
         for key, value in gyp_dir_attrs.sandbox_vars.items():
             if context.get(key) and isinstance(context[key], list):
                 # If we have a key from sanbox_vars that's also been
                 # populated here we use the value from sandbox_vars as our
                 # basis rather than overriding outright.
                 context[key] = value + context[key]
+            elif context.get(key) and isinstance(context[key], dict):
+                context[key].update(value)
             else:
                 context[key] = value
 
         yield context
 
 
 # A version of gyp.Load that doesn't return the generator (because module objects
 # aren't Pickle-able, and we don't use it anyway).