Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: pylib/gyp/generator/msvs.py

Issue 10387164: msvs: fix regression in r1378, environment not set up properly for multiple actions on one input (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: add comment, use set instead of one-sided dict Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/many-actions/file0 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/msvs.py
diff --git a/pylib/gyp/generator/msvs.py b/pylib/gyp/generator/msvs.py
index 2d15a3570836b33afe08d5f303bd22c316e28cad..2d2c379b5bb58e80916da181a8df31deacb8ddaf 100644
--- a/pylib/gyp/generator/msvs.py
+++ b/pylib/gyp/generator/msvs.py
@@ -1457,12 +1457,17 @@ def _AddActions(actions_to_add, spec, relative_path_of_gyp_file, vcproj_file):
actions = spec.get('actions', [])
# Don't setup_env every time. When all the actions are run together in one
# batch file in VS, the PATH will grow too long.
- first_action = True
+ # Membership in this set means that the cygwin environment has been set up,
+ # and does not need to be set up again.
+ have_setup_env = set()
for a in actions:
- cmd = _BuildCommandLineForRule(spec, a, has_input_path=False,
- do_setup_env=first_action)
# Attach actions to the gyp file if nothing else is there.
inputs = a.get('inputs') or [relative_path_of_gyp_file]
+ attached_to = inputs[0]
+ need_setup_env = attached_to not in have_setup_env
+ cmd = _BuildCommandLineForRule(spec, a, has_input_path=False,
+ do_setup_env=need_setup_env)
+ have_setup_env.add(attached_to)
if vcproj_file:
# Additionally, on MSVS 2008, we record the command in a file
# and add this as a dependency so that when the command changes,
@@ -1477,7 +1482,6 @@ def _AddActions(actions_to_add, spec, relative_path_of_gyp_file, vcproj_file):
outputs=a.get('outputs', []),
description=a.get('message', a['action_name']),
command=cmd)
- first_action = False
def _WriteMSVSUserFile(project_path, version, spec):
« no previous file with comments | « no previous file | test/many-actions/file0 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698