Bug 1369433 - Fix gyp_reader to take mozilla_cflags in to account when CFLAGS et al are set via sandbox_vars.
Prior to this patch setting sandbox_vars['CFLAGS'] would cause those to
override any variables set by gyp via cflags_mozilla. In general
sanbox_vars are used to override values, and there's room for
a clearer interaction between moz.build and gyp, but discarding cflags
set in cflags_mozilla is almost certainly not the intended behavior here,
and this solves the immediate issue.
MozReview-Commit-ID: 1uCgXr5lagA
--- a/python/mozbuild/mozbuild/frontend/gyp_reader.py
+++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py
@@ -321,17 +321,25 @@ def process_gyp_result(gyp_result, gyp_d
'/ipc/glue',
]
# These get set via VC project file settings for normal GYP builds.
if config.substs['OS_TARGET'] == 'WINNT':
context['DEFINES']['UNICODE'] = True
context['DEFINES']['_UNICODE'] = True
context['DISABLE_STL_WRAPPING'] = True
- context.update(gyp_dir_attrs.sandbox_vars)
+ 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]
+ 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).
def load_gyp(*args):
_, flat_list, targets, data = gyp.Load(*args)
return flat_list, targets, data