summaryrefslogtreecommitdiffstats
path: root/build/gyp_helper.py
diff options
context:
space:
mode:
authorscheib <scheib@chromium.org>2015-03-13 17:14:01 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-14 00:14:52 +0000
commiteedc9ac929470feba9b8b4899c1aad14cbb5b97b (patch)
tree5b7568b91ed3b2f7e2d51b15b55e2d8e8c54049f /build/gyp_helper.py
parentad0efe96f7536cdb640ee935c515548c8fccb36a (diff)
downloadchromium_src-eedc9ac929470feba9b8b4899c1aad14cbb5b97b.zip
chromium_src-eedc9ac929470feba9b8b4899c1aad14cbb5b97b.tar.gz
chromium_src-eedc9ac929470feba9b8b4899c1aad14cbb5b97b.tar.bz2
Clarify warning for GYP variable merging.
https://codereview.chromium.org/931643002 changed variable merging behavior for environment variables and chromium.gyp_env. The new behavior replaces variables, with the exception of GYP_DEFINES which is instead concatenated. This change clarifies the state of the variables to the developer by printing values, and more accurately describes the override behavior as 'merges with, and individual components override,'. Review URL: https://codereview.chromium.org/993143002 Cr-Commit-Position: refs/heads/master@{#320609}
Diffstat (limited to 'build/gyp_helper.py')
-rw-r--r--build/gyp_helper.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/build/gyp_helper.py b/build/gyp_helper.py
index a2cc7e1..9be2b9e 100644
--- a/build/gyp_helper.py
+++ b/build/gyp_helper.py
@@ -44,11 +44,17 @@ def apply_gyp_environment_from_file(file_path):
if var in os.environ:
behavior = 'replaces'
if var == 'GYP_DEFINES':
- os.environ[var] = file_val + ' ' + os.environ[var]
- behavior = 'overrides'
+ result = file_val + ' ' + os.environ[var]
+ behavior = 'merges with, and individual components override,'
+ else:
+ result = os.environ[var]
print 'INFO: Environment value for "%s" %s value in %s' % (
var, behavior, os.path.abspath(file_path)
)
+ string_padding = max(len(var), len(file_path), len('result'))
+ print ' %s: %s' % (var.rjust(string_padding), os.environ[var])
+ print ' %s: %s' % (file_path.rjust(string_padding), file_val)
+ os.environ[var] = result
else:
os.environ[var] = file_val